Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong y_coords for high sample rates #28

Open
johanez opened this issue Oct 19, 2023 · 2 comments
Open

Wrong y_coords for high sample rates #28

johanez opened this issue Oct 19, 2023 · 2 comments

Comments

@johanez
Copy link
Contributor

johanez commented Oct 19, 2023

I tried using af for audiodata with high sample rates. The resulting spectrograms look correct, however, the y_coords (and underlying fre_band_arr) are not correct. Looks like some too low default is used. Using the high_fre setting does not help.

To reproduce, use e.g. this file: 0170701_213954-MYOMYS-LR_0_0.5.wav with 500 kHz sampling rate.

import audioflux as af
from audioflux.type import SpectralFilterBankScaleType

audio_arr, sr = af.read(
    "20170701_213954-MYOMYS-LR_0_0.5.wav"
)

bft_obj = af.BFT(
    num=128,
    radix2_exp=12,
    samplate=sr,
    scale_type=SpectralFilterBankScaleType.MEL,
    #high_fre=192000, # does not solve the issue

print(sr)
# 500000
print(bft_obj.y_coords()[-1])
# 15948.399 , should be close to 192000 or 250000
print(bft_obj.high_fre)
# 250000 # without high_fre setting, 192 with high_fre setting 

Same issue with files with 384 kHz sr, and also using audioflux.mel_spectrogram

@wtq2255
Copy link
Member

wtq2255 commented Oct 19, 2023

@johanez Our current maximum supported sample rate is 196,000, and we plan to support even higher sample rates in the future. If possible, you can downsample the audio before extracting the Mel spectrogram.

@johanez
Copy link
Contributor Author

johanez commented Oct 20, 2023

Thanks for the quick reply! Good to know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants