I should mention that I do get a second peak in the frequency at around 200 Hz, which is exactly what I want. I just want to get rid of the maximum peak occurring at 0 Hz...
FFT is finding a max amplitude at 0 Hz
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Aimie
il 28 Giu 2012
Commentato: Iftakharul alam
il 28 Lug 2020
Can anyone explain why fft is giving a maximum amplitude at 0 Hz if the actual signal is pretty clear?
In my code, x is the signal as a function of time and r = length(x):
NFFT = 2^nextpow2(r);
X = fft(x,NFFT)/r;
Fs = 1/dt; % sampling frequency
f = Fs/2*linspace(0,1,NFFT/2+1); % frequency
A = 2*abs(X(1:NFFT/2+1)); % ampitude spectrum
Risposta accettata
Honglei Chen
il 28 Giu 2012
You need to remove the DC component first. Just do
x = x-mean(x)
or
x = detrend(x)
before applying FFT
2 Commenti
Iftakharul alam
il 28 Lug 2020
Dear Honglei Chen,
really appreciated to see you answer!
Thank you so much.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Fourier Analysis and Filtering in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!