PSK SIMULATION USING MATLAB - DCS LAB

Aim: Simulation of PSK modulation and demodulation using MATLAB.

Theory:

Generation of PSK

o In PSK, there are two carriers, with 180 degree phase shift between them (known as antipodal signals). High waveform is multiplied by one of the carrier signal and low waveform is multiplied by the antipodal of the first carrier signal (180 degree shifted carrier signal), thereby generating PSK signal

Demodulation of PSK

o PSK signal has a well defined envelope. Hence envelope detector can be used for demodulation. A decision making circuitry is necessary for message detection.

Code:

clc
close all
clear all
fc1=input('Enter the freq of 1st Sine Wave carrier:');
fp=input('Enter the freq of Periodic Binary pulse (Message):');
amp=input('Enter the amplitude (For Both Carrier & Binary Pulse Message):');
amp=amp/2;
t=0:0.001:1;
c1=amp.*sin(2*pi*fc1*t);
c2=-c1;
subplot(5,1,1);
plot(t,c1)
xlabel('Time')
ylabel('Amplitude')
title('Carrier 1 Wave')
grid on;
subplot(5,1,2)
plot(t,c2)
xlabel('Time')
ylabel('Amplitude')
title('Carrier 2 Wave')
grid on;
m=amp.*square(2*pi*fp*t)+amp;
subplot(5,1,3)
plot(t,m)
xlabel('Time')
ylabel('Amplitude')
title('Binary Message Pulses')
grid on;
for i=0:1000
if m(i+1)==0
mm(i+1)=c2(i+1);
else
mm(i+1)=c1(i+1);
end
end
subplot(5,1,4)
plot(t,mm)
xlabel('Time')
ylabel('Amplitude')
title('Modulated Wave')
grid on;
for i=1:1000;
dm(i+1)=c2(i+1)-mm(i+1);
if dm(i+1)==0;
m1(i+1)=1;
else
m1(i+1)=0;
end
end
subplot(5,1,5)
plot(t,m1)
xlabel('Time')
ylabel('Amplitude')
title('Demodulated Wave')
grid on;

Generated Graph:

 Enter the freq of 1st Sine Wave carrier:20
 Enter the freq of Periodic Binary pulse (Message):5
 Enter the amplitude (For Both Carrier & Binary Pulse Message):4

Comments

Popular posts from this blog

MICRO LAB EXAMPLES - (ECE3003)

Lattice Ladder Structure - (ECE-2006)

Line Coding PSD - (ECE-4001)