Closed purushottam22 closed 2 years ago
I was curious about this also. Is there an algorithmic approach for picking the best scale? I'm familiar with spectrograms, but I am unsure how to extract the best scale to use.
For reference, a spectrogram looks something like this:
Thanks Dymytriy.
See their documentation on choosing a scales here:
https://pywavelets.readthedocs.io/en/latest/ref/cwt.html#choosing-the-scales-for-cwt
Specifically the function pywt.scale2frequency()
It's of course signal and wavelet dependent.
I don't know what your plans are with your signals but you probably would want to select scales that correspond to a frequency range between 1-50Hz something like that for P-waves.
What scale value can be used in the python code :- pywt.cwt(data, scales, wavelet) ?
I am using 'mexh' Wavelet function. Data is the p-signals of ECG from Modified Lead 2 (ML2). Signal frequency is 360Hz.
I am using this cwt function for preprocessing the ECG signal. The ECG signal used is 100 record form MIT-BIH Arrhythmia Database (https://physionet.org/content/mitdb/1.0.0/).
Original Image :-![img1](https://user-images.githubusercontent.com/48179902/141064532-5a334624-591c-4538-a75b-611eac83e9c9.png)
At Scale = 0.25![img4](https://user-images.githubusercontent.com/48179902/141064186-aa59917c-f786-451d-bc14-c1c013254faf.png)
At Scale = 0.5![img3](https://user-images.githubusercontent.com/48179902/141064172-af6939b2-684d-4d10-941e-296214d64269.png)
At scale = 1![img2](https://user-images.githubusercontent.com/48179902/141064271-22151aeb-4ccb-42d8-8aca-eef4f59ab914.png)