For the inverse continuous wavelet transform, I am using a for-loop which runs through each frequency. At each frequency, I convolve the corresponding morlet wavelet with the signal at that frequency, and add it to my result.
This code is based on the inverse transform outlined in "A Really Friendly Guide to Wavelets" by C. Valens (1999)
for f in range(len(freqs)): scale = central_freq / freqs[f] wavelet = Chromoscalogram.make_wavelet(quality, central_freq, bandwidth=0.000001, scaling=scale) # add convolution of each frequency convolved = Chromoscalogram.convolve(data[f], wavelet) reconstructed = np.add(Chromoscalogram.deconvolve(convolved, reconstructed)
This usually produces something similar to the original waveform data, but the magnitude is noticeably off by an inconsistent factor (If the frequency of the signal changes over time, then the magnitude will be off by significantly different amounts over time), and the phase is off by pi for certain frequencies
Any help would be appreciated!