Re:[ncl-talk] 1D fft and spectra

From: <xiexin163_at_nyahnyahspammersnyahnyah>
Date: Mon, 28 May 2007 10:03:23 +0800

Hi,

I have the same problem as Verica has when I use these two functions
to calculate some power spectra(raw periodogram). However, I also got
different anwsers. Following the description on the specx_anal site, I know
that what specx_anal is trying to do is first calculate the fourier
coefficients of sine and cosine. Then it calculate each (ak^2+bk^2)/2.
That is periodogram.

To prove that, I use ezfftf to do the same thing as the above but got
anwsers different from what specx_anal gives. The result from specx_anal
is quite larger than what ezfftf gives. Thought not totally the same, the
plot shape is quite similar. I do not know whether the definitions of
these two are the same. Anyone can explain that?

Your help is appreciated!

Xie Xin

> Hi All,
>
> I have a question regarding the 1D fft and 1D spectra, in respect to
> the very different results for the spectra constructed using ezfftf
> comparing to the spectra from specx_anal.
> Attached is the plot with the resulting curves. On the left hand side
> is specx_anal curve, and on the right hand side is the curve from
> ezfftf.
> In addition to very different shape of the curve and very different
> values on the Y axis, I have also found a mismatch between the
> variances calculated from the two spectra. From the description of
> the specx_anal, area under the curve should give the total variance
> of the initial v
> ariable. I've tried comparing the variance with the area under the
> curve from ezfftf and curve from specx_anal and I get about 5 times
> larger value for the integral under specx_anal:
> integral(spectra from ezfftf) = 0.291434
> variance(data) = 0.292072
> xvari = 0.291501
> xvaro = 0.291501
> integral(spectra from specx_anal) = 1.71725
> xvari and xvaro are the attributes of the result of specx_anal.
>
> In addition to the plot, I've also attached the code with both
> routines and a file with sample of data I used for this example.
>
> Does someone know what is the difference?
>
> Thank you,
> Verica

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun May 27 2007 - 20:03:23 MDT

This archive was generated by hypermail 2.2.0 : Tue May 29 2007 - 07:20:14 MDT