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

5 次查看(过去 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 中查找有关 Fourier Analysis and Filtering 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by