Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_preemphasis():
for dtype in [np.float32, np.float64]:
np.random.seed(1234)
x = np.random.rand(16000 * 5).astype(dtype)
y = preemphasis(x, 0.97)
assert x.shape == y.shape
assert x.dtype == y.dtype
x_hat = inv_preemphasis(y, 0.97)
assert x_hat.dtype == x.dtype
assert np.allclose(x_hat, x, atol=1e-5)
x = np.random.rand(16000)
assert np.allclose(P.preemphasis(x, 0), x)
assert np.allclose(P.inv_preemphasis(P.preemphasis(x, 0), 0), x)
def test_preemphasis():
for dtype in [np.float32, np.float64]:
np.random.seed(1234)
x = np.random.rand(16000 * 5).astype(dtype)
y = preemphasis(x, 0.97)
assert x.shape == y.shape
assert x.dtype == y.dtype
x_hat = inv_preemphasis(y, 0.97)
assert x_hat.dtype == x.dtype
assert np.allclose(x_hat, x, atol=1e-5)
x = np.random.rand(16000)
assert np.allclose(P.preemphasis(x, 0), x)
assert np.allclose(P.inv_preemphasis(P.preemphasis(x, 0), 0), x)
def preemphasis(x):
from nnmnkwii.preprocessing import preemphasis
return preemphasis(x, hparams.preemphasis)
def preemphasis(x):
from nnmnkwii.preprocessing import preemphasis
return preemphasis(x, hparams.preemphasis)
def preemphasis(x):
from nnmnkwii.preprocessing import preemphasis
return preemphasis(x, hparams.preemphasis)
def preemphasis(x):
from nnmnkwii.preprocessing import preemphasis
return preemphasis(x, hparams.preemphasis)
def preemphasis(x):
from nnmnkwii.preprocessing import preemphasis
return preemphasis(x, hparams.preemphasis)