Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
83% found this document useful (6 votes)
10K views

Linear Convolution of Two Sequences Using DFT and IDFT

This document demonstrates linear convolution of two sequences using the discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT). It inputs two sequences x and h, pads them with zeros to length N, takes the DFT of each, multiplies the results element-wise, and takes the IDFT to produce the convolved sequence d. Plots of the original sequences and convolved sequence are displayed.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
83% found this document useful (6 votes)
10K views

Linear Convolution of Two Sequences Using DFT and IDFT

This document demonstrates linear convolution of two sequences using the discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT). It inputs two sequences x and h, pads them with zeros to length N, takes the DFT of each, multiplies the results element-wise, and takes the IDFT to produce the convolved sequence d. Plots of the original sequences and convolved sequence are displayed.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

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');

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

3.0000

4.0000

3.0000

2.0000

1.0000

Signal

1 0.5 0 1 1 0.5 0 1 4 1.5 2 1.5 2

First Sequence

Signal

3 2.5 Time Second Sequence

3.5

3 2.5 Time Convolved Sequence

3.5

Signal

2 0 1 2 3 4 Time 5 6 7

You might also like