MHB Way to calculate/approximate 2D Fourier transform?

AI Thread Summary
The discussion focuses on calculating or approximating the 2D Fourier transform of the function tanh(w)/w, where w is the absolute value of the vector (wx, wy). The user seeks to construct a filter for a 2D surface that applies this function to filter frequencies without directionality. Initial attempts with the fft2 function in Octave faced resolution limitations due to matrix size constraints. An alternative approach using the Hankel transform is suggested, leveraging the circular symmetry of the function. The conversation highlights the trade-offs between resolution and range when transforming the function and suggests using polar coordinates to simplify the process.
TriKri
Messages
72
Reaction score
0
Hi! I have a function for which I need to calculate or at least approximate the 2D Fourier transform, that is, the Fourier transform applied twice on the function but on different variables. The function is tanh(w)/w, where w is the absolute value of the vector (wx, wy). So the function can be written as tanh(sqrt(wx^2+wy^2))/sqrt(wx^2+wy^2) (I'm sorry but I don't know how to get latex working). The variables that are supposed to be used in the Fourier transforms are then wx and wy respectivelly.

The reason I'm asking is because I need to construct a filter that acts on a 2D surface, which filters each frequency w with the factor tanh(w)/w, disregarding of the direction along the surface. If I can only calculate the Fourier transform of the function just gave, I will get a 2d convolution filter which I can use.

Any idéas of how to approximate the 2D Fourier transform of the function? Thanks in advance.
 
Mathematics news on Phys.org
trikri said:
hi! I have a function for which i need to calculate or at least approximate the 2d Fourier transform, that is, the Fourier transform applied twice on the function but on different variables. The function is tanh(w)/w, where w is the absolute value of the vector (wx, wy). So the function can be written as tanh(sqrt(wx^2+wy^2))/sqrt(wx^2+wy^2) (i'm sorry but i don't know how to get latex working). The variables that are supposed to be used in the Fourier transforms are then wx and wy respectivelly.

The reason I'm asking is because i need to construct a filter that acts on a 2d surface, which filters each frequency w with the factor tanh(w)/w, disregarding of the direction along the surface. If i can only calculate the Fourier transform of the function just gave, i will get a 2d convolution filter which i can use.

Any idéas of how to approximate the 2d Fourier transform of the function? Thanks in advance.
2d FFT

CB
 
Last edited:
Thank you CB, I tried with the fft2 function in Octave but it's difficult to get an image with good enough resolution when there is a size limit to how large matrixes the program can handle.

Instead, I found this transform: en.wikipedia.org/wiki/Hankel_transform#Relation_to_the_Fourier_transform, which I think I can use in this case since my function is circularly symmetric. I will try to use that instead and see what result I get.
 
TriKri said:
Thank you CB, I tried with the fft2 function in Octave but it's difficult to get an image with good enough resolution when there is a size limit to how large matrixes the program can handle.

Instead, I found this transform: en.wikipedia.org/wiki/Hankel_transform#Relation_to_the_Fourier_transform, which I think I can use in this case since my function is circularly symmetric. I will try to use that instead and see what result I get.

You don't need such a good image since the high frequency components fall off rapidly. The spectrum if not of sufficient resolution can be interpolated (since there is not much information in it)

CB
 
In order to get a small enough matrix so that it becomes possible to transform it, you either have to sacrifice the resolution or the range of the original function. Both of those options are bad and will make the transformed function deviate from the true value.
 
TriKri said:
In order to get a small enough matrix so that it becomes possible to transform it, you either have to sacrifice the resolution or the range of the original function. Both of those options are bad and will make the transformed function deviate from the true value.

How small is small, the hardware on the not exceptional machines I use will handle 1000x1000 matrix, estimated time is of the order of 100-200 ms

CB
 
TriKri said:
In order to get a small enough matrix so that it becomes possible to transform it, you either have to sacrifice the resolution or the range of the original function. Both of those options are bad and will make the transformed function deviate from the true value.

The alternative is to use the symmetry and convert the FT to polars where you will end up with ... (I forget which, transform and I am not going to look it up as I don't have a suitable reference to hand). Which is probably what the Wiokipedia article you mention is about.

CB
 
Last edited:
Back
Top