Bandpass power spectrum density issue
2 views (last 30 days)
Show older comments
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
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 Comments
Accepted Answer
Chunru
on 27 Oct 2022
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 Comments
Chunru
on 28 Oct 2022
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).
More Answers (0)
See Also
Categories
Find more on Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!