OverLordGoldDragon / ssqueezepy

Synchrosqueezing, wavelet transforms, and time-frequency analysis in Python
MIT License
618 stars 96 forks source link

synsq_cwt_inv freqband is not subscriptable #10

Closed bluenote10 closed 3 years ago

bluenote10 commented 3 years ago

Most likely you are aware of this. Just in case it should be tracked explicitly.

Out of curiosity I gave synsq_cwt_inv a try, and noticed that currently it doesn't work:

/home/fabian/git/ssqueezepy/ssqueezepy/synsq_cwt.py in synsq_cwt_inv(Tx, fs, opts, Cs, freqband)
    166     for n in range(Cs.shape[1]):
    167         TxMask = np.zeros(Tx.shape)
--> 168         UpperCs = min(max(Cs[:, n] + freqband[:, n], 1), len(fs))
    169         LowerCs = min(max(Cs[:, n] - freqband[:, n], 1), len(fs))
    170 

TypeError: 'int' object is not subscriptable

This makes sense because freqband is initialized as scalar here, so the indexing here will fail.