# How to verify the discrete-time convolution theorem with Matlab

14 views (last 30 days)

Show older comments

##### 0 Comments

### Answers (2)

Harsh Kumar
on 4 Jun 2023

Edited: Harsh Kumar
on 8 Jun 2023

Hi moyu,

As per my understanding ,you are using two different methods to determine the Fast Fourier Transform of a function but it does not gave the same results .

The potential cause of the mismatch of above results is the missing "scaling" factor when you are calculating x1_f from h1_f x y1_f. In FT the multiplication property states that ,

FT (x(t)∗y(t)) ⟷ (1/2π) X(ω).Y(ω)

Here 1/2π is the scaling factor which is 1/N in case of DTFT/fft .

So,

The correct equation may be rewritten as :

x1_f= 1/N* h1_f * y1_f where * is simple multiplication not convolution operator.

Paul
on 4 Jun 2023

Hi moyu,

Linear convolution in the frequency domain using fft requires zero padding the sequences before taking the FFTs and multiplying. If the sequences are each of length N, the FFTs should be zero padded to at least 2*N-1. Here's an example.

N = 10;

rng(100)

x1 = rand(1,N);

h1 = rand(1,N);

y1 = conv(x1,h1);

x1fft = fft(x1,2*N-1);

h1fft = fft(h1,2*N-1);

y1f = ifft(x1fft.*h1fft);

% verify that y1 and y1f are "the same"

max(abs(y1-y1f))

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!