You are on page 1of 2

%Redwan Kabir Khan

%1632710043

clc; clear all; close all;


fs = 8000;
t = 0:1/fs:3; % time variable
fc = 10; % frequency of carrier signal
fm = 1; % frequency of message signal
kpm = pi/2; % phase deviation constant
mt = sin(2*pi*fm*t) + sin(4*pi*fm*t); %message signal
ct = cos(2*pi*fc*t); %carrier signal
x = pmmod(mt,fc,fs,kpm); %Modulated signal
y = pmdemod(x,fc,fs,kpm); %Demodulated signal
subplot(4,1,1)
plot(t,mt,'b','linewidth',2); grid on;
title('Message Signal');

subplot(4,1,2)
plot(t,ct,'r','linewidth',2); grid on;
title('Carrier Signal');
subplot(4,1,3)
plot(t,x,'g','linewidth',2); grid on;
title('Phase Modulated Signal');
subplot(4,1,4)
plot(t,y,'m','linewidth',2); grid on;
title('Phase Demodulated Signal');

1
Published with MATLAB® R2017b

You might also like