Skip to content

Wrong y_coords for high sample rates #28

Description

@johanez

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions