MATLAB Code For Amplitude Modulation
Fig: Amplitude Modulation
AM
is a method of transmitting signals, such as sound or digital information, in
which the amplitude of carrier wave is changed
according to the message signal. AM is widely used in electronic communication field. The plotting of AM signal using MATLAB
is very easy.
%%%%%%%%%%% Amplitude Modulation %%%%%%%
clc;
clear all;
close all;
t=0:0.001:1;
set(0,'defaultlinelinewidth',2);
A=input('Enter the amplitude of message signal - : ');
fm=input('Enter the Message frequency - : ');% Message signal frequecny
fc=input('Enter the Carrier frequency - : ');% Carrier signal frequency
mi=input('Modulation Index - : ');
if (mi >1 || mi < 0 )
disp('Enter value between 0 and 1');
break;
end
x=A*sin(2*pi*fm*t);%Message Signal
subplot(3,1,1);%Plotting frame divided in to 3 rows and this fig appear at 1st
plot(t,x);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
grid on;
c=A*sin(2*pi*fc*t);%Carrier Signal
subplot(3,1,2);
plot(t,c);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
grid on;
am=(A+mi*x).*sin(2*pi*fc*t);%AM Signal, Amplitude of Carrier changes to (A+Message)
subplot(3,1,3);
plot(t,am);
xlabel('Time');
ylabel('Amplitude');
title('AM Signal');
grid on;
%%%%%%%%%%%% END %%%%%%%%%%%55
Enter the amplitude of message signal - : 2
Enter the Message frequency - : 5
Enter the Carrier frequency - : 100
Modulation Index - : 0.5
according to the message signal. AM is widely used in electronic communication field. The plotting of AM signal using MATLAB
is very easy.
%%%%%%%%%%% Amplitude Modulation %%%%%%%
clc;
clear all;
close all;
t=0:0.001:1;
set(0,'defaultlinelinewidth',2);
A=input('Enter the amplitude of message signal - : ');
fm=input('Enter the Message frequency - : ');% Message signal frequecny
fc=input('Enter the Carrier frequency - : ');% Carrier signal frequency
mi=input('Modulation Index - : ');
if (mi >1 || mi < 0 )
disp('Enter value between 0 and 1');
break;
end
x=A*sin(2*pi*fm*t);%Message Signal
subplot(3,1,1);%Plotting frame divided in to 3 rows and this fig appear at 1st
plot(t,x);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
grid on;
c=A*sin(2*pi*fc*t);%Carrier Signal
subplot(3,1,2);
plot(t,c);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
grid on;
am=(A+mi*x).*sin(2*pi*fc*t);%AM Signal, Amplitude of Carrier changes to (A+Message)
subplot(3,1,3);
plot(t,am);
xlabel('Time');
ylabel('Amplitude');
title('AM Signal');
grid on;
%%%%%%%%%%%% END %%%%%%%%%%%55
Enter the amplitude of message signal - : 2
Enter the Message frequency - : 5
Enter the Carrier frequency - : 100
Modulation Index - : 0.5
0 comments:
Post a Comment