Using ifft2 to transform wavenumber-frequency to space-time

In summary, for a given number of data points and equally spaced wavenumbers, the spatial positions can be calculated using the formula x_i = 2*pi*i/(N*Delta k), where i ranges from 0 to N-1. When performing the inverse Fourier transform, it is important to ensure that the order of data is correct, with all positive k values stored before the negative ones. Additionally, if transforming from local x coordinates to wavenumber, it is necessary to account for the presence of k_z in the integral.
  • #1
chiraganand
113
1
TL;DR Summary
I have matrix of data in frequency-wavenumber domain and I want to transform this data into space-time. I use ifft2 to transform the data. I want to know what does the wavenumber transform into as from the sampling frequency we get the time axis, hence what do we get from the wavenumber sampling and how to interpret this in the space domain. Hence what I am trying to ask is what is the relationship between the wavenumber domain and the geometrical location.
equation is attached
1585729541242.png
 
Physics news on Phys.org
  • #2
For ##N## data points, with wavenumbers ##k_i##, ##i = -N/2, \ldots, N/2## equally spaced by ##\Delta k \equiv k_{i+1} - k_i##, then the spatial positions are
$$
x_i = 2\pi \frac{i}{N \Delta k}, \quad i = 0, \ldots, N-1
$$
Be careful with the order of data before the inverse FT: it is assumed that all ##k_i## for ##i \ge 0## are stored first, then the negative (see the Matlab commands fftshift and ifftshift).
 
  • #3
DrClaude said:
For ##N## data points, with wavenumbers ##k_i##, ##i = -N/2, \ldots, N/2## equally spaced by ##\Delta k \equiv k_{i+1} - k_i##, then the spatial positions are
$$
x_i = 2\pi \frac{i}{N \Delta k}, \quad i = 0, \ldots, N-1
$$
Be careful with the order of data before the inverse FT: it is assumed that all ##k_i## for ##i \ge 0## are stored first, then the negative (see the Matlab commands fftshift and ifftshift).
Thank you for your reply! I think I understand this, though I have a question regarding this. Does i need to start from -N/2 ? I am trying to find the angular spectrum of waves from a transducer, so I have N=200 and I have found the values of kx for these N=200, but if I consider the range from -N/2 then I get negative values of x, hence if I want to know the values of a spectrum of waves from a transdcuer with its centre at x=0, how would I go about it?
Also in the screenshot I have shown the equation dependent on kx and angular frequency. So I get a matrix of values with the rowds equal to different kx values and columns equal to different frequencies. When I ifft the matrix should I do it in 2 different steps? ie wavenumber- space first and then frequency- time?
 
  • #4
chiraganand said:
Thank you for your reply! I think I understand this, though I have a question regarding this. Does i need to start from -N/2 ? I am trying to find the angular spectrum of waves from a transducer, so I have N=200 and I have found the values of kx for these N=200, but if I consider the range from -N/2 then I get negative values of x, hence if I want to know the values of a spectrum of waves from a transdcuer with its centre at x=0, how would I go about it?
I don't think I can help you with that. I will just say that you should be careful and make sure that a (complex) Fourier transform is what will give you what you want here. (Note that eq. (7) has ##x## ranging from ##-\infty## to ##+\infty##.)

chiraganand said:
Also in the screenshot I have shown the equation dependent on kx and angular frequency. So I get a matrix of values with the rowds equal to different kx values and columns equal to different frequencies. When I ifft the matrix should I do it in 2 different steps? ie wavenumber- space first and then frequency- time?
You can do a 2D FFT. Each row will become a function of position while the columns a function of time. Note that in eq. (8), there is no FT from frequency to time. This would correspond to doing a 1D FFT for each row, with the columns still corresponding to the different frequencies.
 
  • #5
DrClaude said:
I don't think I can help you with that. I will just say that you should be careful and make sure that a (complex) Fourier transform is what will give you what you want here. (Note that eq. (7) has ##x## ranging from ##-\infty## to ##+\infty##.)You can do a 2D FFT. Each row will become a function of position while the columns a function of time. Note that in eq. (8), there is no FT from frequency to time. This would correspond to doing a 1D FFT for each row, with the columns still corresponding to the different frequencies.
Thank you.. I understand.. I just had a doubt when you said Eq(8) there is no FT from frequency to time. What I have been doing is solving equation 8 for frequency and corresponding k values (in this case k refers to the horizontal component of the wavenumber) values are fixed for all frequencies) and then doing an ifft2 on the matrix. Is that not correct?
 
  • #6
