Raspberry Pi Experimenting: Part I

A Raspberry Pi is a neat little, super-affordable computer that has endless potential uses. For less than $100, and without a ton of technical know-how, people can use them to build anything from weather-monitoring stations, to internet radio streamers, to emulators that let you play your favourite old NES or SEGA games. In fact, some people have even tried building a simple hearing aid using a Raspberry Pi (http://uosdesign.org/designshow2016/group-design-project/the-raspberry-pi-hearing-aid/).

the_raspberry_pi_hearing_aid___design_show_2016-2

A BTE hearing aid powered by a Raspberry Pi.

That last project was what really interested me. I never hoped to produce a $100 hearing aid that could compete with anything available on the market, but I thought that this might be a cool way to learn more about how computers work, computer programming, and hearing aid technology. So about a month ago I ordered a Raspberry Pi to play around with, and hopefully eventually build at least a semi-functional hearing aid device.

What I’ve used so far:

  • A Raspberry Pi 3 B. This latest model has built-in WiFi and Bluetooth.
  • A microSD card.
  • A USB microphone.
  • A micro-USB charger, same as my cell phone.
  • An old pair of ear-buds to transmit the sound to my ears.
  • A network cable.
  • Code! I’m no programmer, so for now I’m working with someone else’s hearing aid code (https://github.com/JonnyM94/RaspPiHearingAid)

Now there are ways to set-up a Raspberry Pi that are supposed to be quick and easy, but I didn’t use these methods. They required having a spare HDMI monitor, keyboard, and mouse laying around, which I didn’t have (and the staff at my local library were reluctant to lend me any). So instead, I did what’s called a “Headless” setup. In this method, I had to manually set up the Pi’s SD card, connect it to my router with a cable, and then access the Pi through my own laptop over the internet so I could see the Pi’s “desktop” as a window on my own. None of this should have been particularly difficult, but it took me a long, long time to make my way through each little step. Unfortunately, many of the resources out there assume the reader has a certain level of computer literacy – more than my own at least. Eventually, I made everything work out and had a functional Raspberry Pi.

However, the more difficult parts were yet to come. The Raspberry Pi software includes some of the necessary programs that my code required, but not all of it. So by trial and error, I slowly figured out what I needed, downloaded the incorrect versions, realized my mistakes, and finally had all of the correct software on my Pi to make the code run. To make sure the sound system worked, I ran a quick white noise program I’d found and was feeling pretty good about everything. However, the code for the hearing aid program wasn’t 100% correct so it took some time to figure out what needed to be modified so that it would actually run. Finally, with the deletion of one errant word in line 116 – it worked!

192_168_2_12__raspberrypi__-_vnc_viewer-2

The Raspberry Pi running the hearing aid program.

…and by worked, I mean it… sorta made noise?

In setting everything up, I confirmed that my microphone was capable of recording high quality sound, and my headphones were receiving sound from stored files on the Pi. However, when I put everything together with this program, I only received a harsh clicking noise that followed the relative volume of the voice entering the microphone, but was basically unrecognizable as speech. After all this, I felt only a little disappointed. To be honest I was pretty thrilled to have produced something with any resemblance of functionality at all.

I’m definitely gonna keep puttering away at this project in my spare time and see what I can do. I’ll try and get in touch with the people who built the code I used (and I suspect they may have been the same crew that actually built the hearing aid shown above too). I’m also going to study their code and try to figure out exactly what its doing, and if there’s anything that can be cut out to try and improve the sound quality. However, I may also try to build up my own code. The code I used had a very complicated compression function, but only a single frequency channel. For a project in my undergrad, I experimented building the opposite – 8 frequency bands but little compression – with Praat. Ultimately my limited knowledge and the limited functionality of Praat didn’t allow for any success with that project, but maybe it’ll be easier here.

So that’s where things stand today. Thanks for reading and I hope you’ll continue to follow along with my successes and failures in this project of mine.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s