Error message wording when n_fft is larger than length of the input
See original GitHub issueBEFORE POSTING A BUG REPORT Please look through existing issues (both open and closed) to see if it’s already been reported or fixed!
Describe the bug
The error/warning message when n_fft
is larger than the length of the input seems to be the wrong way around. Currently, I get
n_fft=2048 is too small for input signal of length=512
. Shouldn’t it be n_fft=2048 is too *large* for input signal of length=512
?
To Reproduce
import librosa
y = librosa.tone(220, length=512)
librosa.stft(y, center=False)
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Software versions* INSTALLED VERSIONS
python: 3.8.3 (default, Jul 2 2020, 16:21:59) [GCC 7.3.0]
librosa: 0.8.0
audioread: 2.1.8 numpy: 1.19.1 scipy: 1.5.2 sklearn: 0.23.1 joblib: 0.16.0 decorator: 4.4.2 soundfile: 0.10.3 resampy: 0.2.2 numba: 0.50.1
numpydoc: None sphinx: None sphinx_rtd_theme: None sphinxcontrib.versioning: None sphinx-gallery: None pytest: None pytest-mpl: None pytest-cov: None matplotlib: 3.3.0 presets: None
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top GitHub Comments
@miltonG-isla, @bneslyn21 This is issue is just about the wording of the error message. The actual code (including the > sign) is doing the correct thing and shouldn’t be changed.
If you want to get rid of the error you should either use a smaller value for
n_ftt
or pad your input.Ah good catch. I think this is purely cosmetic (the behavior is correct, but the description is wrong). But we should fix it for the next release.