Using ifft2 to transform wavenumber-frequency to space-time

  • Context: MATLAB 
  • Thread starter Thread starter chiraganand
  • Start date Start date
  • Tags Tags
    Space-time Transform
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
12 replies · 3K views
chiraganand
Messages
111
Reaction score
1
TL;DR
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
 
on Phys.org
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).
 
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?
 
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.
 
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?
 
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).
 
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
 
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
 
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   Reactions: chiraganand
DrClaude said:
Yes.
$$
\Delta k = \frac{2 \pi}{N \Delta x}
$$
Awesome thank you for all your help! I owe you big time!
 
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
 
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.