Re: Periodogram and frequency

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Aug 22 2013 - 09:39:11 MDT

Actually, I had the population and sample variances mixed up.
It should be

    svar = variance(Test1) ; sample variance
    pvar = svar*(N-1.)/N ; population variance of Test1
    print("")
    print("pvar="+pvar+" svar="+svar)
                                        ; scale to population variance
    total_area = (px(0) + px(N/2-1))*(df/2) + sum(px(1:N/2-2))*df
    sclVar = pvar/total_area
    pxscl = px*sclVar

On 8/22/13 9:22 AM, Dennis Shea wrote:
> Not sure what is meant by:
> "But I want this pick to be over the value 4, not 50. The 4, in this
> case, means the frequency with which the 2 repeats"
>
> ---
> specx_anal scales the spectra such that the area under
> the curve equals the variance of the input series.
> This facilitates determining the variance at a particular
> frequency interval or at a frequency
>
> fstrt = 0.20
> flast = 0.30
> ifrq = ind(frq.ge.fstrt .and. frw.le.flast)
> varf = sum(px*df)
>
> At an individual frequency fstrt=flast (must be exact)
>
>
>
> Attached is a simple script you can use. It uses ezfftf to explicitly
> calculate the fourier coefficients and then the periodogram.
>
> Note: I think your script had
>
> do i = 1, dimsizes(listTest21) -1
>
> Should be
> do i = 1, dimsizes(listTest21)
>
> but maybe I am wrong.
>
>
> On 8/22/13 8:17 AM, Rodrigo Colpo wrote:
>> Dear all,
>>
>>
>> I have created a list where the number "2" is equally spaced, like this:
>>
>>
>> [0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0,
>> 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0,
>> 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0,
>> 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2,
>> 0, 0, 0, 2, 0, 0, 0]
>>
>> ... using the following script:
>>
>>
>> Test1 = new(100,integer)
>> Test1 = 0
>> do i = 1, dimsizes(listTest21) -1
>> if (i%4 .eq. 0) then
>> Test1(i-1 ) = 2
>> end if
>> end do
>>
>> So, every 4 elements, there is one "2".
>>
>> Then, I used the "specx_anal" function the have information about the
>> "frequency", and ploted the following graph of the periodogram (@spcx):
>> https://docs.google.com/file/d/0BxhksDtMuWrVdTVIdkdJcWVUVVE/edit?usp
>>
>> But I want this pick to be over the value 4, not 50. The 4, in this
>> case, means the frequency with which the 2 repeats (or have
>> oscillations in the "numbers").
>>
>> The idea is to apply this principle to retrieve information about the
>> time scale needed for clouds to change its "behavior".
>>
>> Best wishes,
>> Rodrigo.
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 22 09:39:16 2013

This archive was generated by hypermail 2.1.8 : Fri Aug 30 2013 - 14:04:57 MDT