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

fft verses wavelength/wave number plot

898 views
Skip to first unread message

ashu

unread,
Jun 26, 2006, 1:44:05 AM6/26/06
to
Hi,
I would like to know How to convert frequency to wavelength or
wavenumber for plotting fft verses wavelength for a time series.(Is
there no role of velocity factor).
please help.

Rune Allnor

unread,
Jun 26, 2006, 2:07:43 AM6/26/06
to

Frequency to wavelength is basic maths:

c = Lf

where c is the wave speed, L is wavelength and f is the frequency.
The wavenumber relates to wavelengt in space the same way
angular frequency relates to wave period in time:

k = 2*pi/L = 2*pi*f/c

As you can see, you do need to know the wave speed c to be able
to convert from L to k.

Rune

ashu

unread,
Jun 26, 2006, 4:34:26 AM6/26/06
to
Hi,
Thanks.But in time series analysis. we don't have the speed of time
series. we have sampling frequency only.
Then how this will work without speed information.
please reply

Rune Allnor

unread,
Jun 26, 2006, 5:15:57 AM6/26/06
to

You can not get from time or frequency domain (t or f), to space or
wavenumber domain (L or k) without using the wave speed, c.

If you don't have the speed of the wave, you can't do the conversion.

Rune

Greg Heath

unread,
Jun 26, 2006, 6:52:03 AM6/26/06
to

What physical phenonema are you trying to characterize?
I don't understand how or why you are trying to establish
a relationship between the sampling frequency of a time
series and wavelength.

Hope this helps.

Greg

ashu

unread,
Jun 26, 2006, 8:38:31 AM6/26/06
to
Hi,
Thanks. But in different applications I have seen the plots of power
spectrum verses wavelength/wavenumber for power spectral behaviour
analysis.My problem is regarding this thing that how to convert
frequency axis to wavelength/wavenumber axis.

Ashu

Greg Heath

unread,
Jun 26, 2006, 1:01:53 PM6/26/06
to

That's what you said before... it doesn't help.
You didn't answer my question...that doesn't help either.

So, let me guess that your real problem is spatial and not temporal.
Accordingly, you want to know how to use FFT to yield a spatial
power spectrum.

Make the following analogies:

Temporal variations: cos(wt),sin(wt) w*t = 2*pi*f*t

Spatial variations: cos(kx),sin(kx) k*x =
(2*pi/lambda)*x

Hope this helps.

Greg

Rune Allnor

unread,
Jun 26, 2006, 1:16:25 PM6/26/06
to

Do you mean that you have SPATIAL data you want to plot in spectrum
domain? You mentioned "time series analysis" before, which may have
been a bit confusing.

You need the spatial sampling period Dx. Insert Dx for T in the
spectrum equations, and you get what I suspect you want:

N = length(x);
Dx = 10; % [m]
k_vec = [0:N-1]*2*pi/Dx;

k_spectrum = fft(x);

Pk = abs(k_spectrum).^2;

plot(k_vec,Pk)

and you should have the spatial power spectrum Pk plotted
as function of the wavenumber k.

Rune

Ken Davis

unread,
Jun 27, 2006, 8:04:37 AM6/27/06
to
"ashu" <a.ch...@rediffmail.com> wrote in message
news:ef3a...@webcrossing.raydaftYaTP...

Wavenumbers and wavelengths describe sinusoidal variations with
space/distance while frequencies describe sinusoidal variations with time.
They can be related to one another only when you have sinusoids varying with
space and time. The propagation speed (of the phase fronts) is how you
cnooect them together, as others have already said.


NZTideMan

unread,
Jun 28, 2006, 3:29:37 AM6/28/06
to

You haven't told us what your application is.
If it's turbulence, then you should use Taylor's hypothesis to convert
frequency to wave number. In the freestream, use the temporal mean
velocity, but if you are close to a wall, you need to use the eddy
velocity.
Interestingly, G I Taylor assumed this relationship in order to convert
measurements from wave number to frequency. He was demonstrating the
validity of the Weiner-Kinchine relationship between autocorrelation
and the spectrum (50 years prior to FFT).

Pau GALLES

