scikit-signal / tftb

A Python module for time-frequency analysis
257 stars 53 forks source link

Possible optimisation for processing.Scalogram ? #168

Open vldv opened 4 years ago

vldv commented 4 years ago

Hi,

I'm not quite sure this is the right place to notify that but here I go.

I've been using the Scalogram method recently and noticed two possible improvements that can help it scale (much) better.

In affine.py, line 173 : the conversion of self.tfr to complex type is probably not needed here, since it's already created as a complex array in base.py, line 52.

In affine.py, line 164 : No kwargs are passed in the super method. In turn, the AffineDistribution class cannot pass such kwargs to BaseTFRepresentation. This has the consequence to set the self.tfr size to N x N ( base.py, line 38-39) with N being the length of the signal processed. This causes MemoryError for relatively small signal length.

I don't know if these are by design or not, but by modifying the files on my end I see not difference in output and significant performances improvements.

Thanks for you work, Best, Victor

jaidevd commented 4 years ago

Hi @vldv, thanks for pointing this out.

Could you please send a pull request with the proposed changes?

Thanks,