Sie sind auf Seite 1von 3

(To be submitted to Instructor)

ECE324: DIGITAL SIGNAL PROCESSING LABORATORY


Practical No.: 3 (Should be according to your allotted practical sequences. Not according to your IP or your wish. )
Roll No.: E2101 A-14 Registration No.: 11112071 Name : Sudhanshu Sharma











Program Code :
clc;
close all;
clear all;
x=input('Enter 1st signal');
y=input('Enter 2nd signal');
x1=length(x)
y1=length(y)
m=max(x1,y1)
subplot(3,1,1),stem(x)
title('Circular Convolution')
title('Input Signal x(n)')
ylabel('x(n) - - - - ->')
xlabel('n - - - - - - - - - - - - - - - ->')

subplot(3,1,2),stem(y)
title('Input Signal h(n)')
ylabel('h(n) - - - - ->')
xlabel('n - - - - - - - - - - - - - - - ->')

x2=[x,zeros(1,m-x1)]
y2=[y,zeros(1,m-y1)]
a=x2'
Aim:
To implement circular convolution of two signals and then simulate the resulting
signal using MAT lab.
Mathematical Expressions Required:

b=circshift(b,[1 1]) is required to shift the elements of column to make a matrix.
x2=[x,zeros(1,m-x1)] is used for zero pedding.

y(m)=sigma(n=0:N-1)[x(n).h(m-n)]at base N , m=0,1,2,3, . . . . . ,N-1
Marks Obtained
Job Execution (Out of 40):_________
Online Submission (Out of 10):________

Inputs (Should be allocated by the Instructor, Individually):

x(n) and y(n) are taken as input signals to calculate circular convolution.

x(n)=[1 2 3 4] and h(n)=[1 2 1]




b=y2'
c=b
for i=2:m
b=circshift(b,[1 1])
c(:,i)=b

end
y=c*a
subplot(3,1,3),stem(y)
title('Output Signal y(n)')
ylabel('y(n) - - - - ->')
xlabel('n - - - - - - - - - - - - - - - ->')
























Outputs/ Graphs/ Plots :
(CIRCULAR CONVOLUTION)


Comparison with inbuilt functions :

c = cconv(a,b,n) is the inbuilt function in MAT lab to get circular convolution of two signals. But I have
done it by using circshift command which shifts the elements of the columns as per requirement taken
by the transpose of input matrix and then multiplied the obtained matriz with the transpose of the other
signal values taken as matrix.









Analysis/ Learning outcomes :

The circular convolution of two aperiodic functions occurs when one of them is convolved in the
normal way with a periodic summation of the other function.

The output sequence of convoluted signal is [12 8 8 12].

The output sequence has value for each value of n. Thus, the number of samples in the output
sequence will be equal to the maximum no. of the samples in any of the input sequences.

Also,the multiplication of the DFTs (discrete fourier transform) of two sequences is equivalent to
the circular convolution of two sequences in time domain.

Das könnte Ihnen auch gefallen