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!