sampling phase and interpolation

From Optical Imaging and Spectroscopy (Wiley - OSA 2009)
By David J. Brady
www.opticalimaging.org
Figures 7.6-7.8

Cosine sampling at 4Nyquist/5

nu=.9;
f[x_,phi_]:=(1+Cos[2 Pi nu x+phi])/2;
ShannonF[x_,phi_]:=Sum[f[0.5 n,phi]Sin[Pi (2x-n)]/(Pi (2 x- n)+10^-9),{n,-100,100}];

fa=Table[ListPlot[Table[{(x/2),f[(x/2),n1 π+((n2 π)/4)]},{x,0,20}],Joined->True,Axes->False,Frame->True,PlotRange->{0,1},FrameTicks->{{0,5,10},{0,1},{},{}},PlotLabel->"ϕ="<>ToString[n1 180+n2 45],PlotStyle->{Black}],{n2,0,3},{n1,0,1}];

Show[GraphicsGrid[Transpose[fa]]]

fa=Table[Plot[ShannonF[x,n1*Pi+n2*Pi/4],{x,0,10},Axes->False,Frame->True,FrameTicks->{{0,5,10},{0,1},{},{}},PlotLabel->StringJoin["ϕ=",ToString[n1*180+n2*45]],PlotStyle->{Black}],{n2,0,3},{n1,0,1}];

Show[GraphicsGrid[Transpose[fa]]]

Now with noise

nu=.9;
f[x_,phi_]:=(1+Cos[2 Pi nu x+phi])/2;
ShannonFN[x_,phi_]:=Sum[(f[0.5 n,phi]+RandomReal[NormalDistribution[0,0.1]])Sin[Pi (2x-n)]/(Pi (2 x- n)+10^-9),{n,-100,100}];

fa=Table[ListPlot[Table[{(x/2),f[(x/2),n1 π+((n2 π)/4)]},{x,0,20}],Joined->True,Axes->False,Frame->True,PlotRange->{0,1},FrameTicks->{{0,5,10},{0,1},{},{}},PlotLabel->"ϕ="<>ToString[n1 180+n2 45],PlotStyle->{Black}],{n2,0,3},{n1,0,1}];

Show[GraphicsGrid[Transpose[fa]]]

fa=Table[Plot[ShannonFN[x,n1*Pi+n2*Pi/4],{x,0,10},Axes->False,Frame->True,FrameTicks->{{0,5,10},{0,1},{},{}},PlotLabel->StringJoin["ϕ=",ToString[n1*180+n2*45]],PlotStyle->{Black}],{n2,0,3},{n1,0,1}];

Show[GraphicsGrid[Transpose[fa]]]

Cosine sampling at 1.5Nyquist

nu=1.5;
f[x_,phi_]:=(1+Cos[2 Pi nu x+phi])/2;
ShannonF[x_,phi_]:=Sum[f[0.5 n,phi]Sin[Pi (2x-n)]/(Pi (2 x- n)+10^-9),{n,-100,100}];

fa=Table[ListPlot[Table[{(x/2),f[(x/2),n1 π+((n2 π)/4)]},{x,0,20}],Joined->True,Axes->False,Frame->True,PlotRange->{0,1},FrameTicks->{{0,5,10},{0,1},{},{}},PlotLabel->"ϕ="<>ToString[n1 180+n2 45]],{n2,0,3},{n1,0,1}];

Show[GraphicsGrid[Transpose[fa]]]

fb=Table[Plot[ShannonF[x,n1*Pi+n2*Pi/4],{x,0,10},Axes->False,Frame->True,FrameTicks->{{0,5,10},{0,1},{},{}},PlotLabel->StringJoin["ϕ=",ToString[n1*180+n2*45]]],{n2,0,3},{n1,0,1}];

dog=Show[GraphicsGrid[Transpose[fa]]]

pop=Join[Transpose[fa],Transpose[fb]];

Show[GraphicsGrid[pop]]