wavelet

seas.waveletFunctions.wavelet(Y, dt: int, pad: int = 0, dj: float = - 1, s0: float = - 1, J1: float = - 1, mother: str = - 1, param: int = - 1)[source]
WAVELET 1D Wavelet transform with optional significance testing

wave, period, scale, coi = wavelet(Y, dt, pad, dj, s0, J1, mother, param)

Computes the wavelet transform of the vector Y (length N), with sampling rate DT.

By default, the Morlet wavelet (k0=6) is used. The wavelet basis is normalized to have total energy=1 at all scales.

INPUTS:

Y = the time series of length N. DT = amount of time between each Y value, i.e. the sampling time.

OUTPUTS:

WAVE is the WAVELET transform of Y. This is a complex array of dimensions (N,J1+1). FLOAT(WAVE) gives the WAVELET amplitude, ATAN(IMAGINARY(WAVE),FLOAT(WAVE) gives the WAVELET phase. The WAVELET power spectrum is ABS(WAVE)**2. Its units are sigma**2 (the time series variance).

OPTIONAL INPUTS:

* Note * if none of the optional variables is set up, then the program

uses default values of -1.

PAD = if set to 1 (default is 0), pad time series with enough zeroes to get

N up to the next higher power of 2. This prevents wraparound from the end of the time series to the beginning, and also speeds up the FFT’s used to do the wavelet transform. This will not eliminate all edge effects (see COI below).

DJ = the spacing between discrete scales. Default is 0.25.

A smaller # will give better scale resolution, but be slower to plot.

S0 = the smallest scale of the wavelet. Default is 2*DT.

J1 = the # of scales minus one. Scales range from S0 up to S0*2**(J1*DJ),

to give a total of (J1+1) scales. Default is J1 = (LOG2(N DT/S0))/DJ.

MOTHER = the mother wavelet function.

The choices are ‘MORLET’, ‘PAUL’, or ‘DOG’

PARAM = the mother wavelet parameter.

For ‘MORLET’ this is k0 (wavenumber), default is 6. For ‘PAUL’ this is m (order), default is 4. For ‘DOG’ this is m (m-th derivative), default is 2.

OPTIONAL OUTPUTS:

PERIOD = the vector of “Fourier” periods (in time units) that corresponds

to the SCALEs.

SCALE = the vector of scale indices, given by S0*2**(j*DJ), j=0…J1

where J1+1 is the total # of scales.

COI = if specified, then return the Cone-of-Influence, which is a vector

of N points that contains the maximum period of useful information at that particular time. Periods greater than this are subject to edge effects.