Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
2D fft: wavenumber frequency graph

Subject: 2D fft: wavenumber frequency graph

From: Eric

Date: 21 Apr, 2009 15:58:01

Message: 1 of 5

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));

Subject: 2D fft: wavenumber frequency graph

From: TideMan

Date: 21 Apr, 2009 20:17:57

Message: 2 of 5

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).

Subject: 2D fft: wavenumber frequency graph

From: Eric

Date: 22 Apr, 2009 13:59:01

Message: 3 of 5

TideMan <mulgor@gmail.com> wrote in message <050af282-7563-472e-bc55-aaa1313c5228@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.

Subject: 2D fft: wavenumber frequency graph

From: Rune Allnor

Date: 22 Apr, 2009 14:03:53

Message: 4 of 5

On 22 Apr, 15:59, "Eric " <ericbch...@hotmail.com> wrote:
> TideMan <mul...@gmail.com> wrote in message <050af282-7563-472e-bc55-aaa1=
313c5...@k19g2000prh.googlegroups.com>...
> > On Apr 22, 3:58=3DA0am, "Eric " <ericbch...@hotmail.com> wrote:
> > > I have an array of spatial coordinates and a matrix of time values co=
rres=3D
> > ponding to these coordinates. =3DA0I want to generate a wavennumber vs.=
 frequ=3D
> > ency plot using a 2 dimension fourier transform. =3DA0
> > > Is it correct to merge the spatial coordinate matrix with the time ma=
trix=3D
> > =A0so that the coordinate values are in the first row and the correspon=
ding t=3D
> > ime values are the columns? =3DA0And then to get the wavenumber-frequen=
cy dia=3D
> > gram, a 2d-fft would be applied to the whole matrix. =3DA0
>
> > > example code:
> > > fft2(W); % W has spatial coordinate values in the first row and time =
valu=3D
> > es down each column
> > > plot(abs(W));
>
> > No. =A0Don't put the spatial coordinates in the first row. =A0Their onl=
y
> > 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=3D3D2*pi*(0:N/2-1)/(N*dt) and=
 if
> > there are M columns wave number is k=3D3D2*pi*(0:M/2-1)/(M*dx).
>
> i thought that the fft of the time domain gives the frequency domain. =A0=
and the fft of the spatial domain gives the wavenumber domain.

Correct.

> =A0so if i organize the matrix so that going down each column is a time s=
eries, 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 plott=
ed.

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

Subject: 2D fft: wavenumber frequency graph

From: Sina Dispersion

Date: 30 Nov, 2012 14:59:08

Message: 5 of 5

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

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us