我正在使用Matlab對信號進行FFT處理,並且我陷入了規範化。具體而言,如何將頻譜歸一化爲dBm單位。我知道0.316228是正確的標準化因子,但我的問題與如何正確標準化倉相關。基本的FFT歸一化問題
我創建了以下程序來提出我的問題。只需將其剪切並粘貼到Matlab中,它就會自動運行。在線查看問題。
特別是,我很困惑如何正常化垃圾箱。例如,如果FFT的索引爲1:end,其中end是偶數,那麼當我計算FFT幅度譜時,對於索引2,我應該乘以(2/N):(end/2)?同樣,奈奎斯特頻率處(位於索引結尾/ 2 + 1)的分區是否被歸一化爲(1/N)?我知道有很多方法可以根據個人興趣進行標準化。假設我使用的信號(下面的St)是從ADC捕獲的電壓。
任何反饋,非常感謝。提前致謝!
%% 1. Create an Example Signal
N = 2^21 ; % N = number of points in time-domain signal (St)
St = 1 + rand(N,1,'single'); % St = example broadband signal (e.g. random noise)
% take FFT
Sf = fft(St, N);
Sf_mag = (2/N)*abs(Sf(1: N/2 + 1));
Sf_dBm = 20*log10(Sf_mag/0.316228); % 0.316338 is peak voltage of 1 mW into 50 Ohms
% Q: Are Sf_mag and Sf_dBm normalized correctly? (assume 0.316338 is correct
% peak voltage to get 1mW in 50 Ohms)
% Q: Should Sf_mag(fftpoints/2 + 1) = (1/N)*abs(Sf(fftpoints/2 + 1) for correct normalization
% of Nyquist frequency? (since Nyquist frequency is not folded in frequency
% like the others are)
%% 2. Plot Result
% create FFT spectrum x-axis
samplerate = 20e9; % 20 Gsamples/sec
fft_xaxis = single(0 : 1 : N/2)';
fft_xaxis = fft_xaxis * single(samplerate/N);
semilogx(fft_xaxis, Sf_dBm, 'b-')
xlabel('Frequency (Hz)');
ylabel('FFT Magnitude (dBm)');
title('Spectrum of Signal (Blue) vs Frequency (Hz)');
xlim([1e4 1e10]);
grid on;
當把磁盤轉換爲dB時,使用'log10'而不是'log' – YYC 2010-10-29 22:08:32
是的,這是一個很棒的發現YYC,謝謝! – ggkmath 2010-10-30 18:32:24
評論我一直在提出很多問題:簡單的傅里葉變換不足以進行譜估計。對於在覈心Matlab中可用的功能,有很好的實現功能。看看'pwelch'。 – 2013-10-31 23:53:58