Generation of Elementary Sequences of All Signals with Wave Forms

By
Advertisement
%impulse
 clc;
 clear all;
 close all;
 disp('unit impulse signal');
 N=input('enter number of samples');
 n=-N:1:N
 X=(n==0)
 stem(n,X,'filled');
 x label('samples');
 y label(amplitude');
 title('impulse signal');
 %unit step
 clc;
 clear all;
 close all;
 disp('unit step signal');
 N=input('enter number of samples');
 n=-N:1:N
 X=(n>=0)
 stem(n,X,'filled');
 x label('samples');
 y label(amplitude');
%unit ramp
 clc;
 clear all;
 close all;
 disp('unit ramp signal');
 N=input('enter number of samples');
 a=input('enter value of ramp');
 n=0:0.5:N
 X=a*n
 stem(n,X,'filled');
 x label('samples');
 y label(amplitude');
%exponential
 clc;
 clear all;
 close all;
 disp('growing exponential signal');
 N=input('enter number of samples');
 a=input('enter value of a');
 n=-N:1:N
 X=a.^n
 stem(n,X,'filled');
 xlabel('samples');
 ylabel('amplitude');
%sine signal
clc;
clear all;
close all;
disp('sine signal');
N=input('enter number of samples');
n=0:0.1:N
X=sin(n)
stem(n,X,'filled');
xlabel('samples');
ylabel('amplitude');
%cosine signal
clc;
clear all;
close all;
disp('cosine signal');
N=input('enter number of samples');
n=0:0.1:N
X=cos(n)
stem(n,X,'filled');
xlabel('samples');
ylabel('amplitude');











0 comments:

Post a Comment