如何计算python中select最佳母离散小波的小波能量-香农熵比?

How to calculate wavelet energy-to-Shannon entropy ratio to select best mother discrete wavelet in python?

我正在对传感器数据进行小波分析,但是,我意识到 select 有很多小波族。我读过一篇文章,上面写着:"The method firstly uses a criterion of maximum energy-to-Shannon entropy ratio to select the appropriate wavelet base for signal analysis."。所以,我想知道如何计算python?

中传感器信号的能量-香农熵比

假设文本的最佳猜测:np.max(总 Energy/Total 熵)|wavelet

import pywt
import numpy as np

#series - input data
#wave   - current wavelet
data=pywt.wavedec(series,wave)
S=0
Etot=0
for d in data:
    E=d**2
    P=E/np.sum(E)
    S+=-np.sum(P*np.log(P))
    Etot+=np.sum(E)
ratio=Etot/S

然后对每个候选小波重复