You are on page 1of 4

2a.

Convolutio n
8 52
. 3

-O5 - |
2

2 2 4 2

2
2

26 1
28ECI?s

Program Code :

clear all ;

X = L, 2, 2, J)

n| length (x);
length
n2)\>
Lx, zeros CI,
H [h, zeros 0,n;
ntn2-;

for
Yci) 0;
for :n!
if Ci- +)o)
Yi) = Yci) + x(j) * H(i- i+);
else
end
end
end
Y
Sub plot (3, , D;
stem (x, '-b4');
xlabel ('n'))
ylabel C$C);
Subplot 3,, 2) ;

stemnCh,
Ch, '-b^')
xlabel C'n)i
Cnj!);
ylabel C'y
Subplot (3, I,3)s
stem (Y'-b')
xlabel ('n';
label C'Y Cn);
y
155.23
2b Cosrelation

21BEC 185)

x= [ , 2,2, 1]
Y= - ,2, ]
2 I

24
2 32 4 2
2 2

Ans : ) 4 2

Program Code :

cle;
clear all ;
x = [i, 2,2,1]}
g temp = [-, , 2, 1J;
h = ¢ip (temp) :
nl length Cx);
n2 Length (h);
X = LX, Zeros n2)
H=(h, 2eroS CI, 2eng th cx))|:
for i= : r
Yci) =0;
for J = I:ni
if (i-j>0)
Yci) = Yi)+ x j) H(i-j +1);
end
end
end

Sub plot 3, 1,1);


stem (x, 4'))
Xlabel ('n');
subplot (3, I,2) ;
stem (h,'-b^') ;
xLabel Cn'
ylabel ('YEn);
Sub plo t (3, , 3) )
xta stem (Y, -6^');
Xla bel('n);
ylabel('YCaJ'))

You might also like