Re: Is that a bug in function "specx_anal"?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 2 Apr 2007 07:54:15 -0600 (MDT)

Hi All,

A final update on this: I double-checked the underlying Fortran code, and
also consulted with the provider of this routine, and there doesn't
appear to be a bug in specx_anal. He said:

   The dof are not a function of the number of input values. The dof
   are a function of the weights (primarily) and the percent taper.

   An FFT is used to compute the spectra. Each raw periodogram estimated
   has 2 dof. Tapering (say) 10% makes this slightly smaller. Then the
   weights are applied to the periodogram estimates using a modified
   Daniele window.

--Mary

On Sun, 1 Apr 2007, lxf wrote:

> Hi,
> Today, when I use the function "specx_anal" in my script,I found the return value of it was
> a constant even if I input different length of arrays. However, "The return value is a scalar
> representing the degrees of freedom", so it should be different when the length of input arrays
> are different.
> Can somebody help me?
>
> The folowing is the segment of my script and the output information:
> ====================script===================================
> ;
> ; set function arguments
> ; detrending opt: 0=>remove mean 1=>remove mean and detrend
> d = 0
> ; smoothing periodogram: (0 <= sm <= ??.) should be at least 3 and odd
> ; sm = 3
> sm = 0
> ; percent tapered: (0.0 <= pct <= 1.0) 0.10 common.
> pct = 0.10
> ;
> ; calculate spectrum(chunck spectrum)
> ;
> data1=ndtooned(nami(0,:))
> data2=ndtooned(nami(0:1,:))
> data3=ndtooned(nami(0:2,:))
> data4=ndtooned(nami(0:50,:))
>
> sdof1 = specx_anal(data1,d,sm,pct)
> sdof2 = specx_anal(data2,d,sm,pct)
> sdof3 = specx_anal(data3,d,sm,pct)
> sdof4 = specx_anal(data4,d,sm,pct)
>
> print(dimsizes(data1)+" "+sdof1)
> print(dimsizes(data2)+" "+sdof2)
> print(dimsizes(data3)+" "+sdof3)
> print(dimsizes(data4)+" "+sdof4)
> ==================output information====================================
> Copyright (C) 1995-2006 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 4.2.0.a034
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
>
> (0) 365 1.89553
> (0) 730 1.89553
> (0) 1095 1.89553
> (0) 18615 1.89553
>
>
> Best regards,
> li
> 2007-04-01
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 02 2007 - 07:54:15 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 02 2007 - 08:01:14 MDT