Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

2D fft: wavenumber frequency graph

783 views
Skip to first unread message

Eric

unread,
Apr 21, 2009, 11:58:01 AM4/21/09
to
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

unread,
Apr 21, 2009, 4:17:57 PM4/21/09
to

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

unread,
Apr 22, 2009, 9:59:01 AM4/22/09
to
TideMan <mul...@gmail.com> wrote in message <050af282-7563-472e...@k19g2000prh.googlegroups.com>...
> On Apr 22, 3:58=A0am, "Eric " <ericbch...@hotmail.com> wrote:
> > 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
> >
> > example code:
> > 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

unread,
Apr 22, 2009, 10:03:53 AM4/22/09
to
On 22 Apr, 15:59, "Eric " <ericbch...@hotmail.com> wrote:
> TideMan <mul...@gmail.com> wrote in message <050af282-7563-472e-bc55-aaa1313c5...@k19g2000prh.googlegroups.com>...

> > On Apr 22, 3:58=A0am, "Eric " <ericbch...@hotmail.com> wrote:
> > > 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
>
> > > example code:
> > > 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

unread,
Nov 30, 2012, 9:59:08 AM11/30/12
to
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

unread,
May 9, 2022, 4:58:11 AM5/9/22
to
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
0 new messages