필터 지우기
필터 지우기

How to know about FFT bin frequencies

조회 수: 60 (최근 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 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