[ncl-talk] specxy_anal gives maximum frequency less than 0.5

Dennis Shea shea at ucar.edu
Wed Sep 17 07:18:38 MDT 2014


Oops

 N = 100    ; even
 df = 1.0/N

 frq := df*ispan(1,N/2,1)      ; 0 => 0.5
 print(frq)

What you are seeing is

  N=101    ; odd
  df = 1.0/N
  frq := df*ispan(1,N/2,1)          ; 0 => 0.4950495

This will have to be fixed. A JIRA ticket has been opened

===


N=even  .... (N/2)  real and imaginary parts 2*(N/2)=N

N=odd    .... 2*(N/2)  + one real part => N   (imaginary part 'undefined')

On Mon, Sep 15, 2014 at 3:09 PM, Maria Gehne - NOAA Affiliate <
maria.gehne at noaa.gov> wrote:

> Hi all,
>
>
> not sure if anyone else has noticed this before. The specxy_anal routine
> returns maximum frequency values that are less that the 0.5 that it should
> return. (The documentation says the last entry of the spectrum is for
> frequency 0.5) This doesn't seem like the desired behavior. Or maybe it is?
>
>
>
> Here is a 4 line script that reproduces the issue:
>
>
> a = fspan(1,100,101)
>
> b = fspan(101,200,101)
>
> dof = specxy_anal(a,b,0,3,0.1)
>
> printMinMax(dof at frq,1)
>
>
> Output:
>
>
> (0)
>
> (0)     min=0.00990099   max=0.49505
>
>
>
> Maria
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140917/ad7ca378/attachment.html 


More information about the ncl-talk mailing list