comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » The spectra of fluctuations in variable
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
The spectra of fluctuations in variable [message #53004] Wed, 14 March 2007 04:51 Go to next message
duxiyu@gmail.com is currently offline  duxiyu@gmail.com
Messages: 88
Registered: March 2007
Member
I have a time series B(T).
The time resolution dt of the data is 4s and the amount N is 1000.
The unit of B and T is 'nT' and 's'.
I want to study its fluctuaions in frequence space using the power
spectral density (PSD).

BB=FFT(B)
freq=FINDGEN(N)/(N*dt)

Then I am not clear how to caculate the PSD.
Maybe, PSD=(ABS(BB))^2, but there is a problem in the unit.
The unit of BB is 'nT' that is the same as B, so the unit of PSD which
is obtained by the above method is 'nT^2'.
But in physical view the unit of PSD should be 'nT^2/Hz'.

The other question is how to caculate the phase difference between two
B1 and B2.
I caculate it by the following method, but I am not sure whether it is
right.

BB1=FFT(B1)
BB2=FFT(B2)
phase1=ATAN(BB1,/phase)
phase2=ATAN(BB2,/phase)
difference=phase1-phase2

Moreover, the angles seems not smoothed by regular method because of
theirs periodicity.
Is there other method to smooth the angle data?

Best wishes,
Du Jian
Re: The spectra of fluctuations in variable [message #53083 is a reply to message #53004] Thu, 15 March 2007 08:20 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"duxiyu@gmail.com" <duxiyu@gmail.com> writes:

> I have a time series B(T).
> The time resolution dt of the data is 4s and the amount N is 1000.
> The unit of B and T is 'nT' and 's'.
> I want to study its fluctuaions in frequence space using the power
> spectral density (PSD).
>
> BB=FFT(B)
> freq=FINDGEN(N)/(N*dt)
>
> Then I am not clear how to caculate the PSD.
> Maybe, PSD=(ABS(BB))^2, but there is a problem in the unit.
> The unit of BB is 'nT' that is the same as B, so the unit of PSD which
> is obtained by the above method is 'nT^2'.
> But in physical view the unit of PSD should be 'nT^2/Hz'.

If you want "per Hertz" then you need to divide the powers by the
spacing between adjacent frequencies.

Also, you will have to worry some about the normalization of the FFT.
Experiment with FFT(B,+1) and FFT(B,-1) until you get what you want.


> The other question is how to caculate the phase difference between two
> B1 and B2.
> I caculate it by the following method, but I am not sure whether it is
> right.
>
> BB1=FFT(B1)
> BB2=FFT(B2)
> phase1=ATAN(BB1,/phase)
> phase2=ATAN(BB2,/phase)
> difference=phase1-phase2
>
> Moreover, the angles seems not smoothed by regular method because of
> theirs periodicity.
> Is there other method to smooth the angle data?

I would normally recommend multiplying the fourier coefficients
to form the "cross spectrum,"
CR12 = BB1 * CONJ(BB2)
You can rebin or smooth these complex numbers as you wish, and then
compute ATAN() on the result. Finding the uncertainties of those
values is a much more complicated process.

Good luck,
Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Modis Georeferencing
Next Topic: Problems in non-linear fitting

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:20:06 PDT 2025

Total time taken to generate the page: 0.00522 seconds