Power Spectral Density two approaches

1 回表示 (過去 30 日間)
Martin Kovac
Martin Kovac 2015 年 1 月 9 日
コメント済み: Martin Kovac 2015 年 1 月 12 日
Hi all,
Please, can you explain me why I get two different results of Gaussian pulse Power Spectral Density? This two approaches should lead to the equivalent results but do not. I really dont know where I make mistake. Thank you very much. I also attached the source file. The code:
if true
%
% GAUSSIAN PULSE PSD
fc = 2e9; % Center frequency
tc = gmonopuls('cutoff',fc); % Width of each pulse
fs=50*fc; % Sampling frequency
SegmentDuration = 2*tc;
N = fs*SegmentDuration;
t = -SegmentDuration:(1/fs):(SegmentDuration-1/fs); % Signal evaluation time
y = gmonopuls(t,fc);
figure();
plot(t,y)
figure();
periodogram(y, rectwin(length(y)), [], fs, 'oneside', 'power');
hgcf = gcf;
hgcf.Color = [1,1,1];
mean_power = mean(y.^2);
mean_power_dBm = 10*log10(1000*mean_power);
%---------------------------------------------------------------------------------------------------------
fc = 2e9; % Center frequency
Fs = 100e9; % Sampling frequency
tc = gmonopuls('cutoff',fc); % Width of each pulse
t = 0:1/Fs:(4*tc-1/Fs); % Signal evaluation time
x = pulstran(t,2*tc,@gmonopuls,fc);
figure();
plot(t,x)
N = length(x);
NFFT = 2^nextpow2(N);
xdft = fft(x,NFFT);
xdft = xdft(1:NFFT/2+1);
psdx = (1/(Fs*NFFT)) * abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:Fs/NFFT:Fs/2;
figure();
plot(freq,10*log10(psdx))
grid on
title('Periodogram Using FFT')
xlabel('Frequency (Hz)')
ylabel('Power/Frequency (dB/Hz)')
end

採用された回答

Rick Rosson
Rick Rosson 2015 年 1 月 12 日
編集済み: Rick Rosson 2015 年 1 月 12 日
Please replace the following line of code:
periodogram(y, rectwin(length(y)), [], fs, 'oneside', 'power');
with:
periodogram(y, rectwin(length(y)), [], fs, 'oneside', 'psd');
  1 件のコメント
Martin Kovac
Martin Kovac 2015 年 1 月 12 日
Thank you very much. This is exactly what i need to know. Thank you once again.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParametric Spectral Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by