Linear Convolution of Two Sequences Using DFT and IDFT

November 6, 2017 | Author: Aniruddha Rajshekar | Category: N/A
Share Embed Donate


Short Description

Download Linear Convolution of Two Sequences Using DFT and IDFT...

Description

9. Linear Convolution Of Two Sequences using DFT and IDFT clc; clear all; x=input('Input First Sequence'); h=input('Input Second Sequence'); n1=length(x); n2=length(h); N=n1+n2-1; x1=[x zeros(1,N-n1)]; x2=[h zeros(1,N-n2)]; a=fft(x, N); b=fft(h, N); c=a.*b; d=ifft(c, N); disp('First Sequence'); x disp('Second Sequence'); h disp('Convolved Sequence'); d n=0:N-1; subplot(3,1,1); stem(x); title('First Sequence'); ylabel('Signal'); xlabel('Time'); subplot(3,1,2); stem(h); title('Second Sequence'); ylabel('Signal'); xlabel('Time'); subplot(3,1,3); stem(d); title('Convolved Sequence'); ylabel('Signal'); xlabel('Time');

Signal

Result: First Sequence x= 1 1 1 1 Second Sequence h= 1 1 1 1 Convolved Sequence d = 1.0000 2.0000

4.0000

2.0000

1.0000

0.5 1.5

2

3 2.5 Time Second Sequence

2

3 2.5 Time Convolved Sequence

1

3.5

4

0.5 0 1

1.5

4

Signal

3.0000

First Sequence

1

0 1

Signal

3.0000

3.5

4

2 0 1

2

3

4 Time

5

6

7

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF