How many periods it is needed for fft to give us a proper estimate over frequency?
    19 次查看(过去 30 天)
  
       显示 更早的评论
    
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 个评论
回答(2 个)
  Wayne King
    
      
 2013-11-5
        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 个评论
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