chiraganand said:
Thank you.. I understand.. I just had a doubt when you said Eq(8) there is no FT from frequency to time. What I have been doing is solving equation 8 for frequency and corresponding k values (in this case k refers to the horizontal component of the wavenumber) values are fixed for all frequencies) and then doing an ifft2 on the matrix. Is that not correct?
Depends on what you want. What you are doing will result in ##V(x,t)##, which is ok if this is what you want, but is not the same as ##V(x,f)## found in eq. (7).
 
  • #7
DrClaude said:
Depends on what you want. What you are doing will result in ##V(x,t)##, which is ok if this is what you want, but is not the same as ##V(x,f)## found in eq. (7).
Thank you for your response and the time! Also I have attached another equation which gives the value of V(x,f). I was wondering if the form in which the equation is given , if Fourier transforming the integrand will give the required value? I don't think so as the exponential terms are of a different form, but I just want another opinion
1585748299715.png
 
  • #8
The integral is not a Fourier transform, because of the presence of ##k_z##.
 
  • #9
DrClaude said:
For ##N## data points, with wavenumbers ##k_i##, ##i = -N/2, \ldots, N/2## equally spaced by ##\Delta k \equiv k_{i+1} - k_i##, then the spatial positions are
$$
x_i = 2\pi \frac{i}{N \Delta k}, \quad i = 0, \ldots, N-1
$$
Be careful with the order of data before the inverse FT: it is assumed that all ##k_i## for ##i \ge 0## are stored first, then the negative (see the Matlab commands fftshift and ifftshift).
Just another small question, if I had to transform from local x coordinates to wavenumber domain, then would the same relationship hold?ie swapping \Delta k with \Delta x
 
  • #10
chiraganand said:
Just another small question, if I had to transform from local x coordinates to wavenumber domain, then would the same relationship hold?ie swapping \Delta k with \Delta x
Yes.
$$
\Delta k = \frac{2 \pi}{N \Delta x}
$$
 
  • Like
Likes chiraganand
  • #11
DrClaude said:
Yes.
$$
\Delta k = \frac{2 \pi}{N \Delta x}
$$
Awesome thank you for all your help! I owe you big time!
 
  • #12
DrClaude said:
Yes.
$$
\Delta k = \frac{2 \pi}{N \Delta x}
$$
Hi, I have another question. not related to this but to fft transforms. I have a time domain signal extracted. When I Fourier transform it using the fft function, I get an extremely high value for the 1st value in the signal. Any idea why? The sampling frequency is 50 MHz and there are 1088 samples. The frequencies should be in the form of a gaussian shape with the centre frequency around 2.25 MHz. If i remove the first sample and plot , then I get the right frequencies. Any idea why this is happening?

Thanks and Regards
1587105260658.png

1587105308186.png
 
  • #13
The first component of the FFT is the zero-frequency component. The fact that it is not 0 means that your time signal is not oscillating around 0.
 

FAQ: Using ifft2 to transform wavenumber-frequency to space-time

1. What is ifft2 and how does it transform wavenumber-frequency to space-time?

ifft2 stands for inverse fast Fourier transform in two dimensions and is a mathematical operation used to convert data from the wavenumber-frequency domain to the space-time domain. It essentially reverses the process of the fast Fourier transform (fft) and allows for the reconstruction of a signal in the spatial and temporal dimensions.

2. Why is it important to use ifft2 for this transformation?

ifft2 is important because it allows for a more efficient and accurate transformation of data from the wavenumber-frequency domain to the space-time domain. It is specifically designed for two-dimensional data and is widely used in scientific and engineering applications.

3. What are the inputs and outputs of ifft2?

The input of ifft2 is a two-dimensional array of complex numbers representing the wavenumber-frequency data. The output is a two-dimensional array of complex numbers representing the reconstructed signal in the space-time domain.

4. How does ifft2 handle noise and errors in the data?

ifft2 is sensitive to noise and errors in the data, as it can result in inaccurate reconstructions. To mitigate this, it is important to properly preprocess the data and apply filters or corrections before using ifft2. Additionally, using longer data sets and increasing the resolution can also help reduce the effects of noise and errors.

5. Are there any limitations to using ifft2 for this transformation?

ifft2 is limited to two-dimensional data and is not suitable for higher dimensions. It also assumes that the data is evenly sampled and periodic, which may not always be the case in real-world scenarios. Additionally, it may not be suitable for data sets with a large number of data points, as it can be computationally intensive.

Similar threads

Replies
4
Views
3K
Replies
1
Views
5K
Replies
4
Views
3K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
4
Views
2K
Replies
7
Views
10K
Replies
10
Views
2K
Back
Top