0

I am trying to implement convolution using fourier transform property but i am not getting exactly same shape of output that i get by using conv command

First portion of graph obtained using conv command is same as that obtained using fourier transform property but second portion of graph obtained using conv command is inverted as compared to that obtained using fourier transform property

My MATLAB code is below

clc;clear;close all
syms t w
x = exp(-t).*cos(2*pi*t).*heaviside(t);
h = exp(-t).*heaviside(t);
X = fourier(x, w);
H = fourier(h, w);
X1 = ifourier(X*H, t);
ezplot(X1, [-2 2 -0.1 0.15]);
title('using fourier technique') 
t=-1:0.01:1
x = exp(-t).*cos(2*pi*t).*heaviside(t);
h = exp(-t).*heaviside(t);
figure
y=conv(h,x)*0.01
plot(y)
title('using conv command') 

enter image description here

enter image description here

Engr
  • 3
  • 2

1 Answers1

0

What you need to do is pad the signals properly.
By padding you'll be able to extract the inner part of the circular convolution applied by the frequency domain multiplication.

You may have a look at Show Equivalence Between Multiplication in Time Domain to Convolution in Frequency Domain.

Royi
  • 19,608
  • 4
  • 197
  • 238
  • Can you please specify,which signal i need to pad,x,h or y? and pad with zeros or ones? – Engr Mar 31 '24 at 10:45
  • I have checked your suggested link that shows use of fft command but i am trying to use fourier command as my signals are continous time signals – Engr Mar 31 '24 at 10:49