Project: Ultrasound Dosimeter

ASA Abstract: It is well known that hearing loss can occur from exposure to high intensities of sounds >80 dBA; however there is less information about hearing loss from ultrasonic frequencies. There are many commercial and industrial devices that produce ultrasonic acoustic energy ranging from humidifiers, pest and pet repellent devices, and crowd control devices. Even though there are fewer regulations with regard to ultrasound, there have been documented cases of effects including temporary or permanent threshold shifts from exposure to ultrasonic energy. However, there is not a readily available open source solution for quantifying exposure.
In this work, a TYMPAN open source hearing aid development platform is used to develop and test a prototype ultrasonic dosimeter. This dosimeter works like a SPL meter, with the inclusion of the ultrasonic 1/3 octave bands, with an audible alarm emitted when the user happens to be in the presence of ultrasonic energy. From the full data recording of a test covering various environments, several key features of the exposure are highlighted.
The presentation will cover the development of the algorithms, testing of the device, and post test analysis. Code will be made available via the open source libraries for future users to build upon.

So far, I’ve been able to (I think) calculate a level for the frequencies below a low pass filter cutoff, for comparison to levels above a high pass filter cutoff. At the same time, the output from the highpass filter goes to a frequency shifter so that ultrasonic energy comes into the audio band.

I’m trying to play the frequency shifted ultrasound to the left audio channel and the lowpass filtered (not shifted) to the right audio channel, but I’m not getting anything out on the right. If I switch the output and put the ultrasound to the right it works, so the headphones and connection are working. Is it possible to put out different things to the left and right headphone, or am I chasing down something that fundamentally won’t work?

Here’s a snippet of the audio connections part of the code:
AudioConnection_F32 patchCord10(i2s_in, 0, hp_filt1, 0); //connect the Left input to high pass filter - this is the ultrasound channel
AudioConnection_F32 patchCord20(hp_filt1, 0, calcLevelUltra, 0); //connect the high pass filter to the level time weighting
AudioConnection_F32 patchCord30(i2s_in, 0, freqShift, 0); //use the Left input
AudioConnection_F32 patchCord40(freqShift, 0, gain1, 0); //connect to gain
AudioConnection_F32 patchCord50(gain1, 0, i2s_out, 0); //connect to the left output

AudioConnection_F32 patchCord11(i2s_in, 0, lp_filt1, 0); //connect the right input to low pass filter - this is the regular channel
AudioConnection_F32 patchCord21(lp_filt1, 0, calcLevelFull, 0); //connect the low pass filter to the level time weighting
AudioConnection_F32 patchCord41(calcLevelFull, 0, gain2, 0); //connect to gain
AudioConnection_F32 patchCord52(gain2, 0, i2s_out, 1); //connect in+gain to the right output

Hi jCooper!

Your code looks pretty good, except for patchCord41. Do you really want to come out of the calcLevelFull object? I’m not sure that calcLevelFull outputs any audio, so that might be why it is silent.

Instead, perhaps one of these two is what you meant?

  • AudioConnection_F32 patchCord41(lp_filt1, 0, gain2, 0); //connect to gain

  • AudioConnection_F32 patchCord41(i2s_in, 0, gain2, 0); //connect to gain

Good luck! Post back to let us know how it works out!

Chip

Chip,
Thank you! that was it exactly. If I send lp_filt1 through to the gain, it works just as I’d hoped.