Pages

Friday, 9 November 2012

Amplitude Modulation (Matlab 2012a)

Program:

clc;
clear all;
t = 0:0.001:1;
vm = input('Enter the amplitude of message signal = ');
vc = input('Enter the amplitude of carrier signal = ');
fm = input('Enter the message frequency = ');
fc = input('Enter the carrier frequency = ');
m = vm/vc;
sm = vm.*sin(2*pi*fm*t);
subplot(3,1,1);
plot(t,sm);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Message Signal');
grid on;
sc = vc.*sin(2*pi*fc*t);
subplot(3,1,2);
plot(t,sc);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Carrier Signal');
grid on;
y = (vm+m*vm.*sin(2*pi*fm*t)).*sin(2*pi*fc*t);
subplot(3,1,3);
plot(t,y);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('AM Signal');
grid on;


Output:

Enter the amplitude of message signal = 5
Enter the amplitude of carrier signal = 10
Enter the message frequency = 10
Enter the carrier frequency = 100

Output Waveforms:


1 comment: