You are on page 1of 1

clc;

clear all;
close all;
fs = 50;
fc = 10;
t = (0: 2*fs+1)'/fs;
phasedev = pi/2; % deviation
c = sin(2*pi*fc*t); % carrier
x = sin(2*pi*t)+ sin(4*pi*t);
tx = pmmod(x, fc, fs, phasedev);
rx = awgn(tx, 10, 'measured');
y = pmdemod(rx, fc, fs, phasedev);
subplot(511);
plot(x);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
subplot(512);
plot(c);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
subplot(513);
plot(tx);
xlabel('Time');
ylabel('Amplitude');
title('Phase Modulated Signal');
subplot(514);
plot(rx);
xlabel('Time');
ylabel('Amplitude');
title('Additive White Gaussian Noise');
subplot(515);
plot(y);
xlabel('Time');
ylabel('Amplitude');
title('Demodulated PM Signal');

You might also like