def run_EMD_encoder(x, samples): emd = EMD(samples) emd.emd(x, None) return emd
inst_phase = self._calc_inst_phase(sig) return np.diff(inst_phase) / (t[1] - t[0]) def show(self): plt.show() if __name__ == "__main__": import numpy as np from EMD import EMD # Simple signal example t = np.arange(0, 3, 0.01) S = np.sin(13 * t + 0.2 * t**1.4) - np.cos(3 * t) emd = EMD() emd.emd(S) imfs, res = emd.get_imfs_and_residue() # Initiate visualisation with emd instance vis = Visualisation(emd) # Create a plot with all IMFs and residue vis.plot_imfs(imfs=imfs, residue=res, t=t, include_residue=True) # Create a plot with instantaneous frequency of all IMFs vis.plot_instant_freq(t, imfs=imfs) # Show both plots vis.show()
inst_phase = self._calc_inst_phase(sig) return np.diff(inst_phase)/(t[1]-t[0]) def show(self): plt.show() if __name__ == "__main__": import numpy as np from EMD import EMD # Simple signal example t = np.arange(0, 3, 0.01) S = np.sin(13*t + 0.2*t**1.4) - np.cos(3*t) emd = EMD() emd.emd(S) imfs, res = emd.get_imfs_and_residue() # Initiate visualisation with emd instance vis = Visualisation(emd) # Create a plot with all IMFs and residue vis.plot_imfs(imfs=imfs, residue=res, t=t, include_residue=True) # Create a plot with instantaneous frequency of all IMFs vis.plot_instant_freq(t, imfs=imfs) # Show both plots vis.show()