Signals and Systems Lab File: Experiment 4
Signals and Systems Lab File: Experiment 4
EXPERIMENT 4
SOFTWARE USED : OCTAVE
Q 1 Find out the convolution of x(n) and h(n) finite time discrete
sequences :
CODE :
COMMAND WINDOW :
>> x = [1 2 5 4 3] ;
>> n1 = -2:2 ;
>> h = [1 2 5 4 3] ;
>> n2 = 0:4 ;
>> [y,n] = conv_m(x,n1,h,n2) ;
OUTPUT :
1
(b) x(n) = [ 2 4 6 8 10 ] & h(n) = [ 1 3 5 7 9 ]
CODE : same as (a)
COMMAND WINDOW :
>> x = [2 4 6 8 10] ;
>> n1 = -2:2 ;
>> h = [1 3 5 7 9] ;
>> n2 = -1:3 ;
>> [y,n] = conv_m(x,n1,h,n2) ;
OUTPUT :
2
Q 2 Find out the convolution of x(n) and h(n) finite time discrete
sequences :
CODE :
COMMAND WINDOW :
>> [x,n] = impseq(-1,4);
>> h = 2.*x;
>> [y,n] = conv_m(x,n,h,n);
OUTPUT :
3
Q3 Find out the convolution of x[n] = n*[ u[n] - u[n-3] ] and h[n] = n^2
*[ u[n] - u[n-6] ] :
CODE :
COMMAND WINDOW :
>> [x1,n1] = stepseq(0,3,-1,8) ;
>> x = n1.*x1 ;
>> [x2,n2] = stepseq(0,6,-1,8) ;
>> h = n2.^2.*(x2) ;
>> [y,n] = conv_m(x,n1,h,n2) ;
4
OUTPUT :
5
>> [x10,n1] = stepseq(-10,20,-15,35);
>> x1 = n1.*x10;
>> [x20,n2] = stepseq(0,30,-15,35);
>> x2 = cos(0.1.*3.14.*n2).*x20;
>> [y,n] = conv_m(x1,n1,x2,n2);
>> [y,n] = conv_m(x2,n2,x1,n1);
OUTPUT :
>> x3 = (1.2.^n3).*x30;
6
>> [y,n] = conv_m(x1,n1,y0,n0);
OUTPUT :
7
PROPERTY 4 : x(n)*del(n-n0) = x(n-n0)
>> [x,n] = impseq(5,-15,35);
>> [y0,n0] = conv_m(x1,n1,x,n);
>> stem(n+5,x1);
OUTPUT :
8
Q 5 : Find convolution x(t) = u(t) + u(t-N) and h(t) = sin(t) for 0 <= t <= pi
and take 50 samples of this signal for N =5:10:75 :
CODE :
OUTPUT :
9
10
11
12
ABHISHEK RATHOUR
191210003
GROUP 1
13
14