def homomorphic_envelope(x, fs=1000, f_LPF=8, order=3):
"""
Computes the homomorphic envelope of x
Args:
x : array
fs : float
Sampling frequency. Defaults to 1000 Hz
f_LPF : float
Lowpass frequency, has to be f_LPF < fs/2. Defaults to 8 Hz
Returns:
time : numpy array
"""
b, a = butter(order, 2 * f_LPF / fs, 'low')
he = np.exp(filtfilt(b, a, np.log(np.abs(hilbert(x)))))
return he
评论列表
文章目录