Hearing Aid: Connecting Teensy 4.1 + Audio Shield rev D, etc

DanGo

Member
Hello all! I'm new to the board and to working with Teensy boards (or any electronics, honestly), though I've been an audio engineer and recording songwriter for about four decades now (gulp! where did the time go?). I'm working on a middle-of-project prototype for a new affordable OTC hearing aid and am trying out the Teensy to house code I've already gotten to work on an iPhone. I've purchased the following elements and what I'm having trouble with is figuring out how to solder each part to the other! The overview of the hardware is a pair of Teensy 4.1's configured with Audio Shield rev D and one SparkFun Analog MEMS microphone breakout (possibly two in the future) wired to the Audio Shield (long wire to mount on some IEM earbuds). I am also planning to attach an Adafruit Bluefruit LE SPI Friend (so I can control the hardware with iPhone software), and an Adafruit PowerBoost 1000 Charger, attached to a Lithium Ion battery and controlled with a SPDT slide switch. I realize that mixing two or more makers' products in a complex project when you're a rank amateur is a recipe for confusion at best, but I'm hoping one of you kind souls might point me in the right direction for figuring out which points to connect to which... If this all works out, the next step will be putting all of this inside IEM ear buds! Yikes! Many thanks in advance for any illumination you can provide!

Best,
Dan
 
I would go with a board that already has all of that—or at least most of it—built in. That saves a lot of time and tinkering.
I'm not sure if there's anything available with Teensy or ARM, but there are alternatives with other CPUs that already have Bluetooth (and Wi-Fi) built in. You can also find boards with two additional MEMS mics and an audio output.
 
I appreciate that, but I’ve already purchased all the parts. The good news is that I’ve begun to figure out how to attach them together and have tested parts: they’re working! Bonus: in practicing soldering before touching the Teensy boards, I managed to fix two old guitar patch cords! Saved myself about $50! Excited about that…
 
You might consider the Tympan, whose whole purpose is to be a platform for developing hearing aids.


For hardware, it includes all the capabilities that you're describing: including a better audio codec than the Teensy Audio shield, mems mics, and Bluetooth.

It's got an Arduino library with a lot of examples, including wide dynamic range compression (direct from audiologic researchers).


If you're not interested in the hardware, you might a least check out the algorithms in the examples. They'd likely be useful in accelerating your work.

Be aware that once you're using enough gain to overcome a meaningful amount of hearing loss, a system based on the Teensy Audio Shield will be very noisy. Even the better AIC on the Tympan can get noisy. I highly recommend using digital mics, whether I2S mics directly to the microcontroller or PDM mics via the PDM inputs on an AIC. The digital mics will have less self noise.

Noise of Teensy board and Tympan: https://openaudio.blogspot.com/2017/03/tympan-self-noise.html

Chip
(Part of the Tympan team)
 
Last edited:
OpenMHA and PHA could be also helpful to look at:



Runs on a Raspberry Pi or Beaglebone.


I think you can learn a lot and have much fun with such a project. Being realistic I have to ask what the exact goal can be for "affordable OTC hearing aid". The (US) market is full a many devices in a huge range of prices. With Apple Airpods Pro 2 or 3 and now with Samsung Earbuds coming there are devices with so much functionality (already without the hearing support functionality), performance (noise suppression, beamformer...) and affordability that it is hard to develop something which comes even close to that.
 
Not directly to help with getting the project going - looks like you've got enough of that already - but a request from an experienced Front-of-House Mixing Engineer:

The amount of gain that you need to overcome some people's hearing loss - acoustic-to-acoustic regardless of how you do it - can easily result in feedback at frequencies that they can't hear at all...but I can! All the way from the front row to the booth!

PLEASE include a mechanism to "give up" on things that they're never going to hear anyway, so I don't have to put another layer on top of what I'm already doing and effectively make the entire show compensate for a chronically misbehaving hearing aid. Thank you!

Or, as the case may be, detect a poor fit in their ears that doesn't block enough to prevent feedback, and either "give up" or "dial back" then. Same goal.
 
You might consider the Tympan, whose whole purpose is to be a platform for developing hearing aids.


For hardware, it includes all the capabilities that you're describing: including a better audio codec than the Teensy Audio shield, mems mics, and Bluetooth.

It's got an Arduino library with a lot of examples, including wide dynamic range compression (direct from audiologic researchers).


If you're not interested in the hardware, you might a least check out the algorithms in the examples. They'd likely be useful in accelerating your work.

Be aware that once you're using enough gain to overcome a meaningful amount of hearing loss, a system based on the Teensy Audio Shield will be very noisy. Even the better AIC on the Tympan can get noisy. I highly recommend using digital mics, whether I2S mics directly to the microcontroller or PDM mics via the PDM inputs on an AIC. The digital mics will have less self noise.

Noise of Teensy board and Tympan: https://openaudio.blogspot.com/2017/03/tympan-self-noise.html

Chip
(Part of the Tympan team)
Hi Chip! Good to hear from you! I originally was hoping to get a couple of Tympans to test my software processing ideas, but your website said they were out of stock. I emailed to inquire about them, but never heard back. The Rev F still appears to be out of stock. That said, I've already purchased all the parts and am soldering things together--and while it's possible yours is higher quality, the Teensy and audio shield are much cheaper--I was reluctant to test all this first on two boards that together, would cost twice as much as what I paid. Depending on how all this goes, I might end up wanting a Tympan. When will they be back in stock?
 
OpenMHA and PHA could be also helpful to look at:



Runs on a Raspberry Pi or Beaglebone.


