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)
|
|
|
|
|
|
|
|
|
|
|
|
|
bartlett(times)
Bartlett window (zero valued end-points) |
source code
|
|
|
|
|
blackman_harris(times)
Blackman Harris window |
source code
|
|
|
logger = logging.getLogger("IVS.TS.WINF")
|