You are on page 1of 3

Muhammad Aimal Rehman

CIIT/DDP-SP12-038/LHR
Department of Electrical Engineering,
COMSATS IIT, Lahore.

MATLAB Simulation for Quadrature Amplitude Modulation/Demodulation


Scheme for Analog Communication Systems

Code

t=0:0.0001:1;
%Message 1
m1=cos(2*pi*50*t);
%Message 2
m2=sin(2*pi*100*t);

%Carrier
c1=cos(2*pi*1000*t);

%Quadrature Carrier
c2=sin(2*pi*1000*t);

mod1=m1.*c1;
mod2=m2.*c2;
mod=mod1+mod2;

subplot(5,1,1)
plot(t,m1);
title('Message 1');

subplot(5,1,2)
plot(t,m2);
title('Message 2');

subplot(5,1,3)
plot(t,mod);
title('Modulated Signal');

%Demodulation with Carrier


demod1=mod.*c1;

%Demodulation with Quadrature Carrier


demod2=mod.*c2;

[a b]=butter(5,2*55*0.0001);
msg1=filter(a,b,demod1);
[a b]=butter(5,2*105*0.0001);
msg2=filter(a,b,demod2);

subplot(5,1,4)
plot(t,msg1);
title('Message 1 retrieved');

subplot(5,1,5)
plot(t,msg2);
title('Message 2 retrieved');

Results
Simulink Model

Results

You might also like