Peak Level Calibration and wavrec Plugin

DirkO
Posts: 1
Joined: Wed Apr 29, 2020 5:51 am

Peak Level Calibration and wavrec Plugin

I have dummy devices connected to the MHA via sound card and want to check, at which level peak clipping kicks in.The peak clipping could be somewhere in the chain, could be from the A/D converters in the soundcard, could be from the microphone in the dummy devices could be from the settings of the MHA. I recorded the signal in the MHA using the wavrec plugin:

Code: Select all

mha.mhachain.algos=[wavrec...
If I use the input calibration

Code: Select all

calib_in.peaklevel=[120 120]
amplitudes of my whistle are low. See attached picture lower two lines:
ScreenShot 544 _ Create Task - Mozilla Firefox.png (58.82 KiB) Viewed 886 times
But the calibration is wrong for my set-up and I have to increase the input peak level to:

Code: Select all

calib_in.peaklevel=[135 135]
The recorded wav file now shows an increased amplitude (+15 dB) of my whistle (upper two rows), what is strange because I increased the peak level and the amplitude of the same sound should be lower. It might be, that the wavrec plugin assumes 1 Pa as Peak value, than I understand what happens. Ifso, this infoirmation is missing in the doucmentation.

1) How can I check with MHA, if peak clipping occurs in the input chain?

I recorded now the direct input signal with audacity and can see, that my whistle is not clipping. But this does not check if my settings in the MHA might cause peak clipping. That's already my solution to check this, although I would prefer a solution, where I am able to check this directly in the MHA.

2) Any ideas how I can check with MHA if peak clipping occurs in the input chain?

Last question: If I configure the MHA to a low calibration value (low mic sensitivity) and add e.g. 20 dB of gain so that a sine with 80 dB SPL input level (full scale) have an amplitude above "1". Will this signal be clipped by the MHA or can the MHA internally process signals with amplitudes larger than 1 dB FS? The output calibration might be sufficient to play back the sine with 100 dB SPL:

Code: Select all

calib_in.peaklevel=[80 80]
calib_out.peaklevel=[120 120]
Thanks,
Dirk

tobiasherzke
Posts: 27
Joined: Mon Jun 24, 2019 12:51 pm

Re: Peak Level Calibration and wavrec Plugin

peaklevels are assigned in plugin transducers. wavrec is a separate plugin and has no knowledge of the peaklevels configured there.

wavrec documentation is minimalistic. It says "wav file recorder".
wavrec stores the audio samples on disk as they are processed inside MHA, without any scaling. The sample data type used in the stored wav file is float32 which allows amplitudes to exceed the [-1;1] range.

MHA uses SI unit Pascal to process sound samples in memory. This is documented in section 1.2.4 of the application manual http://www.openmha.org/docs/openMHA_app ... manual.pdf. Users can use the transducers plugin to calibrate their setup.
1) How can I check with MHA, if peak clipping occurs in the input chain?

I recorded now the direct input signal with audacity and can see, that my whistle is not clipping. But this does not check if my settings in the MHA might cause peak clipping. That's already my solution to check this, although I would prefer a solution, where I am able to check this directly in the MHA.
MHA does not clip unless you want it to (e.g. with the softclipper plugin, or a compressor). The maximum representable amplitude inside MHA is ~10^38 Pascal. Compare to this table: https://en.wikipedia.org/wiki/Sound_pre ... d_pressure

If your sound card is already clipping, then this is not detectable per se. You would need to create a statistic method that detects too many samples at or near maximum/minimum Amplitude for your setting, with your own definition of "too many".