I have a signal which like this:
I want to calculate this signal's instantaneous frequency.I have tried hht and so on which method I can find but can not get the result.
So does somebody can give me some advice? If can proveide some python program which will be must useful for me.Thanks!
UPDATED: Thanks @OverLordGoldDragon I use this code in this answer:
import numpy as np
from ssqueezepy import ssq_cwt, extract_ridges
from ssqueezepy.visuals import plot, imshow
z = see OP's code; used np.random.seed(1000)
beta = 24
Tx, Wx, ssq_freqs, scales, *_ = ssq_cwt(z, ('gmw', {'beta': beta}), padtype='zero', fs=6)
ridge_idxs = extract_ridges(Tx, scales, penalty=20)
plot(ridge_idxs, color='k', linestyle='--', xlims=(0, len(z) - 1))
imshow(Tx, abs=1, yticks=ssq_freqs[::-1], ylabel="Frequencies [Hz]",
title="abs(SSQ_CWT), wavelet=('gmw', {'beta': %s})" % beta)
amplitude = np.abs(Tx[ridge_idxs[:, 0], np.arange(len(z))])
frequencies = ssq_freqs[::-1][ridge_idxs[:, 0]]
plot(amplitude, ylims=(0, None), title="Amplitude vs time, SSQ ridge", show=1)
plot(frequencies, ylims=(0, None), ylabel="Frequencies [Hz]",
title="Frequency vs time, SSQ ridge", show=1)


help(ssq_cwt). There's lots of reference material in the README, including this overview, and examples. For choosing wavelet parameters, see here. – OverLordGoldDragon Jun 17 '21 at 02:13ssq_cwtorextract_ridgesneed adjusting. But this is now a separate question, which you're free to ask - best with signal data included for download, as.npyor.csv(or paste as list here if reasonably long). – OverLordGoldDragon Jun 17 '21 at 05:31ssq_cwtandextract_ridges.If I have some new questions I will ask you again. So please don't bored with me! – user57947 Jun 17 '21 at 06:52