Errors with comp_loudness and comp_sharpness
Hi,
I've got a problem when i want to calculate loudness (or sharpness) with a 44 kHz sampled signal.
I've got this error :
ValueError: operands could not be broadcast together with shapes (64,) (367265,) (64,)
I don't have the problem if i use a short part of the signal
signal=signal[0:1000]
No problem if i use a 48 kHz resampled version of the file
Hi, thanks for the feedback. Actually, as per the ISO standard, the signal shall be sampled at 48 kHz for the loudness/sharpness computation (because some numerical filters are only defined for this specific sampling frequency). But normally the code should be robust to other sampling frequencies, or at least give you a meaningfull feedback. I'll try to have a look and will let you know. I'm very busy in the next days, so I cannot promise it will be quick!
Hi @Alann72, I've finally managed to check the behavior of the loudness and sharpness computation with a 44.1 KHz sampled signal. On my side, it work just fine. I've added a unit test for this feature (it will be soon merged to the repository)
If you are still in trouble maybe you can send me your wav file so that I can have a look.
Hi, I installed mosqito-1.0.8 and tried to compute the loudness of 44.1 kHz sampled signal. I've got below error. There seems to be a still similar trouble.
Enclosed please find a wav file.
File "c:/*** /sound2-0.py", line 88, in
Hi, Sorry for this late answer. As mentionned in the error message, the loudness algorithm, by design, only support sampling frequency equal to 48 kHz. If you have to deal with signals at another sampling frequency, I suggest you to use the MOSQITO load function:
from mosqito.utils import load
sig, fs = load("<path>/arctic_a0001.wav", wav_calib=1)
This way, the signal will be resampled automatically. And you will be able to compute the loudness :
N, N_spec, bark_axis, time_axis = loudness_zwtv(sig, fs, field_type="free")
I tried with your signal and it is working well.
