Hello. I am giving the m file for bpsk modulation
The equations are from chapter 4 of proakis book. they are equations 4-3-11 to 4-3-16.
-------------------------------------------------
%% Generating input pulses
clear all;clc;close all;
baseband1=ones(1,2000); baseband0=-ones(1,2000);
bandpass=[ones(1,1000) -ones(1,1000)];
%% General Conditions
fc=1; t = 0
pi/100)
20*pi-pi/100);
M=2;
%% Bandpass PSK
%Bandpass PSK = N.*cos(2*pi*fc*t+(2*pi/M)*(m-1));
m=1; PSK_Bandpass_1 = bandpass.*cos(2*pi*fc*t+(2*pi/M)*(m-1));
m=2; PSK_Bandpass_2 = bandpass.*cos(2*pi*fc*t+(2*pi/M)*(m-1));
figure(2),plot(t,PSK_Bandpass_1),title('PS Bandpass 1');xlabel('time'); ylabel('data');grid on;
figure(3),plot(t,PSK_Bandpass_2),title('PS Bandpass 2');xlabel('time'); ylabel('data');grid on;
%% Baseband PSK
%Baseband PSK Sm1 = pulse.*cos((2*pi/M)*(m-1)) for pulse = baseband1
m=1; PSK_Baseband_1 = baseband1.*cos((2*pi/M)*(m-1));
figure(4),plot(t,PSK_Baseband_1),title('PS Baseband 1');xlabel('time'); ylabel('data');grid on;
%Baseband PSK Sm2 = pulse.*sin((2*pi/M)*(m-1)) for pulse = baseband0
m=2; PSK_Baseband_2 = baseband0.*sin((2*pi/M)*(m-1));
figure(5),plot(t,PSK_Baseband_1),title('PS Baseband 1');xlabel('time'); ylabel('data');grid on;
-------------------------------------------
Sorry for the delay, but better late than late.
Hope to help.