How many periods it is needed for fft to give us a proper estimate over frequency?
Afficher commentaires plus anciens
Dear all,
I have a basic question. Imagine a simple sinusoidal defined as below:
Fs = 150;
t = 0:1/Fs:0.2;
f = 5;
x = sin(2*pi*t*f);
nfft = 1024;
X = fft(x,nfft);
X = X(1:nfft/2);
MX = abs(X);
f = (0:nfft/2-1)*Fs/nfft;
plot(f,MX)
The period of signal(lambda) is 0.2 (f=5). Now, if I change this expression(t = 0:1/Fs:0.2;) any time before plotting, from a half sine (t = 0:1/Fs:0.1;) to 5 repeated periods (t = 0:1/Fs:1;), only after when two full periods are at least used for calculating fft, fft gives us a good estimate(something around 5) of the signal frequency. Why?
Réponses (2)
Wayne King
le 5 Nov 2013
It's not that simple. You can get a good estimate with just one period depending on the frequency spacing in the DFT.
Fs = 500;
t = 0:1/Fs:0.2-1/Fs;
x = cos(2*pi*5*t);
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
df = Fs/length(x);
freqvec = 0:df:250;
stem(freqvec,abs(xdft),'markerfacecolor',[0 0 1])
Mona Mahboob Kanafi
le 6 Nov 2013
Modifié(e) : Mona Mahboob Kanafi
le 6 Nov 2013
0 votes
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!