Remarks: - : Done by

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

DONE BY: NAME: SOMERAJ BOSE ROLL : 43 SEC :B YEAR : 3RD REMARKS : _____________________

SIGNATURE : ____________________

INSTITUTE OF ENGINEERING AND MANAGEMENT

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

INSTITUTE OF ENGINEERING AND MANAGEMENT

Page |2

subplot(3,1,3) stem(y) title('circular convolution')

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

You might also like