MATLAB Code to Simulate / Generate the Amplitide Modulation Signal (AM Signal) [ Amplitude Modulation using MATLAB]
Amplitude modulation (AM) is a method of superimposing the message onto an alternating carrier waveform.The highest frequency of the modulating signal (Message Signal) is normally < 10 % of the carrier frequency. The instantaneous amplitude of the modulated wave varies as per the amplitude of the message signal.
MATLAB Code For Amplitude Modulation:
clc;
clear all;
close all;
Ac=2; %carrier amplitude
fc=0.5; %carrier frequency
Am=.5; %message signal amplitude
fm=.05; %message signal frequency
Fs=100; %sampling rate/frequency
ka=1;%Amplitude Sensitivity
t=[0:0.1:50];%defining the time range & disseminating it into samples
ct=Ac*cos(2*pi*fc*t); %defining the carrier signal wave
mt=Am*cos(2*pi*fm*t); %defining the message signal
AM=ct.*(1+ka*mt); %Amplitude Modulated wave, according to the standard definition
subplot(3,1,1);%plotting the message signal wave
plot(mt);
ylabel('Message signal');
subplot(3,1,2); %plotting the carrier signal wave
plot(ct);
ylabel('carrier');
subplot(3,1,3); %plotting the amplitude modulated wave
plot(AM);
ylabel('AM signal');
Screenshot of the output:
Visit More On Digital iVision Labs:
#FSK Simulation Code Using MATLAB
#Phase Shift Keying (PSK) Modulation MATLAB Simulation, With MATLAB Code
MATLAB Code For Amplitude Modulation:
clc;
clear all;
close all;
Ac=2; %carrier amplitude
fc=0.5; %carrier frequency
Am=.5; %message signal amplitude
fm=.05; %message signal frequency
Fs=100; %sampling rate/frequency
ka=1;%Amplitude Sensitivity
t=[0:0.1:50];%defining the time range & disseminating it into samples
ct=Ac*cos(2*pi*fc*t); %defining the carrier signal wave
mt=Am*cos(2*pi*fm*t); %defining the message signal
AM=ct.*(1+ka*mt); %Amplitude Modulated wave, according to the standard definition
subplot(3,1,1);%plotting the message signal wave
plot(mt);
ylabel('Message signal');
subplot(3,1,2); %plotting the carrier signal wave
plot(ct);
ylabel('carrier');
subplot(3,1,3); %plotting the amplitude modulated wave
plot(AM);
ylabel('AM signal');
Screenshot of the output:
MATLAB Code to Simulate / Generate the Amplitide Modulation Signal (AM Signal) [ Amplitude Modulation using MATLAB] |
Visit More On Digital iVision Labs:
#FSK Simulation Code Using MATLAB
#Phase Shift Keying (PSK) Modulation MATLAB Simulation, With MATLAB Code
How can we interface this code with arduino uno kit
ReplyDeleteUse Serial Communication for sending the digits to Arduino And use analog pin to create a corresponding voltage: Idea for that: http://www.divilabs.com/2013/11/accessing-serial-port-using-matlab-code.html
DeleteAlthough MATLAB has also developed a Arduino Toolkit that can help you in this regard.
Hi,
ReplyDeletewhat is modulation coefficient? Did you mean modulation Index by it? What is the use of 'Fs' in the code?
Regards
Nazmul
ka is Amplitude Sensitivity. I have corrected it. Fs is sampling rate. For setting a sampling rate we need to follow the Niquist Criteria. Which needs it to be atleast twice the maximum frequency component if the signal.
Deleteka should be a positive value such that, Ac.*(1+ka*mt) is greater than or zero (i.e., non negative).
DeleteHi,
ReplyDeleteWhat is modulation coefficient? Did you mean Modulation Index by it? What is the use of 'Fs' in the code?
ka is Amplitude Sensitivity. I have corrected it. Fs is sampling rate. For setting a sampling rate we need to follow the Niquist Criteria. Which needs it to be atleast twice the maximum frequency component if the signal.
DeleteRead more: http://www.divilabs.com/2014/03/matlab-code-to-simulate-generate.html#ixzz4edR0xOoT
Write matlab code for phase modulation
ReplyDelete