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 中查找有关 Test and Measurement 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!