Professional Documents
Culture Documents
NO:2
LINEAR CONVOLUTION
AIM:
Software Required:
MATLAB 7.0
Theory:
The output y[n] of a LTI (linear time invariant) system can be obtained by convolving the
input x[n] with the systems impulse response h[n].
The convolution sum is y (n) x(n) * h(n) x[k ] h[n k ] where
k
x(n) and h(n) can be
Program:
close all;
clear all;
clc;
y=conv(x,h);
subplot(3,1,1);
stem(x);
xlabel('time');
ylabel('amplitude');
subplot(3,1,2);
stem(h);
xlabel('time');
ylabel('amplitude');
subplot(3,1,3);
stem(y);
xlabel('time');
ylabel('amplitude');
N1=length(x);
N2=length(h);
N=N1+N2-1;
X=fft(x,N);
H=fft(h,N);
Y=X.*H;
y=ifft(Y,N);
figure
subplot(3,1,1);
stem(x);
xlabel('time');
ylabel('amplitude');
subplot(3,1,2);
stem(h);
xlabel('time');
ylabel('amplitude');
subplot(3,1,3);
stem(y);
xlabel('time');
ylabel('amplitude');
OUTPUT:
MANUAL CALCULATION:
OUTPUT PLOTS:
RESULT: