3. SINUSOIDAL SEQUENCE
A=input('type
in the gain constant :');
N=input('enter
the number of samples :');
W=input('enter
the radian frequency :');
PHY=input('enter
the initial phase in rad :');
for n=0:N-1
t(n+1)=n;
x(n+1)=A.*cos(W.*n+PHY);
end;
stem(t,x);
title('sinusoidal
sequence');
xlabel('time
index');
ylabel('amplitude');
pause;
Results:
Type in the gain constant
: 10
Enter the number of
samples : 30
Enter the radian
frequency : 100
Enter the initial phase
in rad : 0
No comments:
Post a Comment