You are on page 1of 2

Matlab code for digital modulation:Psk:-

clc;clear all;close all;


t=0:0.001:1;
m=5.*square(5.*pi.*t);
subplot(3,1,1);plot(t,m);
title('message signal');
xlabel('time');ylabel('amplitude');
c=5.*sin(2.*pi.*10.*t);
subplot(3,1,2);plot(t,c);
title('carrier signal');
xlabel('time');ylabel('amplitude');
s=m.*c;
subplot(3,1,3);plot(t,s);
title('psk signal');
xlabel('time');ylabel('amplitude');
ask:clc;clear all;close all;
t=0:0.001:1;
m=0.5.*(5.*square(5.*pi.*t)+5);
subplot(3,1,1);plot(t,m);
title('message signal');
xlabel('time');ylabel('amplitude');
c=5.*sin(2.*pi.*50.*t);
subplot(3,1,2);plot(t,c);
title('carrier signal');
xlabel('time');ylabel('amplitude');
s=m.*c;
subplot(3,1,3);plot(t,s);
title('psk signal');
xlabel('time');ylabel('amplitude');
fsk

clc;clear all;close all;


t=0:0.001:1;
m=5.*square(5.*pi.*t);
subplot(4,1,1);plot(t,m);
title('message signal');
xlabel('time');ylabel('amplitude');
c1=5.*sin(2.*pi.*10.*t);
subplot(4,1,2);plot(t,c1);
title('carrier1 signal');
xlabel('time');ylabel('amplitude');
c2=5.*sin(2.*pi.*50.*t);
subplot(4,1,3);plot(t,c2);

title('carrier2 signal');
xlabel('time');ylabel('amplitude');
s=m.*c2;
subplot(4,1,4);plot(t,s);
title('fsk signal');
xlabel('time');ylabel('amplitude');

You might also like