clc;
clear all;
close all;
a=input('enter the amplitude=');
f=input('enter the frequency=');
t=0:0.02:2;
x1=1;
%generation of an impulse signal
x2=a*sin(2*pi*f*t);
%generation of sine wave
y=x1.*x2;
%modulation step
subplot(5,1,1);
%for impulse signal plot
stem(x1);
title('impulse signal');
xlabel('time');
ylabel('amplitude');
subplot(5,1,2);
%for sine wave plot
plot(t,x2);
title('sine wave');
xlabel('time');
ylabel('amplitude');
subplot(5,1,3);
%for pam wave plot
stem(t,y);
title('pam wave');
xlabel('time');
ylabel('amplitude');
subplot(5,1,4);
% to plot the frequency spectrum
z=fft(y);
plot(t,z);
title('frequency spectrum');
3.To study and analyse pulse amplitude modulation using MATLAB software
0
September 12, 2024