From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 52/CH3/EX3.18/Example3_18.sce | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 52/CH3/EX3.18/Example3_18.sce (limited to '52/CH3/EX3.18/Example3_18.sce') diff --git a/52/CH3/EX3.18/Example3_18.sce b/52/CH3/EX3.18/Example3_18.sce new file mode 100755 index 000000000..fc399e533 --- /dev/null +++ b/52/CH3/EX3.18/Example3_18.sce @@ -0,0 +1,36 @@ +//Example 3.18 +//Program to Compute output responce of following sequences +//x[n]=[1,2,3,1] +//h[n]=[1,1,1] +//(1)Linear Convolution +//(2)Circular Convolution +//(3)Circular Convolution with zero padding +clear; +clc ; +close ; +x=[1,2,3,1]; +h=[1,1,1]; +//(1)Linear Convolution Computation +ylinear=convol (x,h); +//Display Linear Convoluted Sequence y[n] in command window +disp(ylinear,"ylinear[n]="); +//(2)Circular Convolution Computation +//Now zero padding in h[n] sequence to make length of x[n] and h[n] equal +h1=[h,zeros(1,1)]; +//Now Performing Circular Convolution by DFT method +X=fft(x,-1); +H=fft(h1,-1); +Y=X.*H; +ycircular=fft(Y,1); +//Display Circular Convoluted Sequence y[n] in command window +disp(ycircular,"ycircular[n]="); +//(3)Circular Convolution Computation with zero Padding +x2=[x,zeros(1,2)]; +h2=[h,zeros(1,3)]; +//Now Performing Circular Convolution by DFT method +X2=fft(x2,-1); +H2=fft(h2,-1); +Y2=X2.*H2; +ycircularp=fft(Y2,1); +//Display Circular Convoluted Sequence with zero Padding y[n] in command window +disp(ycircularp,"ycircularp[n]="); \ No newline at end of file -- cgit