Expected FFT bin widths from signal is double what I think it should be

조회 수: 3 (최근 30일)
Michael Andersson
Michael Andersson 2020년 9월 30일
편집: Michael Andersson 2020년 9월 30일
I am sampling a signal taken from an oscilloscope an I’m trying to make the frequency bin widths from my FFT be what I believe they should be.
Ex: I capture 20 complete waveform periods over 0.4s, at 50Hz, with 800,000 samples (I need to max out my oscilloscope for high accuracy measurements. My step size between samples is 5.0E-7. Therefore I believe my bin width from a standard FFT should be:
1/(capture period) = 1/0.4 = 2.5Hz
However the actual bin widths I see on me frequency spectrum is 5Hz (47.5Hz > 52.5Hz around 50Hz).
I is very important that my bin widths are correct because this is what I am measuring to determine the resolution of measurement.
From this I plan to apply some cross correlation and pseudospectrum functions to try maintain a high resolution (small bin width) using fewer captured waveform period.
F_data = wf_YData(:,fftcount);
X_step = (wf_XData(:,2))-(wf_XData(:,1));
Ts = X_step;
N = size(F_data,1);
Fs = 1/Ts; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
FF = fft(F_data);
P2 = abs(FF/N); %P2 = two sided spectrum
P1 = P2(1:N/2+1); %P1 = single sided spectrum
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(N/2))/N;
dB_P1 = 20*log10(P1);
figure(2)
plot(f,P1);
grid;
xlim([0 2000]);
Thus, can anyone see the issue in my code that is causing my bin widths to be double what they should? Everything else is being displayed and plotted correctly and match what I get on the oscilloscope. I’m using single side band FFT.
I just recently started looking into bin widths, so am I just overlooking something basic.
My current plots:

답변 (0개)

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by