How to know about FFT bin frequencies

89 ビュー (過去 30 日間)
johnmay
johnmay 2015 年 12 月 1 日
回答済み: himanshu tripathi 2019 年 6 月 8 日
Hi guys Im not used to computing fft on matlab and I have some doubts so if you could tell me if im right or wrong... My signal is h : N = 16384 Sampling frequency = 65536Hz
if I do : fft(h,65536) I should have a frequency step of 1Hz, right???? Like first bin stands for 0Hz, second for 1 Hz...
I would like to compute a FFT in the frequency range [0 - 6000 Hz] but with a 1 Hz frequency step. Could you help me please??
I would be very thankful for all answers and explainations ! Bye

回答 (5 件)

Star Strider
Star Strider 2015 年 12 月 1 日
The easiest way to find out is to do the experiment:
Fs = 65536; % Sampling Frequency (Hz)
Ts = 1/Fs; % Sampling Interval (sec)
Fn = Fs/2; % Nyquist Frequency (Hz)
L = 16384; % Signal Length (samples)
t = [0:(L-1)]*Ts; % Time Vector (sec)
s = cos(2*pi*100*t); % Signal (100 Hz)
FTs = fft(s,Fs)/L; % Experiment #1
Fv = linspace(0, 1, fix(Fs/2)+1)*Fn;
Iv = 1:length(Fv);
[PeakFTs,Idx] = max(abs(FTs(Iv))*2); % Find MAximum and Index
figure(1)
plot(Fv, abs(FTs(Iv))*2)
axis([0 500 ylim])
grid
text(Fv(Idx)+10, PeakFTs, sprintf('Peak at %.3f Hz, Index %d', Fv(Idx), Idx), 'HorizontalAlignment','left', 'VerticalAlignment','top')

Adam
Adam 2015 年 12 月 1 日
編集済み: Adam 2015 年 12 月 1 日
A 65536-pt FFT would, in your case give 1Hz bins for a sample frequency of 65536 Hz.
If you only want the FFT from 0 to 6000 then just clip the result of the FFT to
y = fft( h, 65536 );
y = y(1:6001);
and this should give you the frequencies from 0 to 6000 at 1Hz intervals.

johnmay
johnmay 2015 年 12 月 2 日
Thank you a lot guys!!!

himanshu tripathi
himanshu tripathi 2019 年 6 月 8 日
Screenshot (293).png

himanshu tripathi
himanshu tripathi 2019 年 6 月 8 日
Please have a look at the code and plot of 1kHz frequency (file attached here).
There is a problem, why the reversed V-shaped plot is obtained in the frequency domain.
Note: Sample 1kHz signal data is attached.
And why Fv = linspace(0,1,fix(LF/2)+1)*Fn;
is used in the fft analysis and what is the concept of the nyquist frequency.

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by