FFT and sin wave
2 ビュー (過去 30 日間)
古いコメントを表示
A small doubt in signal processing. When you take fft of a signal -- k=fft(y,512); and plot it, we get 512 points. I want to represent the 'x' axis in Hz . How would you do that? For eg: if k=40 what is the the corresponding frequency in Hz for a 512 point FFT?
0 件のコメント
採用された回答
Wayne King
2011 年 10 月 11 日
If the signal is real-valued:
t = 0:.001:1-0.001;
Fs = 1e3;
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
freq = 0:Fs/length(x):Fs/2;
plot(freq,abs(xdft));
xlabel('Hz');
1 件のコメント
Wayne King
2011 年 10 月 11 日
Frequencies are spaced at Fs/N where Fs is the sampling frequency and N is the length input signal.
その他の回答 (2 件)
i Venky
2011 年 10 月 11 日
1 件のコメント
Wayne King
2011 年 10 月 11 日
Yes, but just keep in mind that the frequency resolution of your DFT is determined by the length of your input signal, NOT by the value of any zero padding. Zero padding just interpolates your DFT, it does not give you any better resolution.
参考
カテゴリ
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!