Skip to content Skip to sidebar Skip to footer

Units Of "widths" Argument To Scipy.signal.cwt() Function

I am confused about the widths parameter that gets passed to scipy.signal.cwt() and by extension to scipy.signal.find_peaks_cwt(). A previous and very helpful Stack Overflow questi

Solution 1:

I had the same question myself. Looking at the source code, my best guest is that the units are in "number of samples". The key code line within scipy.signal.wavelets.cwt is:

wavelet_data = wavelet(min(10 * width, len(data)), width)

Here, "wavelet" is a function (builder of the mother wavelet) which receives parameters "length_of_wavelet" and "width_of_wavelet" in number of samples. The reason why widths can still be a non-integer value is that (if I'm not wrong) it represents the scaling factor, which can take any real positive number as it is just a factor of the formulation that affects the shape of the wavelet.

Post a Comment for "Units Of "widths" Argument To Scipy.signal.cwt() Function"