How many periods it is needed for fft to give us a proper estimate over frequency?
35 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (2)
Wayne King
el 5 de Nov. de 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])
0 comentarios
Mona Mahboob Kanafi
el 6 de Nov. de 2013
Editada: Mona Mahboob Kanafi
el 6 de Nov. de 2013
0 comentarios
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!