Example #1
0
    def test_biorwavf(self):
        wnames = ['bior1.1', 'bior1.3', 'bior1.5', 'bior2.2', 'bior2.4', 'bior2.6',
                       'bior2.8', 'bior3.1', 'bior3.3', 'bior3.5', 'bior3.7', 'bior3.9',
                       'bior4.4', 'bior5.5', 'bior6.8']
        for N in np.arange(len(wnames)):
            Lo_D,Hi_D,Lo_R,Hi_R = pyyawt.wfilters(wnames[N])
            rf,df = pyyawt.biorwavf(wnames[N])
            lo_d,hi_d,lo_r,hi_r = pyyawt.biorfilt(df,rf)
            np.testing.assert_almost_equal(lo_d, Lo_D)
            np.testing.assert_almost_equal(lo_r, Lo_R)
            np.testing.assert_almost_equal(hi_d, Hi_D)
            np.testing.assert_almost_equal(hi_r, Hi_R)

            Lo_D,Hi_D = pyyawt.wfilters(wnames[N],'d')
            Lo_R,Hi_R = pyyawt.wfilters(wnames[N],'r')
            np.testing.assert_almost_equal(lo_d, Lo_D)
            np.testing.assert_almost_equal(lo_r, Lo_R)
            np.testing.assert_almost_equal(hi_d, Hi_D)
            np.testing.assert_almost_equal(hi_r, Hi_R)

            Lo_D,Lo_R = pyyawt.wfilters(wnames[N],'l')
            Hi_D,Hi_R = pyyawt.wfilters(wnames[N],'h')
            np.testing.assert_almost_equal(lo_d, Lo_D)
            np.testing.assert_almost_equal(lo_r, Lo_R)
            np.testing.assert_almost_equal(hi_d, Hi_D)
            np.testing.assert_almost_equal(hi_r, Hi_R)
Example #2
0
 def test_sumOdd(self):
     for N in np.arange(len(self.wnames)):
         RF, DF = pyyawt.biorwavf(self.wnames[N])
         np.testing.assert_almost_equal(np.sum(RF[1::2]),
                                        1. / np.sqrt(2),
                                        decimal=self.accuracy_decimal)
         np.testing.assert_almost_equal(np.sum(DF[1::2]),
                                        1. / np.sqrt(2),
                                        decimal=self.accuracy_decimal)
Example #3
0
    def test_biorwavf(self):
        wnames = [
            "bior1.1",
            "bior1.3",
            "bior1.5",
            "bior2.2",
            "bior2.4",
            "bior2.6",
            "bior2.8",
            "bior3.1",
            "bior3.3",
            "bior3.5",
            "bior3.7",
            "bior3.9",
            "bior4.4",
            "bior5.5",
            "bior6.8",
        ]
        for N in np.arange(len(wnames)):
            Lo_D, Hi_D, Lo_R, Hi_R = pyyawt.wfilters(wnames[N])
            rf, df = pyyawt.biorwavf(wnames[N])
            lo_d, hi_d, lo_r, hi_r = pyyawt.biorfilt(df, rf)
            np.testing.assert_almost_equal(lo_d, Lo_D)
            np.testing.assert_almost_equal(lo_r, Lo_R)
            np.testing.assert_almost_equal(hi_d, Hi_D)
            np.testing.assert_almost_equal(hi_r, Hi_R)

            Lo_D, Hi_D = pyyawt.wfilters(wnames[N], "d")
            Lo_R, Hi_R = pyyawt.wfilters(wnames[N], "r")
            np.testing.assert_almost_equal(lo_d, Lo_D)
            np.testing.assert_almost_equal(lo_r, Lo_R)
            np.testing.assert_almost_equal(hi_d, Hi_D)
            np.testing.assert_almost_equal(hi_r, Hi_R)

            Lo_D, Lo_R = pyyawt.wfilters(wnames[N], "l")
            Hi_D, Hi_R = pyyawt.wfilters(wnames[N], "h")
            np.testing.assert_almost_equal(lo_d, Lo_D)
            np.testing.assert_almost_equal(lo_r, Lo_R)
            np.testing.assert_almost_equal(hi_d, Hi_D)
            np.testing.assert_almost_equal(hi_r, Hi_R)
Example #4
0
 def test_sumOdd(self):
     for N in np.arange(len(self.wnames)):
         RF,DF = pyyawt.biorwavf(self.wnames[N])
         np.testing.assert_almost_equal(np.sum(RF[1::2]), 1./np.sqrt(2), decimal=self.accuracy_decimal)
         np.testing.assert_almost_equal(np.sum(DF[1::2]), 1./np.sqrt(2), decimal=self.accuracy_decimal)