1

I am working on converting the following MatLab code into Python:

function [pos,dx]=cwt_local_maximum(x,hpw)
    dx = -cwt(x,2*hpw,'haar');
    pos=find(sign(-sign(diff(sign(dx))+0.5)+1))';
end

I have investigated different means to achieve this via both SciPy.Signal and pywavelet. Unfortunately, I have had no success due to pywavelet accepting haar only for the dwt function, and not cwt.

Is anyone able to point me in a better direction as to how to make this code work?

  • Haar wavelets, by definition, are not continuous out of the unit interval [0,1]. I believe this is the reason why it is not implemented as CWT in pywavelets library (there is an open discussion in https://groups.google.com/g/pywavelets/c/oMSSMCXELsI?pli=1). Is there any special reason for you to want implementing it as CWT instead of DWT? – tbnsilveira May 21 '22 at 22:22

0 Answers0