How to know about FFT bin frequencies
84 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (5)
Star Strider
le 1 Déc 2015
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')
0 commentaires
Adam
le 1 Déc 2015
Modifié(e) : Adam
le 1 Déc 2015
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.
0 commentaires
himanshu tripathi
le 8 Juin 2019
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Spectral Measurements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!