Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Digital Signal processing Lab Worksheet-Aug 2016

Name: NIDA NAAZ USN: 1BM18EE033 Batch:B3


Experiment No:4
Experiment Name: Performing the circular convolution of given two sequences

Aim of the Experiment: : Performing the circular convolution of given two sequences:
1. Circular convolution formulae.
2. DFT-IDFT method
3.Matrix Method

Program:
a) circular convolution formulae:-
a=[1 2 0 1];
al=length(a);
b=[2 2 1 1];
bl=length(b);
if al>bl
for i=bl+1:al
b(i)=0;
bl=al;
end
else
for i=al+1:bl
a(i)=0;
al=bl;
end
end
x=al:-1:1;
d=b(x);
for i=1:al
x=[al-i+1:al 1:al-i];
c=d(x)
s=0;
for j=1:al
s=s+a(j)*c(j);
end
y(i)=s;
end
y

b) Matrix Method:-
a=[1 2 0 1];
al=length(a);
b=[2 2 1 1];
bl=length(b);
if al>bl
for i=bl+1:al
BMSCE Department of EEE
Digital Signal processing Lab Worksheet-Aug 2016

b(i)=0;
bl=al;
end
else
for i=al+1:bl
a(i)=0;
al=bl;
end
end
m=[];
x=al:-1:1;
d=b(x);
for i=1:al
x=[al-i+1:al 1:al-i];
c=d(x);
m=[m;c];
end
y=m*a'

c) IDF-IDFT metod
a=[1 2 0 1];
al=length(a);
b=[2 2 1 1];
bl=length(b);
if al>bl
for i=bl+1:al
b(i)=0;
bl=al;
end
else
for i=al+1:bl
a(i)=0;
al=bl;
end
end

//........…………………
//using dft & idft.........
N=al;
k=N-1;
n=N-1;
m=zeros(N,N);
for i=0:k
for j=0:n
m(i+1,j+1)=%e^(-%i*(2*%pi)/N*i*j);
end
end
ak=m*a';
bk=m*b';

BMSCE Department of EEE


Digital Signal processing Lab Worksheet-Aug 2016

yk=ak.*bk;
cm=conj(m);
y=round(cm*yk/al)

Output:
// circular convolution formulae method.

//Matrix method

BMSCE Department of EEE


Digital Signal processing Lab Worksheet-Aug 2016

// IDF-IDFT METHOD

BMSCE Department of EEE


Digital Signal processing Lab Worksheet-Aug 2016

Observation/Comment on results:
Therefore the output obtained by all the above method is the same for a particular
sequence

BMSCE Department of EEE

You might also like