import numpy as np from scipy.signal import hilbert t = np.linspace(0,1,2048) E0 = 1 fc = 20 phi_c = 0 fm = 2 m = 0.9 phi_m = 0 E = E0*np.cos(fc*2*np.pi*t + phi_c) x = m*np.sin(fm*2*np.pi*t + phi_m) E_m = E0*np.cos(fc*2*np.pi*t + phi_c) \ *(1 - (m/2)*(1-np.sin(fm*2*np.pi*t+phi_m) signal = hilbert(E_m) envelope = np.abs(signal) 6 / 18