Remove "noise" data band from FFT magnitude Plot
1 view (last 30 days)
Show older comments
<<
>>
I have data sampled at 128 Hz and I am looking at the frequency content of the data. The matlab FFT function appears to be putting an oscillating band around the output, Figure 1. Is there a way to smooth the FFT plot like what is shown in Figure 2? These aren't plots of the exact same data points but they are pulled from the same data collection. I am not sure if downsampling or filtering the data before the FFT will created a clearner FFT Plot.
Here is my code:
Fs=128;
T = 1/Fs; % Sample time
L = n; % Length of signal
NFFT = pow2(nextpow2(L)); % Next power of 2 from length of y
FFTSP=SP-avgSP;
YSP = fft(FFTSP,NFFT)/L;
fSP = Fs/2*linspace(0,1,NFFT/2+1);
figure(1)
subplot(3,1,1)
semilogy(fSP,2*abs(YSP(1:NFFT/2+1)),'Color',[.75 0 0]);
grid on
xlabel('Frequency (Hz)')
ylabel('|SP|')
xlim([0 30]);
tst2=[stdate2,' to ',eddate2];
title(tst2);
ylim([10^-3 10^1]);
0 Comments
Answers (0)
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!