[ncl-talk] Question about Spectral Analysis(computation of variance)

Dennis Shea shea at ucar.edu
Sun Jan 15 15:55:34 MST 2017


The "power" at the lowest frequencies is because:

[a] you have not removed the mean annual cycle
     and/or
[b] you not removed linear trend.

Both contribute to "power" at low frequencies.

Removing the influence of known signals that may obscure the signals is
called "prewhitening". Please look this up.

I speculate [a] is the primary reason.

http://www.ncl.ucar.edu/Applications/climo.shtml
http://www.ncl.ucar.edu/Applications/Scripts/climo_5.ncl

http://www.ncl.ucar.edu/Applications/mjoclivar.shtml
http://www.ncl.ucar.edu/Applications/mjoclivar.shtml#ex2

Please read:
http://www.ncl.ucar.edu/Document/Functions/Contributed/calcDayAnomTLL.shtml

Good Luck

On Thu, Jan 12, 2017 at 7:59 PM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:

> Dear Sir Dennis,
>
> I tried to perform the spectral analysis in different regions using a
> different data set from my previous post. For example, Western Africa and
> South China Sea but I still get the same spike in variance near the 0 mark.
> I am using gpcp daily data. Attached are the images and my script.
>
> Any suggestion on how can I fix this?
>
>
> Here is the link to the data that I am using.
>
> https://drive.google.com/drive/folders/0B9faET7Bc2o8R0ZsZXM1
> bkxUWlE?usp=sharing
>
>
> Many thanks,
>
> Lyndon
>
>
> On Mon, Jan 9, 2017 at 11:14 AM, Lyndon Mark Olaguera <
> olagueralyndonmark429 at gmail.com> wrote:
>
>> Hi Sir Dennis,
>>
>> Thanks for the help. I was looking for peaks with periods of 30 to 60
>> days.
>> The data is not good for this analysis. I also tried in the raw daily
>> values (attached in this email) but there is still a very large
>> variance/frequency.
>>
>>
>>
>> On Sat, Jan 7, 2017 at 1:42 AM, Dennis Shea <shea at ucar.edu> wrote:
>>
>>> [1]
>>> As noted in the documentation:
>>>    "The units are variance/(unit frequency interval)."
>>>     **not**
>>>    "variance"
>>>
>>> [2]
>>> Look at the data ... literally
>>>    plot = gsn_csm_y(wks,rain,False)                      ; see
>>> attachment
>>>
>>> Basically, the annual cycle of rain.
>>>
>>> What is it you expect from a time series like this? The lag-1 day auto
>>> correlation is 0.96. A ***very red** process.
>>>
>>> Assuming this is a climatology, I did a [four)info] on the data, The 1st
>>> harmonic has amplitude 7.3 with the phase max at day 220 and it explains
>>> 82% of the variance. The 2nd harmonic has amplitude 2.3; phase day 32; 8%
>>> of the variance.
>>>
>>>
>>>
>>> On Fri, Jan 6, 2017 at 1:57 AM, Lyndon Mark Olaguera <
>>> olagueralyndonmark429 at gmail.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I'm trying to perform spectral analysis using the specx_anal function
>>>> in ncl.
>>>> I'm getting a variance around 1000 near the zero mark.I dont know if
>>>> I'm missing a step prior to performing the spectral analysis. I would like
>>>> to ask for any suggestions on how can I improve this.
>>>>
>>>>
>>>> Attached are the data set and script.
>>>>
>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>>>>
>>>> begin
>>>> filename = "type1_clim.csv"
>>>> lines    = asciiread(filename,-1,"string")
>>>> data     = lines(1:)
>>>> rain    = tofloat(str_get_field(data,10,","))
>>>>
>>>> d = 1
>>>> sm = 12
>>>> pct = 0.10
>>>>
>>>> spec= specx_anal(rain,d,sm,pct)
>>>> printVarSummary(spec)
>>>>
>>>> wks  = gsn_open_wks("png","test_fldmean")             ; Opens a ps file
>>>> res = True
>>>> res at tiMainString = "Type1_Spectrum"                     ; title
>>>> f = spec at frq
>>>> res at tiXAxisString = "Frequency (cycles/day)"  ; xaxis
>>>> res at tiYAxisString = "Variance"                       ; yaxis
>>>>
>>>> splt = specx_ci(spec, 0.05, 0.95)
>>>>
>>>> res at xyLineColors        = (/"foreground","green","blue","red"/)
>>>> plot = gsn_csm_xy(wks,f,splt,res)     ; create plot
>>>> end
>>>>
>>>> I'll appreciate any help.
>>>>
>>>> Many thanks,
>>>>
>>>> Lyndz
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> 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/20170115/00f8daa9/attachment.html 


More information about the ncl-talk mailing list