How to know about FFT bin frequencies

84 次查看(过去 30 天)
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
Screenshot (293).png

himanshu tripathi
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 CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by