Bandpass power spectrum density issue
2 ビュー (過去 30 日間)
古いコメントを表示
I have a signal x with power 15 dB and carrier frequency 29.7 GHz. I want to draw the power spectral desnity (PSD) of the signal in bandpass from 0 to fs/2. I expected
- The main lobe of the PSD to be centered at 29.7 GHz
However, what I get
- The main lobe of the PSD is centered around 3 GHz
See the image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1170808/image.png)
This is the code I am using
clearvars;
clc;
Wx = 50*10^6; % Signal bandwidth
Tx = 1/Wx; % Symbol time
fs = 1*10^9; % Sampling frequency
Ts = 1/fs; % Sampling time
fc = 29.7*10^9; % Carrier frequency
J = Tx/Ts; % Number of samples per symbol
SNRdB = 15; % SNR in dB scale
SNR = 10^(SNRdB/10); % SNR in linear scale
M = 32; % Number of BPSK symbols
S = M*J; % Total number of samples in M symbols
t=(0:S-1)*Ts; % Time vector in sample time
d = 2.*(rand(M,1)>0.5)-1; % Generating BPSK signal
dSamples = repelem(d,J); % The equivalent signal in samples
dx = sqrt(SNR).*dSamples.*cos(2*pi*fc*t.'); % Scaling the power of the signal and frequency shift the frequency to fc
[psd,fr]=pwelch(dx,[],[],(0:10^6:fs/2),fs); % Finding the PSD using pwelch MATLAB method between 0 and fs/2
plot(fr, 10*log10(psd), 'LineWidth',1);
ylabel('PSD (dBW/Hz)');
xlabel('Frequency');
grid on;
Why is the center frequency not correct? Am I using pwelch method incorrectly?
0 件のコメント
採用された回答
Chunru
2022 年 10 月 27 日
You need fs >2*f_upper. Try fs = 80GHz
Wx = 50*10^6; % Signal bandwidth
Tx = 1/Wx; % Symbol time
fs = 80*10^9; % Sampling frequency <==================
Ts = 1/fs; % Sampling time
fc = 29.7*10^9; % Carrier frequency
J = Tx/Ts; % Number of samples per symbol
SNRdB = 15; % SNR in dB scale
SNR = 10^(SNRdB/10); % SNR in linear scale
M = 32; % Number of BPSK symbols
S = M*J; % Total number of samples in M symbols
t=(0:S-1)*Ts; % Time vector in sample time
d = 2.*(rand(M,1)>0.5)-1; % Generating BPSK signal
dSamples = repelem(d,J); % The equivalent signal in samples
dx = sqrt(SNR).*dSamples.*cos(2*pi*fc*t.'); % Scaling the power of the signal and frequency shift the frequency to fc
[psd,fr]=pwelch(dx,[],[],(0:1e5:fs/2),fs); % Finding the PSD using pwelch MATLAB method between 0 and fs/2
plot(fr, 10*log10(psd), 'LineWidth',1);
ylabel('PSD (dBW/Hz)');
xlabel('Frequency');
grid on;
2 件のコメント
Chunru
2022 年 10 月 28 日
In passband, fs should be more than twice of the largest frequency of interest (f_upper).
In baseband, fs should be twice of the bandwidth.
(There are special scheme for bandpass sampling which is not discussed here).
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spectral Estimation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!