def test_calc_instant_phase2(self): t = np.linspace(0, 1, 50) S = t + np.cos(np.cos(4. * t**2)) emd = EMD() imfs = emd.emd(S, t) vis = Visualisation() phase = vis._calc_inst_phase(imfs, 0.4) assert len(imfs) == len(phase)
def test_calc_instant_phase3(self): t = np.linspace(0, 1, 50) S = t + np.cos(np.cos(4. * t**2)) emd = EMD() imfs = emd.emd(S, t) vis = Visualisation() with self.assertRaises(AssertionError): phase = vis._calc_inst_phase(imfs, 0.8)
def test_calc_instant_phase(self): sig = np.arange(10) vis = Visualisation() phase = vis._calc_inst_phase(sig, None) assert len(sig) == len(phase)