sony / nnabla

Neural Network Libraries
https://nnabla.org/
Apache License 2.0
2.73k stars 334 forks source link

Bring back stft test, and remove version limit of librosa #1195

Closed TomonobuTsujikawa closed 1 year ago

TomonobuTsujikawa commented 1 year ago

This PR is to resolve stft/istft test failures, skipped by https://github.com/sony/nnabla/pull/1193 .

Start from librosa 0.10.0, its stft implementation introduced some changes that may break existing testing cases of nnabla. There seems to be an ongoing discussion on STFT inconsistencies regarding tf.signal.stft, torch.stft, librosa.stft and scipy.signal.stft. But in this PR, we slightly changed one of our stft test parameter that could workaround the problem.

By the way, nnabla test case passes window_type=rectangular directly to librosa.stft, but according to this document:

_window: string, tuple, number, function, or np.ndarray [shape=(n_fft,)] Either: a window specification (string, tuple, or number); see scipy.signal.get_window a window function, such as scipy.signal.windows.hann a vector or array of length nfft Defaults to a raised cosine window (‘hann’), which is adequate for most applications in audio signal processing.

And, refered to scipy document, rectangular should be boxcar, so it's also changed in this PR.

TomonobuTsujikawa commented 1 year ago

This PR solves this issue again: https://github.com/sony/nnabla-ext-cuda/issues/413