Discussion:
2D fft: wavenumber frequency graph
(too old to reply)
Eric
2009-04-21 15:58:01 UTC
Permalink
I have an array of spatial coordinates and a matrix of time values corresponding to these coordinates. I want to generate a wavennumber vs. frequency plot using a 2 dimension fourier transform.
Is it correct to merge the spatial coordinate matrix with the time matrix so that the coordinate values are in the first row and the corresponding time values are the columns? And then to get the wavenumber-frequency diagram, a 2d-fft would be applied to the whole matrix.

example code:
fft2(W); % W has spatial coordinate values in the first row and time values down each column
plot(abs(W));
TideMan
2009-04-21 20:17:57 UTC
Permalink
I have an array of spatial coordinates and a matrix of time values corresponding to these coordinates.  I want to generate a wavennumber vs. frequency plot using a 2 dimension fourier transform.  
Is it correct to merge the spatial coordinate matrix with the time matrix so that the coordinate values are in the first row and the corresponding time values are the columns?  And then to get the wavenumber-frequency diagram, a 2d-fft would be applied to the whole matrix.  
fft2(W); % W has spatial coordinate values in the first row and time values down each column
plot(abs(W));
No. Don't put the spatial coordinates in the first row. Their only
use is in calculating the wave number which is done outside of the
FFT, just like frequency is.
Each column should be the time series at each spatial location
(equispaced).
You should have a constant interval in time, dt, down the columns and
an equal interval in space, dx, across the columns.
Then, if there are N rows, frequency is w=2*pi*(0:N/2-1)/(N*dt) and if
there are M columns wave number is k=2*pi*(0:M/2-1)/(M*dx).
Eric
2009-04-22 13:59:01 UTC
Permalink
I have an array of spatial coordinates and a matrix of time values corres=
ponding to these coordinates. =A0I want to generate a wavennumber vs. frequ=
ency plot using a 2 dimension fourier transform. =A0
Is it correct to merge the spatial coordinate matrix with the time matrix=
so that the coordinate values are in the first row and the corresponding t=
ime values are the columns? =A0And then to get the wavenumber-frequency dia=
gram, a 2d-fft would be applied to the whole matrix. =A0
fft2(W); % W has spatial coordinate values in the first row and time valu=
es down each column
plot(abs(W));
No. Don't put the spatial coordinates in the first row. Their only
use is in calculating the wave number which is done outside of the
FFT, just like frequency is.
Each column should be the time series at each spatial location
(equispaced).
You should have a constant interval in time, dt, down the columns and
an equal interval in space, dx, across the columns.
Then, if there are N rows, frequency is w=3D2*pi*(0:N/2-1)/(N*dt) and if
there are M columns wave number is k=3D2*pi*(0:M/2-1)/(M*dx).
i thought that the fft of the time domain gives the frequency domain. and the fft of the spatial domain gives the wavenumber domain. so if i organize the matrix so that going down each column is a time series, and each column is the time series for a different x coordinate and take a fft2 of the matrix, i should get wavenumber vs. frequency when plotted.
Rune Allnor
2009-04-22 14:03:53 UTC
Permalink
I have an array of spatial coordinates and a matrix of time values corres=
ponding to these coordinates. =A0I want to generate a wavennumber vs. frequ=
ency plot using a 2 dimension fourier transform. =A0
Is it correct to merge the spatial coordinate matrix with the time matrix=
 so that the coordinate values are in the first row and the corresponding t=
ime values are the columns? =A0And then to get the wavenumber-frequency dia=
gram, a 2d-fft would be applied to the whole matrix. =A0
fft2(W); % W has spatial coordinate values in the first row and time valu=
es down each column
plot(abs(W));
No.  Don't put the spatial coordinates in the first row.  Their only
use is in calculating the wave number which is done outside of the
FFT, just like frequency is.
Each column should be the time series at each spatial location
(equispaced).
You should have a constant interval in time, dt, down the columns and
an equal interval in space, dx, across the columns.
Then, if there are N rows, frequency is w=3D2*pi*(0:N/2-1)/(N*dt) and if
there are M columns wave number is k=3D2*pi*(0:M/2-1)/(M*dx).
i thought that the fft of the time domain gives the frequency domain.  and the fft of the spatial domain gives the wavenumber domain.
Correct.
 so if i organize the matrix so that going down each column is a time series, and each column is the time series for a different x coordinate and take a fft2 of the matrix, i should get wavenumber vs. frequency when plotted.
Sounds about right.

Your first post could be interpreted such that you include
the spatial positions of your sensors as well as the sampling
times of your snapshots in the data. Do *not* include any of
this book-keeping information in the lump of data that you
feed to the DFT, and you will be fine.

Rune
Sina Dispersion
2012-11-30 14:59:08 UTC
Permalink
Hi TideMan,

Great post. At the beginning of your expressions for each domain, what exactly is the term '3D':

w=3D2*pi*(0:N/2-1)/(N*dt)

Many thanks,

Sina
Sk. Shariful Alam
2022-05-09 08:58:07 UTC
Permalink
Post by Sina Dispersion
Hi TideMan,
w=3D2*pi*(0:N/2-1)/(N*dt)
Many thanks,
Sina
Hello,
I've a 2D DFT problem which I could not manage to solve. Can anybody help me find the wave number in the plot of spatial spectrum?
The problem is described in the following link
https://dsp.stackexchange.com/questions/82903/what-is-going-wrong-with-the-plot-of-2d-spatial-spectrum-at-a-specific-frequency?noredirect=1#comment174526_82903
Thanks and regrads,
S. Alam

Loading...