Question: Implement an AM demodulation using this program in MATLAB Program: //create the class to perform all the tasks class numbers { //create and store all
Implement an AM demodulation using this program in MATLAB
Program: //create the class to perform all the tasks class numbers { //create and store all the numbers int nums[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }; //create the array to store the odd no. int odd[] = new int[20]; //to store the no. of odd elements int oddNo = 0; //create the array to store the even no. int even[] = new int[20]; //to store the no. of even elements int evenNo = 0; //function to store the numbers separately void numberDiff() { //iterate in the array for (int i=0; i Explanation -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- %>>>>>>>>>>>>>>>>>>>> Tuterial on AM Modulation <<<<<<<<<<<<<<<<<<<<<<<<<< clc; close all; clear all; %XXXXXXXXXXXXXXXXXXXXXXXXXXX Define AM modulation Index XXXXXXXXXXXXXXXXXXX disp(' example: m=1 means 100% modulation'); %m=input(' Enter the value of modulation index (m) = '); m=1 ; % for 100% modulation if ( 0>m || m>1 ) error('m may be less than or equal to one and geter than to zero'); end % hello Comm Sys class % XXXXXXXXXXXXXXXXX modulating signal generation m(t) XXXXXXXXXXXXXXXXXXXXXXXXXX Am=5; % Amplitude of modulating signal fa=2000; % Frequency of modulating signal Ta=1/fa; % Time period of modulating signal t= 0: Ta/999 : 6*Ta; % Total time for simulation ym=Am*cos(2*pi*fa*t); % m(t) Eqation of modulating signal figure(1) subplot(3,1,1); plot(t,ym), grid on;% Graphical representation of Modulating signal title ( ' Modulating Signal '); xlabel ( ' time(sec) '); ylabel (' Amplitud(volt) '); %XXXXXXXXXXXXXXXXXXXXX carrier signal generation c(t) XXXXXXXXXXXXXXXXXXXXXXXXXX Ac=Am/m;% Amplitude of carrier signal [ where, modulation Index (m)=Am/Ac ] fc=fa*10;% Frequency of carrier signal Tc=1/fc;% Time period of carrier signal yc=Ac*cos(2*pi*fc*t);% Eqation of carrier signal subplot(3,1,2); plot(t,yc), grid on;% Graphical representation of carrier signal title ( ' Carrier Signal '); xlabel ( ' time(sec) '); ylabel (' Amplitud(volt) '); %XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX AM Modulation S(t) XXXXXXXXXXXXXXXXXXXXXXXXXXX y=Ac * ( 1 + m*cos(2*pi*fa*t) ) .* cos(2*pi*fc*t); % Equation of Amplitude %modulated signal subplot(3,1,3); plot(t,y);% Graphical representation of AM signal title ( ' Amplitude Modulated signal '); xlabel ( ' time(sec) '); ylabel (' Amplitud(volt) '); grid on; %>>>>>>>>>>>>>>>>>>>>>> end of program <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Please refer to solution in this step.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
