Professional Documents
Culture Documents
W. Rose 2013-04-06
Suppose
𝑥 𝑡
= 𝑑1 sin 2𝜋 · 𝑓 · 𝑡 + 𝑑3 sin 2𝜋 · 3𝑓 · 𝑡
+ 𝑑5 sin 2𝜋 · 5𝑓 · 𝑡
where
f=1 , d1=4/𝜋 = 1.273, d3=4/(3𝜋) = 0.424, d5=4/(5𝜋) = 0.255.
This means x(t) is comprised of sinusoidal components with
frequencies of 1, 3, and 5 Hz, with amplitudes given by d1, d3,
and d5.*
Suppose also that the sampling rate is fsamp=100 Hz, i.e.
dT=1/fsamp=0.01 s, and suppose that we collect data for 5
seconds (Ttotal=5 s).
*dk=4/(kπ)=amplitudes for ±1V square wave (k odd).
dt=0.01
t=(0:499)*dt;
f=1;
d1=4/pi;
d3=4/(3*pi);
d5=4/(5*pi);
x=d1*sin(2*pi*f*t)…
+d3*sin(2*pi*3*f*t)…
+d5*sin(2*pi*5*f*t);
plot(t,x,’.r-’);
Amplitude spectrum
(two-sided)
Amplitude spectrum
(two-sided)
Output from FFT.vi scales like record length n. Other VIs return output whichh is
independent of record length. FFT and Power_Spectrum return two-sided spectra,
which is why their non DC scaling is divided by 2. The other VIs return one-sided
spectra. FFT_Power_Spectral_Density divides each power spectrum estimate by
Δf, the frequency spacing between estimates (Δf =spectral width of each estimate).