scipy.signal.cwt

scipy.signal.cwt(data, wavelet, widths)[source]

Performs a continuous wavelet transform on data, using the wavelet function. A CWT performs a convolution with data using the wavelet function, which is characterized by a width parameter and length parameter.

Parameters :

data : 1-D ndarray

data on which to perform the transform.

wavelet : function

Wavelet function, which should take 2 arguments. The first argument is a width parameter, defining the size of the wavelet (e.g. standard deviation of a gaussian). The second is the number of points that the returned vector will have (len(wavelet(width,length)) == length). See ricker, which satisfies these requirements.

widths : sequence

Widths to use for transform.

Returns :

cwt: 2-D ndarray :

Will be len(widths) x len(data).

Notes

cwt[ii,:] = scipy.signal.convolve(data,wavelet(width[ii], length), mode=’same’) where length = min(10 * width[ii], len(data)).

Examples

>>> signal = np.random.rand(20) - 0.5
>>> wavelet = ricker
>>> widths = np.arange(1, 11)
>>> cwtmatr = cwt(signal, wavelet, widths)

Previous topic

scipy.signal.ricker

Next topic

scipy.signal.find_peaks_cwt