Package ivs :: Package timeseries :: Module windowfunctions
[hide private]
[frames] | no frames]

Module windowfunctions

source code

Window functions.

A window with a high dynamic range is a window that can distinguish peaks in a broad range of amplitudes. Usually, this goes together with loss in resolution and detection power (higher noise).

Example usage: calculate the window function of timeseries, using different windows.

>>> import tfreq
>>> from pylab import figure,show,legend,plot,xlim
>>> times = linspace(0,150,10000)
>>> signal = ones(len(times))
>>> windows = ['rectangular','hann','hamming','cosine','bartlett']
>>> windows += ['nuttall','blackman-harris']
>>> for window in windows:
...   pergram = tfreq.scargle(times,signal,fn=1.5,df=0.0005,norm='amplitude',window=window)[1]
...   p=figure(1)
...   p=plot(pergram[0],pergram[1],'-',label=window)
...   p=figure(2)
...   p=plot(log10(pergram[0]),log10(pergram[1]),'-',label=window)
>>> p=figure(1);p=legend();p=xlim(0,1.5)
>>> p=figure(2);p=legend(loc='lower left');p=xlim(-2.5,-0.3)
Functions [hide private]
 
test() source code
    Main wrapper
 
getWindowFunction(name, times) source code
    Low dynamic range
 
rectangular(times)
Rectangular (no) window
source code
    Moderate dynamic range
 
hamming(times)
Hamming window
source code
 
hann(times)
Hann or Hanning window
source code
 
cosine(times)
Cosine window
source code
 
bartlett(times)
Bartlett window (zero valued end-points)
source code
    High dynamic range
 
nuttall(times)
Nuttall window
source code
 
blackman_harris(times)
Blackman Harris window
source code
Variables [hide private]
  logger = logging.getLogger("IVS.TS.WINF")