(Local) In[]:=
gT_samp=10^(-2);(*samplingperiod*)
(Local) In[]:=
g_f=10;(*frequency*)
(Local) In[]:=
x[t_]=Exp[I*2Pi*g_f*t];(*continuoustimewave*)
(Local) In[]:=
x_d[t_]=x[Floor[t/gT_samp]*gT_samp];(*discretizedwave*)
(Local) In[]:=
Plot[{Re[x[t]],Re[x_d[t]]},{t,0,2/g_f},Filling->Axis,PlotLegends->"Expressions"]
(Local) Out[]=
(Local) In[]:=
gN=200;gT_int=gN*gT_samp;(*Integrationtime*)
(Local) In[]:=
X[f_]=Integrate[x[t]*Exp[-I*2Pi*f*t],{t,0,gT_int}]/gT_int
(Local) Out[]=
-
-4fπ
2(20π-2fπ)
(Local) In[]:=
X_d[f_]=(1-Exp[-I*2Pi*f*gT_samp])/(I*2Pi*f)/gT_int*Exp[I*2Pi*(g_f-f)/2*(gN-1)*gT_samp]*gN*Sinc[2Pi*(g_f-f)/2*gN*gT_samp]/Sinc[2Pi*(g_f-f)/2*gT_samp](*equalstoIntegrate[f_d[t]*Exp[-I*2Pi*f*t],{t,0,gT_int}]/gT_int*)
(Local) Out[]=
-
50(10-f)π1-Sinc[2(10-f)π]
199
100
-fπ
1
50
fπSinc(10-f)π
1
100
(Local) In[]:=
Plot[{20Log10[Abs[X[f]]],20Log10[Abs[X_d[f]]]},{f,0,2g_f},PlotRange->{-80,0},PlotStyle->{Default,Dashed},PlotLegends->"Expressions",PlotLabel->"power spectrum in the neighborhood of original frequency"]
(Local) Out[]=
(Local) In[]:=
Plot[Arg[X[f]]/Degree,{f,0,2g_f},PlotRangeFull,PlotLabel"phase of the spectrum of original signal"]
(Local) Out[]=
(Local) In[]:=
Plot[Arg[X_d[f]]/Degree,{f,0,2g_f},PlotRangeFull,PlotLabel"phase of the spectrum of discretized signal"]
(Local) Out[]=
Plot[{20Log10[Abs[X[f]]],20Log10[Abs[X_d[f]]]},{f,0,3/gT_samp},PlotRange->{-80,0},PlotLegends->"Expressions",PlotLabel->"power spectrum with harmonics"]
(Local) Out[]=