Bandpass power spectrum density issue

2 visualizzazioni (ultimi 30 giorni)
MAWE
MAWE il 27 Ott 2022
Commentato: Chunru il 28 Ott 2022
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?

Risposta accettata

Chunru
Chunru il 27 Ott 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 Commenti
MAWE
MAWE il 27 Ott 2022
Modificato: MAWE il 27 Ott 2022
My understanding is that the sampling rate has to be greater than twice the bandwidth, which is the case in my code. What's f_upper in this case?
Chunru
Chunru il 28 Ott 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).

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Test and Measurement in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by