fastlib / fCWT

The fast Continuous Wavelet Transform (fCWT) is a library for fast calculation of CWT.
Apache License 2.0
263 stars 53 forks source link

Reconstruction from coefficients i.e. inverse fCWT #36

Open simonweppe opened 1 year ago

simonweppe commented 1 year ago

Hi, Thanks for the great tool..

Is there anyway to reconstruct the signal from the coefficients ?

For example

        #Initialize
        fs = 1000
        n = fs*100 #100 seconds
        ts = np.arange(n)

        #Generate linear chirp
        signal = np.sin(2*np.pi*((1+(20*ts)/n)*(ts/fs)))
        f0 = 1 #lowest frequency
        f1 = 101 #highest frequency
        fn = 200 #number of frequencies

        #Calculate CWT without plotting...
        freqs, out = fcwt.cwt(signal, fs, f0, f1, fn)

        # now reconstruct signal from coeff ?
       signal = fcwt.icwt(freqs,out)...or something along these lines ? 
felixdollack commented 1 year ago

It seems that inverse fcwt is currently not implemented (see issue #23) and maybe not so high on the priority list (?).

fastlib commented 1 year ago

An inverse CWT is often not implemented by libaries (the popular Python library Pywavelets for example, does not implement an inverse CWT, only the inverse DWT which is basically just adding up all wavelets multiplied by their coefficient). As an CWT provides an redundant representation, an inverse is not trivial. However, I understand the usefulness of having a fast inverse CWT for actual signal processing, so I will update it on the priority list for the next major update.

GUIMINLONG commented 9 months ago

I also wondering how can I reconstruct the signal