Professional Documents
Culture Documents
OBJECTIVE:
Write a program for computing
(a) Linear Convolution
(b) Circular Convolution
(c) Auto-correlation
(d) Cross-correlation of the sequence
x=[1 2] and h[1 2 4]
PROGRAM:
%program for linear convolution
x=input('enter the first sequence x(n):');
h=input('enter the second sequence h(n):');
y=conv(x,h)
subplot(3,2,1);
stem(x)
xlabel('time');
ylabel('amplitude');
title('input sequence');
subplot(3,2,2);
stem(h)
xlabel('time');
ylabel('amplitude');
title('impulse sequence');
subplot(3,2,3);
stem(y)
xlabel('time');
ylabel('amplitude');
title('linear convolution');
PARAS JAIN
14315604914
%PROGRAM for cross convolution
y3=xcorr(x,h)
subplot(3,2,6);
stem(y3)
xlabel('time');
ylabel('amplitude');
title('cross convolution');
INPUT
enter the first sequence x(n):[ 1 2 ]
OUTPUT
y= 1 4 8 8
y1 = 9 4 8
y2 = 2 5 2
PARAS JAIN
14315604914