alsauve / scaleogram

Scaleogram plot for Continuous Wavelet Transform made easy
MIT License
111 stars 32 forks source link

Normalization of CWT magnitude #3

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi,

Thanks for producing this excellent piece of work, it makes producing wavelet plots very straightforward indeed. However, I do have a question about the magnitude output. If I have an input signal with two periodic components of equal amplitude, is it possible to normalize the cwt output such that the two components have equal magnitude in the cwt spectrum?

In the attached example I have two components with equal amplitude in the time domain but different magnitudes in the wavelet spectrum. I understand that this is possible in the Matlab cwt implementation: "The cwt function uses L1 normalization. With L1 normalization, if you have equal amplitude oscillatory components in your data at different scales, they will have equal magnitude in the CWT. Using L1 normalization shows a more accurate representation of the signal." (source: https://uk.mathworks.com/help/wavelet/ref/cwt.html#mw_ae84b041-f038-4c11-bf1a-6058481e25a8)

Can I do the same with your toolbox?

image

alsauve commented 2 years ago

Hi @banksii ,

have you used spectrum='amp' ?

This should solve your problem. The name used was not norm='XXX' as the real and imaginary part does not fit.

Maybe the spectrum parameter should be split into two parameters

I set the enhancement label on this issue and keep it for a motivated future contributor or myself when I have more time.

Dymytriy-Zyunkin commented 2 years ago

Just ran into a similar problem. I have a signal that is a sum of two sinusoids. Attached is the scalogram and the signal graph:

image

I set spectrum='amp', and yet the issue was not resolved.