Problem with spectral_bandwidth having only one frame
See original GitHub issueHello folks,
I try to use the librosa library for some library I want to implement, which essentially extracts some features from audio files. These files can be very short (including only one frame when transforming it with say stft)
So I stumpled about some unexpected behaviour when using the spectral_bandwith feature.
Let S be some spectrogram (S[bins][frames]) then the following calls will produce (for me) unexpected output:
res_expected_1 = spectral_bandwidth(sr=sr, S=S)
res_expected_2 = spectral_bandwidth(sr=sr, S=S[:,0:2])
res_unexpected = spectral_bandwidth(sr=sr, S=S[:,0:1])
Expected results return for each frame a number. So for res_expected_2 exactly 2 and for res_expected_1 exactly len(S[0]) while res_unexpected produces bin_num results. Which I don’t think is what it is intented to do.
in addition I don’t know why the results are wrapped in an array like [[frames]] instead of just [frames]
I hope someone can help me out a bit; Thanks for your time meanwhile
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@bmcfee I don’t know exactly what I did, but that fixed for me 😉
Cool, glad it’s working for you.
I think we’ll need a slightly more general solution to handle the instantaneous frequency case properly, but it’ll for sure make it into the next point release.