librosa.util.normalize doesn't preserve dtype
See original GitHub issueIn [1]: import librosa
In [2]: y, sr = librosa.load(librosa.util.example_audio_file())
In [3]: y.dtype
Out[3]: dtype('float32')
In [4]: y = librosa.util.normalize(y)
In [5]: y.dtype
Out[5]: dtype('float64')
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
librosa.util.normalize — librosa 0.10.0.dev0 documentation
Only the columns (or rows) with norm at least threshold are normalized. By default, the threshold is determined from the numerical precision of...
Read more >librosa does not normalize wave file between [-1, 1]
The behaviour you are observing stems directly from resampling to 22050 Hz that librosa load does by default: librosa.core.load(path, ...
Read more >Source code for librosa.util.utils
Or its second dimension >>> librosa.util.pad_center(data, 7, ... if fill is True: raise ParameterError('Cannot normalize with norm=0 and fill=True') length ...
Read more >torchaudio.transforms - PyTorch
https://librosa.org/doc/latest/generated/librosa.amplitude_to_db.html ... functional form will retain higher precision, but run slower because it does not ...
Read more >librosa Changelog - PyUp.io
PyUp actively tracks 474,986 Python packages for vulnerabilities to keep your Python ... `librosa.util.example_audio_file` is now deprecated in favor of ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed by merging #636
IMO dtype should be preserved, but not forced to be float32. It should be enough to just get rid of
.astype(np.float)
as np.abs will preserve dtype as expected AFAIK.E.g.