NAL-NL2 with Offline fitting tool

Post Reply
TeddyHuang
Posts: 3
Joined: Mon May 27, 2024 4:05 am

NAL-NL2 with Offline fitting tool

Post by TeddyHuang » Wed Jun 26, 2024 3:57 pm

Hi,

I'm trying to integrate some examples of NAL-NL2 in the Offline fitting tool but have encountered some issues. I hope someone can help me.

Here are the steps I followed:

1) I used examples
/01-dynamic-compression/1speaker_diffNoise_2ch.wav
as my input audio file.
2) I used 94 dB as the acoustic input level in dB SPL.
3) I simulated an audiogram with the following values: [20, 30, 40, 50, 60, 70, 80, 80, 80] for [250, 500, 1k, 1.5k, 2k, 3k, 4k, 6k, 8k] Hz.
4) Then I applied NAL-NL2 as the gain amplification strategy and created the first fit.
5) I used the default values of the first fit without making any manual adjustments.
6) I saved the file and exited the fitting tool.
7) When I played the saved wav file, I couldn't hear any sound. Based on the description in a related topic, I amplified the output sound file by 50 dB and could hear the sound (I'm not sure if this step was correct).
8)The sound that played back had severe mechanical noise and sounded very unpleasant and strange, almost like distorted mechanical noise. I tested multiple audio files that I prepared myself and repeated steps 1 to 7, all resulting in the same issue.

These are my steps and the problem I'm facing (step 8). I expected that using the NAL-NL2 strategy would produce good amplification results since many hearing aids on the market still frequently use NAL-NL2 as a fitting rule. I don't know how to solve the issue I'm encountering, and I would greatly appreciate any ideas. Thank you.

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

On judging quality of sound compressed for high hearing losses

Post by tobiasherzke » Fri Jun 28, 2024 7:54 am

Thank you for providing a detailed description of your processing steps! This makes it possible to reproduce your experience.
TeddyHuang wrote:
Wed Jun 26, 2024 3:57 pm
1) I used examples
/01-dynamic-compression/1speaker_diffNoise_2ch.wav
as my input audio file.
2) I used 94 dB as the acoustic input level in dB SPL.
94 dB SPL peak level is a reasonable estimation for audio file 01-dynamic-compression/1speaker_diffNoise_2ch.wav in my opinion. It puts the sound levels in this file at 71 and 72 dB SPL, which given the lack of strain in the speaker's voice and the addition of noise is within the reasonable range somewhere near 70dB SPL for this sound. Make sure to adjust the peak level to the recording situation for other sound files, the best of course would be to calibrate your recording setup.
3) I simulated an audiogram with the following values: [20, 30, 40, 50, 60, 70, 80, 80, 80] for [250, 500, 1k, 1.5k, 2k, 3k, 4k, 6k, 8k] Hz.
4) Then I applied NAL-NL2 as the gain amplification strategy and created the first fit.
5) I used the default values of the first fit without making any manual adjustments.
6) I saved the file and exited the fitting tool.
7) When I played the saved wav file, I couldn't hear any sound. Based on the description in a related topic, I amplified the output sound file by 50 dB and could hear the sound (I'm not sure if this step was correct).
You may be referring to viewtopic.php?t=162#p398. The offline fitting tool informs about the added headroom for amplification in this screen:
OutputPeaklevelInfo.png
OutputPeaklevelInfo.png (49.99 KiB) Viewed 21098 times
When I repeat your steps, then I find that If I amplify the output file by 50dB, then a few samples get clipped. You should not amplify output files by 50 dB without checking for clipping.

If I want to play back unprocessed and processed files through headphones with the same settings, then I would amplify the processed sound by 45 dB and attenuate the unprocessed sound by 5 dB, and then adjust an analogue amplifier so that the unprocessed sound is actually played back at your chosen 71-72 dB SPL. The processed sound will then play at 81dB SPL.
8)The sound that played back had severe mechanical noise and sounded very unpleasant and strange, almost like distorted mechanical noise. I tested multiple audio files that I prepared myself and repeated steps 1 to 7, all resulting in the same issue.

