예제 #1
0
파일: test_eemd.py 프로젝트: zhmxtr/PyEMD
    def test_imfs_and_residue_accessor(self):
        S = np.random.random(100)
        eemd = EEMD(trials=5, max_imf=2, parallel=False)
        eIMFs = eemd(S)

        imfs, residue = eemd.get_imfs_and_residue()
        self.assertEqual(eIMFs.shape[0], imfs.shape[0],
                         "Compare number of components")
        self.assertEqual(len(residue), 100, "Check if residue exists")
예제 #2
0
    def extract_imfs(self, signal):
        eemd = EEMD()
        eemd.eemd(signal)
        res = eemd.get_imfs_and_residue()
        imfs = list(res)[0]
        # drop the noise/ high frequency imfs, may incur index error due to the signal is too simple
        imfs_left = imfs[-1:]

        return imfs_left # np.array type
예제 #3
0
파일: test_eemd.py 프로젝트: zhmxtr/PyEMD
 def test_imfs_and_residue_accessor2(self):
     eemd = EEMD()
     with self.assertRaises(ValueError):
         imfs, residue = eemd.get_imfs_and_residue()