You are on page 1of 6

EXPERIMENT NO -2 (A)

Aim : To perform generation of Discrete time signal using stem function.


Code (A) :
Clc
Close all
T = 0 : 100 ;
N = length (t) ;
X = ones (1 , n ) ;
Stem( t ,x “b” ) ;
Title ( ‘ Discrete plot of x(n)’)
Xlabel(“ time “)
Ylabel( “ Amplitude “)
Xlim([0 5])
Ylim([0 2 ])
Result :
EXPERIMENT 2 (B)
Code (B) :

Clc
Close all
T = 0 :20 ;
Stem ( t, t, ‘b”) ;
Title (‘Discrete plot of r(n)’)
Xlabel(“time’)
Ylabel(“Amplitude”)
Xlim([0 20 ])
Ylim([0 20 ])

Result :
EXPERIMENT 2 ( C )
CODE :
Clc
Close all
N = -3 : 1 : 4 ;
X = [ -1 -1 -1 1 1 0 0 ] ;
Stem(n , x) ;
Title ( ‘ Discrete plot of x(n) ‘)
Xlabel(“n”)
Ylabel(“Amplitude “)
Xlim([ -4 5 ])
Ylim([ -2 2 ])

Result :
EXPERIMENT 2 (D)
CODE :
Clc
Close all
N = -2 : 1 : 6 ;
X=[000123300];
Stem(n ,x ) ;
Title (‘Discrete plot of x(n)’)
Xlabel ( “n” )
Ylable (“Amplitude “)
Xlim( [-3 7 ] )
Ylim( [ 0 4 ] )

Result :
EXPERIMENT 2 ( E )
CODE :
Clc
Close all
N = -3 : 1 : 4 ;
X = [ 0 -2 -2 2 2 0 2 0 ]
Stem (n, x ) ;
Title (‘Discrete plot of x(n) ‘)
Xlabel(“n”)
Ylabel(“Amplitude”)
Xlim([-4 4])
Ylim([-3 3])

Result :
Conclusion :
Hence we perform the generation of discrete time signal using stem function with code ( A B
CDE)

You might also like