These are my steps and the problem I'm facing (step 8). I expected that using the NAL-NL2 strategy would produce good amplification results since many hearing aids on the market still frequently use NAL-NL2 as a fitting rule. I don't know how to solve the issue I'm encountering, and I would greatly appreciate any ideas. Thank you.
If I play back the unprocessed sound followed by the processed sound at your chosen levels with the proposed method above(-5,+45,analogue amplifier), then the processed sound sounds annoyingly loud and annoyingly shrill, yes. The few clipped samples from your +50dB would make the processed sound more annoying, but in this case not by much because there are only so few clipped samples here.

However, I do have that hearing loss that the audiogram you gave describes, and you probably do not suffer from it either. Only people who actually have that hearing loss are the ones who should rate the quality of the processed sound, not you or me. Of course it sounds bad to us. The processing amplifies high frequencies for people who have 80dB HL thresholds at those high frequencies, therefore it must sound bad to us.

TeddyHuang
Posts: 3
Joined: Mon May 27, 2024 4:05 am

Re: On judging quality of sound compressed for high hearing losses

Post by TeddyHuang » Tue Jul 02, 2024 5:27 pm

tobiasherzke wrote:
Fri Jun 28, 2024 7:54 am
Thank you for providing a detailed description of your processing steps! This makes it possible to reproduce your experience.
TeddyHuang wrote:
Wed Jun 26, 2024 3:57 pm
1) I used examples
/01-dynamic-compression/1speaker_diffNoise_2ch.wav
as my input audio file.
2) I used 94 dB as the acoustic input level in dB SPL.
94 dB SPL peak level is a reasonable estimation for audio file 01-dynamic-compression/1speaker_diffNoise_2ch.wav in my opinion. It puts the sound levels in this file at 71 and 72 dB SPL, which given the lack of strain in the speaker's voice and the addition of noise is within the reasonable range somewhere near 70dB SPL for this sound. Make sure to adjust the peak level to the recording situation for other sound files, the best of course would be to calibrate your recording setup.
3) I simulated an audiogram with the following values: [20, 30, 40, 50, 60, 70, 80, 80, 80] for [250, 500, 1k, 1.5k, 2k, 3k, 4k, 6k, 8k] Hz.
4) Then I applied NAL-NL2 as the gain amplification strategy and created the first fit.
5) I used the default values of the first fit without making any manual adjustments.
6) I saved the file and exited the fitting tool.
7) When I played the saved wav file, I couldn't hear any sound. Based on the description in a related topic, I amplified the output sound file by 50 dB and could hear the sound (I'm not sure if this step was correct).
You may be referring to viewtopic.php?t=162#p398. The offline fitting tool informs about the added headroom for amplification in this screen:
OutputPeaklevelInfo.png

When I repeat your steps, then I find that If I amplify the output file by 50dB, then a few samples get clipped. You should not amplify output files by 50 dB without checking for clipping.

If I want to play back unprocessed and processed files through headphones with the same settings, then I would amplify the processed sound by 45 dB and attenuate the unprocessed sound by 5 dB, and then adjust an analogue amplifier so that the unprocessed sound is actually played back at your chosen 71-72 dB SPL. The processed sound will then play at 81dB SPL.
8)The sound that played back had severe mechanical noise and sounded very unpleasant and strange, almost like distorted mechanical noise. I tested multiple audio files that I prepared myself and repeated steps 1 to 7, all resulting in the same issue.

These are my steps and the problem I'm facing (step 8). I expected that using the NAL-NL2 strategy would produce good amplification results since many hearing aids on the market still frequently use NAL-NL2 as a fitting rule. I don't know how to solve the issue I'm encountering, and I would greatly appreciate any ideas. Thank you.
If I play back the unprocessed sound followed by the processed sound at your chosen levels with the proposed method above(-5,+45,analogue amplifier), then the processed sound sounds annoyingly loud and annoyingly shrill, yes. The few clipped samples from your +50dB would make the processed sound more annoying, but in this case not by much because there are only so few clipped samples here.

