STIMULATION OF SIGNALS USING MATLAB Program 1

PROGRAM 1:
OBJECT: Generation of a sinusoidal sequence with frequency of 3/20 Hz and to plot 50 samples (where sampling frequency is 1Hz). Assuming phase and amplitude to be entered by the user.

SOURCE CODE:
sample=50;
frequency=3/20;
amp=input('Enter the amplitude:');
phase=input('Enter the phase in degree:');
n=0:1:(sample-1);
y=amp*sin(2*pi*frequency*n + phase);
stem(n,y);
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.1');

OUTPUT GRAPH:
Enter the amplitude:5
Enter the phase in degree:0
Generation of a sinusoidal sequence with frequency of 3/20Hz, 50 samples.

Comments/disqusion
No comments