unread,
Jun 1, 2016, 6:09:09 AM6/1/16
to
"Rune Allnor" <all...@tele.ntnu.no> wrote in message <1151342185.6...@y41g2000cwy.googlegroups.com>...
Hi Rune,

I am trying to apply a numerical approach to a problem by multiplying the FFT2 of a spatial signal with its wavenumber Kx.

[KX,KY] = meshgrid(kx,ky);
K = sqrt(KX.*KX + KY.*KY);
myFFTsolution =( KX.*fft_SlpX + KY.*fft_SlpY).*(i./(K);

where i is the complex
fft_SlpX is a fft2 of a spatial signal
K is the radial wavenumber defined above

I usually define Kx = [-N/2:N/2]./(N·dx) being N the number of samples.

However I saw your K definition like:

k_vec = [0:N-1]*2*pi/Dx;

Is this happening because the fft'ed is

To be honest I am a bit unsure about how to define my kx and ky

Many thanks,

Pau

Bruno Luong

unread,
Jun 1, 2016, 8:08:08 AM6/1/16
to
"Pau GALLES" wrote in message <nimc7v$mud$1...@newscl01ah.mathworks.com>...

>
> I usually define Kx = [-N/2:N/2]./(N·dx) being N the number of samples.
>
> However I saw your K definition like:
>
> k_vec = [0:N-1]*2*pi/Dx;
>

Your and Rune's gives exactly the same values at sample points since adding k*2*pi in the exponential function does not change the value (aliasing).

It is a matter of how you want to interpret the frequency spectrum, yours made the spectrum centered about 0, and supposes the low frequency is dominant. Rune's does not.

I would say your is more conventional.

Pau GALLES

unread,
Jun 1, 2016, 10:15:10 AM6/1/16
to
"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message <nimj73$8ai$1...@newscl01ah.mathworks.com>...
Thanks Bruno,

However I believe there has to be a right definition because a spatial signal fft has

kx = 1/wavelengthx

meaning the wavelengths solved in my problem won't be the same for the 2 different alternative definitons for the kx.

Pau GALLES

unread,
Jun 1, 2016, 10:22:08 AM6/1/16
to
"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message <nimj73$8ai$1...@newscl01ah.mathworks.com>...
Thanks Bruno,

However I am still concerned about only 1 definition being the right answer. It is my understanding that kx defines the wavelength range for a spatial signal.

kx = 1/=wavelengthx

Is the wavelength solved varying depending on the kx definition?

Bruno Luong

unread,
Jun 1, 2016, 12:22:09 PM6/1/16
to
"Pau GALLES" wrote in message <nimr2b$old$1...@newscl01ah.mathworks.com>...
>
> Thanks Bruno,
>
> However I am still concerned about only 1 definition being the right answer. It is my understanding that kx defines the wavelength range for a spatial signal.
>
> kx = 1/=wavelengthx
>
> Is the wavelength solved varying depending on the kx definition?

Both answers are right mathematically, since both give back the data.

When you sample the data with a step dx, frequencies with separation = 1/dx cannot be not be distinguished due to aliasing.

So to be more accurate, both answers are actually wrong because you can never know the full real spectrum from the discrete data.

Now the standard way of interpreting frequency spectrum is yours (symmetric centered about 0), not Rune's, since centering usually represents better the physics. But keep in mind that is not always the case.

Pau GALLES

unread,
Jun 1, 2016, 1:20:10 PM6/1/16
to
"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message <nin23b$a7e$1...@newscl01ah.mathworks.com>...
Many thanks Bruno,

If I center the frequencies I will get negative wavelengths. What are they meaning? I am going to filter by wavelengths afterwards. so I assume I should keep my frequencies positive?

I just cannot stop asking, sorry xD

Regards,

Pau

Bruno Luong

unread,
Jun 1, 2016, 1:54:10 PM6/1/16
to
"Pau GALLES" wrote in message <nin5g3$hbs$1...@newscl01ah.mathworks.com>...

>
> If I center the frequencies I will get negative wavelengths. What are they meaning? I am going to filter by wavelengths afterwards. so I assume I should keep my frequencies positive?

Both negative and positive frequencies (with the same absolute value) provide the phase and amplitude of the frequency.
0 new messages