'Test equivalence between sosfiltfilt and filtfilt'

def test_equivalence(self):

    x = np.random.RandomState(0).randn(1000)
    for order in range(1, 6):
        zpk = signal.butter(order, 0.35, output='zpk')
        (b, a) = zpk2tf(*zpk)
        sos = zpk2sos(*zpk)
        y = filtfilt(b, a, x)
        y_sos = sosfiltfilt(sos, x)
        assert_allclose(y, y_sos, atol=1e-12, err_msg=('order=%s' % order))
