@parameterized.parameters(itertools.product((4000,), (256,), (np.float32, np.float64), ('ortho', None), ('vorbis', 'kaiser_bessel_derived', None), (False, True)))
def test_mdct_round_trip(self, signal_length, frame_length, np_rtype, norm, window_type, pad_end):
    if (np_rtype == np.float32):
        tol = 1e-05
    elif (window_type == 'kaiser_bessel_derived'):
        tol = 1e-06
    else:
        tol = 1e-08
    signal = np.random.normal(size=signal_length).astype(np_rtype)
    if (window_type == 'vorbis'):
        window_fn = window_ops.vorbis_window
    elif (window_type == 'kaiser_bessel_derived'):
        window_fn = window_ops.kaiser_bessel_derived_window
    elif (window_type is None):
        window_fn = None
    mdct = spectral_ops.mdct(signal, frame_length, norm=norm, window_fn=window_fn, pad_end=pad_end)
    inverse_mdct = spectral_ops.inverse_mdct(mdct, norm=norm, window_fn=window_fn)
    inverse_mdct = self.evaluate(inverse_mdct)
    min_length = np.minimum(signal.shape[0], inverse_mdct.shape[0])
    half_len = (frame_length // 2)
    signal = signal[half_len:(min_length - half_len)]
    inverse_mdct = inverse_mdct[half_len:(min_length - half_len)]
    self.assertAllClose(inverse_mdct, signal, atol=tol, rtol=tol)
@parameterized.parameters(itertools.product((4000,), (256,), (np.float32, np.float64), ('ortho', None), ('vorbis', 'kaiser_bessel_derived', None), (False, True)))
def test_mdct_round_trip(self, signal_length, frame_length, np_rtype, norm, window_type, pad_end):
    if (np_rtype == np.float32):
        tol = 1e-05
    elif (window_type == 'kaiser_bessel_derived'):
        tol = 1e-06
    else:
        tol = 1e-08
    signal = np.random.normal(size=signal_length).astype(np_rtype)
    if (window_type == 'vorbis'):
        window_fn = window_ops.vorbis_window
    elif (window_type == 'kaiser_bessel_derived'):
        window_fn = window_ops.kaiser_bessel_derived_window
    elif (window_type is None):
        window_fn = None
    mdct = spectral_ops.mdct(signal, frame_length, norm=norm, window_fn=window_fn, pad_end=pad_end)
    inverse_mdct = spectral_ops.inverse_mdct(mdct, norm=norm, window_fn=window_fn)
    inverse_mdct = self.evaluate(inverse_mdct)
    min_length = np.minimum(signal.shape[0], inverse_mdct.shape[0])
    half_len = (frame_length // 2)
    signal = signal[half_len:(min_length - half_len)]
    inverse_mdct = inverse_mdct[half_len:(min_length - half_len)]
    self.assertAllClose(inverse_mdct, signal, atol=tol, rtol=tol)