How to generate Amplitude modulation (AM) using MATLAB? AM is a method of transmitting signals, such as sound or digital information, in which the amplitude of the carrier wave is changed according to the message signal. AM is widely used in the electronic communication field.
The plotting of AM signals using MATLAB is very easy. Here we are simply adding the carrier amplitude with the message signal to obtain AM signal. Then the instantaneous amplitude of the carrier gets altered with respect to modulating signal. Thus the carrier amplitude varies according to the baseband signal (message signal).
Mathematical Representation of Am Signal
If the message signal is represented by,
Then the equation of amplitude modulation is given by,
Where ‘mi’ is the modulation index and ‘A’ is the amplitude
clc; clear all; close all; t=0:0.001:1; set(0, defaultlinelinewidth', 2); A=5;%Amplitude of signal fm=input('Message frequency=');%Accepting input value fc=input('Carrier frequency=');%Accepting input value (f2>f1) mi=input('Modulation Index=');%Modulation Index Sm=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, Sm); xlabel('Time'); ylabel('Amplitude'); title('Message Signal'); grid on; Sc=A*sin(2*pi*fc*t);%Carrier Signal subplot(3,1,2); plot(t,Sc); xlabel('Time'); ylabel('Amplitude'); title('Carrier Signal'); grid on; Sfm=(A+mi*Sm). *sin(2*pi*fc*t);%AM Signal, Amplitude of Carrier changes to (A+Message) subplot(3,1,3); plot(t, Sfm); xlabel('Time'); ylabel('Amplitude'); title('AM Signa'); grid on;
Generated AM Signal
The uses of this particular MATLAB code are also given in the commented form (%comment field). The program is capable of accepting two input frequencies and modulation index from the keyboard.