STIMULATION OF SIGNALS USING MATLAB Program 3

PROGRAM 3:
OBJECT: To generate four sinusoidal sequence of phase shift of 0,70,130,180 and 360 and plot them together using "SUBPLOT" comment. (Where sampling frequency is 1Hz). Assuming amplitude to be entered by the user.

SOURCE CODE
sample=80;
frequency=4/20;
amp=input('Enter the amplitude:');
a=[0 70 130 180 360];
n=0:1:(sample-1);
for i=1:5
y=amp*sin(2*pi*frequency*n+a(i));
stem(n,y);
subplot(2,3,i)
end
xlabel('n');
ylabel('A M P L I T U D E ');
title('S A M P L E D S I N E W A V E ASSIGN_1.3');

OUTPUT GRAPH:
Generate four sinusoidal sequence of phase shift of 0,70,130,180 and 360 and plot them together
using SUBPLOT comment.

Comments/disqusion
No comments