However, I do have that hearing loss that the audiogram you gave describes, and you probably do not suffer from it either. Only people who actually have that hearing loss are the ones who should rate the quality of the processed sound, not you or me. Of course it sounds bad to us. The processing amplifies high frequencies for people who have 80dB HL thresholds at those high frequencies, therefore it must sound bad to us.


First, thank you for your clear response; it means a lot to beginners.

After reading your guidance, I think my questions can be simplified into two directions:

1) How can I set the input SPL peak level? I mean, if I only have a wav audio file (downloaded from the internet or obtained from anywhere), how can I estimate the input SPL peak level? Is there any preprocessing I can do to normalize or effectively estimate it?

2) Regarding post-processing, how should I select the gain value? For example, how did you choose to amplify by -5 or +45 dB as you mentioned? If I am performing automated batch processing (e.g., calculating the amplification for 1000 audio files using NAL-NL2), how can I select or calculate an appropriate post-processing gain?

Looking forward to your reply or any suggestions. Thank you again!

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

Determining available headroom in sound files

Post by tobiasherzke » Sun Jul 07, 2024 6:52 pm

TeddyHuang wrote:
Tue Jul 02, 2024 5:27 pm
2) Regarding post-processing, how should I select the gain value? For example, how did you choose to amplify by -5 or +45 dB as you mentioned? If I am performing automated batch processing (e.g., calculating the amplification for 1000 audio files using NAL-NL2), how can I select or calculate an appropriate post-processing gain?
I'll start with this question. I had saved your example audiogram under a client ID of HH000101 and have chosen /tmp as my output directory. The processed sound was then stored in /tmp/HH000101/1speaker_diffNoise_2ch.wav. In order to determine the available amplification headroom without clipping, I can detect the maximum sample magnitude in this file using Matlab or Octave:

signal=audioread('/tmp/HH000101/1speaker_diffNoise_2ch.wav');
peak = max(max(abs(signal)))
peaklevel = 20*log10(peak)

For your example, the peak magnitude is peak=4.3969e-03 and therefore the peaklevel=-47.137 dB re full scale.

You can amplify the sound in this file by 47.13...dB without clipping, which corresponds to a linear factor of 1/peak.

If you have multiple sound files that you want to play back using the same sound card settings, amplify all be the minimum headroom that you find over all output files.

For simplicity I did not write 47.13 dB in my previous post but 45 dB. If you want to also playback the unprocessed files with the same sound card settings, then attenuate the unprocessed file by 50dB minus your common amplification of processed files in dB.

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

Estimating physical sound level from sound recording with unknown calibration setup (difficult to impossible)

Post by tobiasherzke » Mon Jul 08, 2024 12:21 pm

TeddyHuang wrote:
Tue Jul 02, 2024 5:27 pm
1) How can I set the input SPL peak level? I mean, if I only have a wav audio file (downloaded from the internet or obtained from anywhere), how can I estimate the input SPL peak level? Is there any preprocessing I can do to normalize or effectively estimate it?
Typical hearing aid processing uses multi-band dynamic compression. Sound is amplified differently depending on input level and frequency. Both typically vary over time, therefore the amplification also varies over time.

A hearing aid will therefore process the same sound differently if you present it once at e.g. 65 dB SPL and once at e.g. 80 dB. This is why it is important to know the sound level of the sound that you want to process with a hearing aid simulation.

Estimating the sound level of a sound recording where you do not know the sound level is very difficult and may be impossible. I do not know of an automated procedure which can achieve this.

The best way to avoid this is to record the sounds that you want to process yourself with a calibrated recording setup. Then you know the peak level that the offline fitting tool asks of you.

An alternative would be to guess the sound level, but this will always be inaccurate. You can look up typical sound levels for different situation, like conversation in quiet room, traffic noise on busy street, etc. Classifying your sound and then looking up typical level for it can give you a first hint but is also insufficient in my opinion.

Another alternative would be to perform an experiment with a sufficient number of normal hearing listeners. Play the sound for them in a calibrated lab setting, give them a volume control, and ask them to adjust the volume of the sound until its loudness sounds natural. Then average over their settings.

Post Reply