Discrete Fourier Transform and Modulations

What does a modulated wave form look like in Fourier space?

Clear["Global`*"]

Assume there is a periodic wave with period Tw, and you sample data by taking “npts” data points with a sample interval of Δt, for a total sample time of ‘Tmax’.  The Fourier transform assumes the function is periodic with period Tmax.

Vf[p_, fp_,t_] := (1/10)(5 + p Cos[2 π fp t]) * Cos[2 π fc t]

a.  Modulated Signal

The system acquires data at a sample rate of 256 k/s.  The carrier wave has frequency fc = 50 kHz; the program wave has frequency 2 kHz.

Δt = 1.0/256(* milliseconds *);
npts = 1024;
Tmax = npts * Δt;
f1 = 1/Tmax; (* Fundamental frequency of acquisition *)
fc = 50.0; 
fp = 2.0;

data=  Table[Vf[0.5, fp, t], {t, 0, Tmax-Δt, Δt}];

Here is a portion of the the modulated signal:

Vtable = Table[{(n-1)* Δt, data[[n]]},{n, 1, Length[data]}];

ListLinePlot[Vtable[[Range[npts/4]]], 
LabelStyle->Larger, AxesLabel->{"t (ms)", "V (V)"}, AspectRatio->1/3,ImageSize -> Scaled[0.8]]

Use the Fourier[ ] function to do the Fourier transform. The Fourier[ ] function returns the element for frequency ‘0’ in slot ‘1’ of the array
The SR770 only displays the first 400 channels of the Fourier Transform.

doFT[p_, fp_] := Module[{data, ft, ftAmp },
data=  Table[Vf[p, fp, t], {t, 0, Tmax-Δt, Δt}];
ft = Abs[Fourier[data]];
ftAmp = Table[{(n-1) * f1, ft[[n]]}, {n, 1, 400}];
ListLogPlot[ftAmp, PlotRange->All, Joined -> True, Mesh -> All, LabelStyle->Larger, AxesLabel->{"f (kHz)", "Amplitude"}, ImageSize -> Scaled[0.8]]
]

Manipulate[doFT[p,  fp], {{p, 0.5}, 0, 1, 0.1, Appearance -> "Open"}, {{fp,1}, 0.5, 5.0, 0.5, Appearance -> "Open"}]