Professional Documents
Culture Documents
Remarks: - : Done by
Remarks: - : Done by
Remarks: - : Done by
SIGNATURE : ____________________
Page |1
TITLE: Program to find out the Circular convolution using Linear convolution
of two sequences.
CODE:
FUNCTION:
function y1=c_cnv(x,h) lx=length(x); lh=length(h); a=lx+lh-1; h1=[h zeros(1,a-lh)]; x1=[x zeros(1,a-lx)]; for i=1:a y(i)=0; for k=1:i y(i)=y(i)+x1(k)*h1(i-k+1); end end b=length(y); c=max(lx,lh); y=[y zeros(1,2*c-b)]; for i=1:c y1(i)=y(i)+y(c+i); end end
PROGRAM:
clc clear all close all x=input('enter x: '); h=input('enter h: '); y=c_cnv(x,h) subplot(3,1,1) stem(x) title('x(n)') subplot(3,1,2) stem(h) title('h(n)')
NAME: SOMERAJ BOSE SEC: ECE-B YEAR: 3RD ROLL: 43
Page |2
OUTPUT:
enter x: [1 2 3 4] enter h: [1 1 2 2] y= 15 17 15 13
DISCUSSION:
We have implemented the circular convolution using linear convolution by adding up the values of the result of the linear convolution of the two given sequences as needed using for loop. The minor errors in the programs were corrected. The output is checked by manual calculation.
NAME: SOMERAJ BOSE SEC: ECE-B YEAR: 3RD ROLL: 43