I determined the PSD of a BPSK modulated signal using the MATLAB pwelch function and default parameters. My code looks like the following:
N = 2000; %no of bits
Rb = 1000; %bit rate
k = 20; %samples per bit
Tb = 1/Rb;
fc1 = 3*Rb; %carrier frequency
Fs = k*Rb; %sampling frequency
Ts = 1/Fs;
b = round(rand(1,N)); %bits randomly generated
A0 = 5;
t = 0:Ts:N*Tb-Ts; %time frame
m1 = sin(2*pi*fc1*t); %carrier1
y = [ ]; %time sampled bit stream
for i=1:N
y = [ y b(i)*ones(1,k)];
end
%% Modulation
modulated = A0y.m1 - A0~y.m1;
%% PSD
[pxx f]=pwelch(modulated,[],[],[],Fs);
pxx=pxx/max(pxx); %normalization
figure(2);
plot(f, pxx,'LineWidth', 2); grid on;
title('PSD of BPSK SIGNAL');
When I ran the simulation, I noticed that the left side lobe was higher than the right one. Why is that?
