From 94dedbe949f2d9771a490eed38b1fa049cd0d252 Mon Sep 17 00:00:00 2001 From: mmoussallam Date: Thu, 18 Jun 2020 20:17:03 +0200 Subject: [PATCH] investigate diff values --- spleeter/separator.py | 2 +- tests/test_separator.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spleeter/separator.py b/spleeter/separator.py index b0b0ff7..0776361 100644 --- a/spleeter/separator.py +++ b/spleeter/separator.py @@ -122,7 +122,7 @@ class Separator(object): assert not (inverse and length is None) data = np.asfortranarray(data) N = self._params["frame_length"] - pad_edges = int(N/4) + pad_edges = int(N/2) H = self._params["frame_step"] win = hann(N, sym=False) fstft = istft if inverse else stft diff --git a/tests/test_separator.py b/tests/test_separator.py index ccfd086..49b416c 100644 --- a/tests/test_separator.py +++ b/tests/test_separator.py @@ -74,9 +74,11 @@ def test_separator_backends(test_file): for instrument in out_lib.keys(): # test that both outputs are not null + print(np.sum(np.abs(out_tf[instrument]))) + print(np.sum(np.abs(out_lib[instrument]))) assert np.sum(np.abs(out_tf[instrument])) > 1000 assert np.sum(np.abs(out_lib[instrument])) > 1000 - assert np.allclose(out_tf[instrument], out_lib[instrument], atol=0.1) + assert np.allclose(out_tf[instrument], out_lib[instrument], atol=0.01) @pytest.mark.parametrize('test_file, configuration, backend', TEST_CONFIGURATIONS)