I think you can learn a lot and have much fun with such a project. Being realistic I have to ask what the exact goal can be for "affordable OTC hearing aid". The (US) market is full a many devices in a huge range of prices. With Apple Airpods Pro 2 or 3 and now with Samsung Earbuds coming there are devices with so much functionality (already without the hearing support functionality), performance (noise suppression, beamformer...) and affordability that it is hard to develop something which comes even close to that.
Hi Tom, Ah, realism! ;-D. You have to be a little pie-in-the-sky to try something like this, but I'm generally pretty bold about such ventures (even if I'm financially cautious about investing too much at once. Airpods Pro and Samsung Earbuds are, yes, serious competition for my idea, but I am coming at this with 40 years of audio engineering and mastering skills and I feel confident that what I'm doing is different from their products in a significant enough way that I can carve out a niche. Their marketing muscle is another question, but there are ways to David and Goliath this situation. The significant thing here is that I have never seen a hearing aid designed without trying to subsitute technology for what the human brain already does, nor have I heard about hearing aids that truly take into account our desire to hear in a natural and transparent way. It's possible I will hit a wall and this won't work, but I haven't hit one yet... I'm not usually one to be arrogant, but these ideas of mine have been testing well. The Teensy will be the next test in a long series of prototypes...
 
Not directly to help with getting the project going - looks like you've got enough of that already - but a request from an experienced Front-of-House Mixing Engineer:

The amount of gain that you need to overcome some people's hearing loss - acoustic-to-acoustic regardless of how you do it - can easily result in feedback at frequencies that they can't hear at all...but I can! All the way from the front row to the booth!

PLEASE include a mechanism to "give up" on things that they're never going to hear anyway, so I don't have to put another layer on top of what I'm already doing and effectively make the entire show compensate for a chronically misbehaving hearing aid. Thank you!

Or, as the case may be, detect a poor fit in their ears that doesn't block enough to prevent feedback, and either "give up" or "dial back" then. Same goal.
Hi Aaron, I'm not 100% sure I'm following, but it seems that in your FOH mixing, you're hearing lots of squealing feedback from hearing aids?? I'm assuming you're not running metal shows? How are hearing aids louder than what you're pumping out of the monitors? At any rate, feedback suppression is going to be a crucial part of this system (though it'll be nearly impossible to do well in this particular prototype, because of the size of the mics--MEMS mics). My plan is to design hearing aids that are nearly foolproof for users to insert and that don't follow the typical bean to in-ear-canal via thin wire design. Though I'm not hard of hearing, I've tried those and they're horrible. Like having somebody stage whisper in your ear.
 
Hi Aaron, I'm not 100% sure I'm following, but it seems that in your FOH mixing, you're hearing lots of squealing feedback from hearing aids?? I'm assuming you're not running metal shows? How are hearing aids louder than what you're pumping out of the monitors?
Yeah, a metal show would easily drown that out. The problem comes up in much tamer things, like a folk band, or a single speaker that no longer has to yell to the back row.

For those, the PA tends to not consider acoustic feedback quite as seriously, and so it's more likely to do that than for a metal concert. Which means that even though I'm about 30dB softer than a metal concert, I'm *still* on the edge of feedback and I'm constantly listening for it. And then a hearing aid in the audience, does...

At any rate, feedback suppression is going to be a crucial part of this system (though it'll be nearly impossible to do well in this particular prototype, because of the size of the mics--MEMS mics). My plan is to design hearing aids that are nearly foolproof for users to insert and that don't follow the typical bean to in-ear-canal via thin wire design.
That would be awesome! Lofty goal, considering what already exists and still has those problems, but if you can do it, I think both the users and lots of show crews would love it!

Like having somebody stage whisper in your ear.
Yeah that'd be annoying! Though considering that they're only meant to fill in what's missing, and that's typically just the highest frequencies, it's understandable that they would do that. "Stage whisper" is just the top end and not much else, and that's exactly what most hearing aids are *meant* to do, because everything else is still there and doesn't need to be added to.

I have never seen a hearing aid designed without trying to subsitute technology for what the human brain already does...
I've mentioned in a different thread but not here yet, that I have a project on-hold for other reasons that includes what is essentially a hearing aid by a different name. Mics in a character's ears, headphones or earbuds for the performer, and DSP in between. I'm intentionally making no attempt to do anything except for corrective EQ (makes the character design a lot easier, to not have to think about its effect as an acoustic EQ), protective limiting, and a highpass filter to not add to what gets through anyway. I'm just going to measure most of that when the time comes, instead of trying to model it...

No connection at all between ears: separate stereo all the way through, as if the actor's ears are simply moved to where the character has them, and the actor's brain takes it from there.

I'm not using a Teensy for this, because its audio library is hard-coded for lesser specs than what I need, and I'm not going to rewrite the USB stack!

96kHz, solely for the converters' latency. Compared to 44.1 or 48kHz, which is more than adequate for a live stage, 96k allows them to use a more gradual filter in the converter chip itself that has fewer samples of latency, in addition to less time per sample, and thus hopefully line up with a short acoustic path around the entire system. I thought about 192k for even more of the same reason, but for what *I'm* doing, I don't think I need it *that* short, and the DSP still has to keep up! (clocks per sample...)

And of course, the DSP code takes a single sample all the way through and out before grabbing the next (no buffer, like some easy-to-use DSP chips have), just so it doesn't balloon the latency that I got rid of from the converters. If the DSP has a buffer, then there's no point at all in running faster than 48k. You're already well past lining up with a short acoustic path.

(USB is only for diagnostics and troubleshooting - what does <this point> in the chain sound like? - and as an eventual sound card for audio recording and injection. The mic-to-speaker path does not use USB at all, and so the USB buffers don't matter for that.)
 
Back
Top