Problem in Convolution integral by fourier transformation

Click For Summary

Discussion Overview

The discussion revolves around the numerical evaluation of a convolution integral using Fourier transforms, specifically addressing issues encountered when applying the convolution theorem to Gaussian functions. Participants explore the discrepancies in results when comparing the Fourier transform of the convolution to the product of the individual Fourier transforms.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Praban describes a problem with the convolution integral of two Gaussian functions, noting that while the individual Fourier transforms are correct, the convolution does not satisfy the expected relationship (FT(f*g) = FT(f) multiplied by FT(g)).
  • Praban provides specific parameters used in the computation, including the values of sigma for the Gaussian functions and the number of points in the discrete Fourier transform.
  • Praban observes that the Fourier transform of the convolution has alternating signs, while the product of the Fourier transforms is all positive, raising questions about the numerical implementation.
  • Another participant suggests that Praban needs to provide more details about the issues encountered, asserting that the concept itself is sound.
  • Praban mentions that changing the limits of integration affects the results, leading to further discrepancies in the numerical values.
  • A later reply advises Praban to test simpler functions with known Fourier transforms to ensure the accuracy of the Fourier transform implementation before debugging the convolution issue.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the specific cause of the discrepancies in the convolution results. There is a general agreement that the concept of using Fourier transforms for convolution is valid, but the implementation details remain contested and unresolved.

Contextual Notes

Praban notes a 10-20% error in the inverse Fourier transform results and highlights the need for careful selection of spacing and number of points in the discrete Fourier transform. The discussion does not resolve these issues, leaving them as potential limitations in the numerical approach.

praban
Messages
13
Reaction score
0
Hello,

I am trying to numerically evaluate a convolution integral of two functions (f*g) using Fourier transform (FT) i.e using

FT(f*g) = FT(f) multiplied by FT(g) (1)

I am testing for a known case first. I have taken the gaussian functions (eq. 5, 6 and 7) as given in
http://mathworld.wolfram.com/Convolution.html

I am not using FFT but a naive implementation of FT. The problem I am facing is that the FTs are correct but convolution is not.

When I do inverse FT I do get back the 3 gaussians as given in the wolfram link. However, eq. (1) is not satisfied.

Is there any trick in eq. (1)? I would appreciate any suggestion.

thanks,

Praban
 
Physics news on Phys.org
You need to supply details of what is wrong. The concept is perfectly correct.
 
I am giving the details below (equation numbers are from my original posts, except the equation I have written below).

The sigma1 and sigma2 of eq. (5) and (6) are taken as 2.0 and 2.5

I am using 128 points in my discrete FT (values -63 to +64). Inverse FT of the FT of these gaussians give back those functions (although there are some error - about 10 to 20% - e.g I am getting 0.102 when the actual value is 0.117).

When I check FT(f*g) i.e. FT (gaussian of eq. (7)) = FT(f) multiplied by FT(g) (1)

the following happens

(1) the numerical values are same - however, FT(f*g) has alternate + and - signs for the numbers, while FT(f) mul FT(g) values are all positive

(2) If I change the limits - from -20 to +20 (still 128 points), alternate signs remain but now the numerical values also differ between two sides of equ. (1) and (2).

(3) I did the same with 512 points - results same as point (2) above.

I guess, that even FT of gaussian functions requires some fine tuning of spacing and number of points to choose (i.e. why 10-20% error is coming). However, in eq. (1), sign alternation part if not clear to me.

When I tried a function like exp(-kx)/x, my FT routine works fine (error less than 1%).

I would appreciate any help.

Praban
 
praban said:
I am using 128 points in my discrete FT (values -63 to +64). Inverse FT of the FT of these gaussians give back those functions (although there are some error - about 10 to 20% - e.g I am getting 0.102 when the actual value is 0.117).

It's a waste of time thinking about your other problems, until you have fixed that one.

Try some simple functions where you know what the FFT should be. For example
a constant function
sine and cosine functions one period in the 128 points
an alternating sequence of values +1, -1. +1, -1., ...,
all the values zero except for one point.

When those you can do an FFT and an inverse FFT of those and the answers are correct to 5 or 6 significant figures, not 10% or 20%, then you can try debugging your convolutions.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
9K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K