def test_qshift_odd_len_input_2(): h0a, h0b, g0a, g0b, h1a, h1b, g1a, g1b = qshift('qshift_d') y = colifilt(mandrill, h1a[1:-1], h1b[1:-1]) z = colifilt_gold(mandrill, h1a[1:-1], h1b[1:-1]) assert_almost_equal(y, z)
def test_non_orthogonal_input_non_mult_4(): Y = colifilt(mandrill, (1,0,0,1), (1,0,0,1)) assert Y.shape == (mandrill.shape[0]*2, mandrill.shape[1]) Z = colifilt_gold(mandrill, (1,0,0,1), (1,0,0,1)) assert_almost_equal(Y,Z)
def test_qshift(): h0a, h0b, g0a, g0b, h1a, h1b, g1a, g1b = qshift('qshift_d') y = colifilt(mandrill, h1b, h1b) z = colifilt_gold(mandrill, h1b, h1a) assert_almost_equal(y, z)
def test_output_size_non_mult_4(): Y = colifilt(mandrill, (-1,0,0,1), (1,0,0,-1)) assert Y.shape == (mandrill.shape[0]*2, mandrill.shape[1]) Z = colifilt_gold(mandrill, (-1,0,0,1), (1,0,0,-1)) assert_almost_equal(Y,Z)
def test_good_input_size(): Y = colifilt(mandrill[:,:511], (-1,1), (1,-1)) Z = colifilt_gold(mandrill[:,:511], (-1,1), (1,-1)) assert_almost_equal(Y,Z)
def test_qshift_even_input(): h1b = np.array((-0.25, 0.5, 0.5, -0.25)) h1a = h1b[::-1] y = colifilt(mandrill, h1b, h1a) z = colifilt_gold(mandrill, h1b, h1a) assert_almost_equal(y, z)
def test_non_orthogonal_input_non_mult_4(): Y = colifilt(lena, (1,0,0,1), (1,0,0,1)) assert Y.shape == (lena.shape[0]*2, lena.shape[1]) Z = colifilt_gold(lena, (1,0,0,1), (1,0,0,1)) assert_almost_equal(Y,Z)
def test_output_size_non_mult_4(): Y = colifilt(lena, (-1,0,0,1), (1,0,0,-1)) assert Y.shape == (lena.shape[0]*2, lena.shape[1]) Z = colifilt_gold(lena, (-1,0,0,1), (1,0,0,-1)) assert_almost_equal(Y,Z)