Lab Report 2: Abu Sayeed Lecturer
Lab Report 2: Abu Sayeed Lecturer
Submitted to:
Abu sayeed
Lecturer,
Department of Computer Science & Engineering
Rajshahi University of Engineering & Technology.
Submitted by:
Arun kundu
Department of Computer Science & Engineering.
Roll: 143045
Section: A
4th Year, Odd Semester.
TASK : Convolution using conv function and manually written conv function.
CODE:
clear all;
clc;
% Convolution using conv function.
xn = input('Enter the sequence for x(n): ');
hn = input('Enter the sequence for h(n): ');
lx = length(xn);
lh = length(hn);
px = (0:1:lx-1);
ph = (0:1:lh-1);
subplot(2,2,1);
stem(px, xn);
title('Discrete signal : x(n)'); xlabel('n'); ylabel('x[n]');
subplot(2,2,2);
stem(ph, hn);
title('Discrete signal : h(n)'); xlabel('n'); ylabel('h[n]');
n = (0:1:lx+lh-2);
subplot(2,2,3);
c = conv(xn,hn);
stem(n, c);
title('Convolution : Using conv function.'); xlabel('n'); ylabel('y[n]');
OUTPUT :