Units of “widths” argument to scipy.signal.cwt() function

前端 未结 1 758
予麋鹿
予麋鹿 2021-02-15 09:49

I am confused about the widths parameter that gets passed to scipy.signal.cwt() and by extension to scipy.signal.find_peaks_cwt(). A previ

1条回答
  •  说谎
    说谎 (楼主)
    2021-02-15 10:08

    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.

    0 讨论(0)
提交回复
热议问题