pyhctsa.operations.wavelet.cwt

pyhctsa.operations.wavelet.cwt(y, w_name='db3', max_scale=32)

Continuous wavelet transform of a time series.

Computes the continuous wavelet transform (CWT) of a time series using the specified wavelet and maximum scale, and returns a set of statistics on the coefficients, entropy, and results of coefficients summed across scales.

Parameters:
y : array-like

The input time series.

w_name : str, optional

The wavelet name, e.g., ‘db3’ (Daubechies wavelet), ‘sym2’ (Symlet), or the continuous Morlet wavelet ‘morl’. For either kind, the wavelet function is integrated on a grid of 2**10 points over its support, and the integral, stretched to each scale, is convolved with the series and differenced (the continuous transform with that wavelet at integer scales). Default is 'db3'.

max_scale : int, optional

The maximum scale of wavelet analysis. Default is 32.

Returns:

Dictionary of statistics on the CWT coefficients, including gam1 and gam2 (the shape and scale of a gamma distribution fitted to SC by maximum likelihood; NaN if any scaled power is exactly zero, which the gamma distribution cannot describe) and dd_SC_h (the entropy of the maximum of SC in each of 10 time boxes at each scale).

Return type:

dict

Notes

The scaled power is relative to the mean power, SC = S / mean(S) with S = |coeffs|**2 (so the mean of SC is 1, independent of the number of coefficients). pover99, pover98, pover95, pover90 and pover80 are the energy shares of the strongest 1, 2, 5, 10 and 20% of coefficients (the sum of the largest max(1, floor((100 - p)/100*numEntries)) values of SC, divided by numEntries). SC_h is the entropy of SC relative to its maximum, -sum(SC_a*log(SC_a)) - log(numEntries) with SC_a = SC/sum(SC).