Noise Canceling Apple Earbuds
I attempted to create noise canceling headphones in software from Apple’s stock earbuds.
TLDR; It did not work #
The theory to this concept is simple, but relies on a prerequisite understanding of how noise canceling is implemented. I’m focusing on the challenge at a high-level, but explain what went wrong and offer some suggestions for how Apple can probably implement this.
This is a five step overview of how to implement noise cancellation.
- Start with a live ambient noise that will be captured by the ear.
- Capture the ambient audio noise with a microphone.
- Filter the audio signal to the desired band of the frequencey spectrum to cancel out. Assume you want to eliminate low rumblings of a server room or an airplane engine; You’ll need to run to remove the high frequencies from being processed.
- Invert the audio signal phase. To cancel out an audio signal, play the inverted signal simultaneously with the original audio signal. The process of playing the original audio and inverted audio simultaneously will cause the audio signals to cancel each other out and your ears won’t hear anything.
- Play the filtered-inverted audio signal though the earbuds at the exact same time live ambient noise is captured by your ear.
With the theory all taken care of, I built a simple mobile application which captures sound from the microphone, applies a high pass cut-off and low pass cut-off filter, inverts the phase and plays the audio back through the earphones. I call it Zenphones and here is what it looks like:
A simple 1-screen app that doesn’t work and here is why: Audio latency. If you look closely at the Input/Output plot of the application you can visually inspect the problem.
The latency between the input and processed output is enough to break the noise canceling and instead create a reverb effect. Noise canceling only works if both the normal and inverted audio signals are perfectly in sync. This means the latency gaps need to be completely removed in order for the app to work. The reason Bose headphones work well is because Bose processes the audio signal in hardware on your ear allowing Bose’s noise canceling headphones to play the inverted audio signal back as quickly as the ambient sound is received.
What might work #
Even though this didn’t succeed, I think that Apple could implement this with a few changes to hardware.
- Modify the stock earbuds - Now that Apple owns Beats By Dre, they should have some amazing audio engineers. Apple’s could embed a microphones in each ear to capture audio at the closes point to where sound enters the ear.
- Dedicated Audio Coprocessor - Currently, the algorithms for filtering and phase inversion run in software. The earbuds could send data directly to the device with a dedicated audio coprocessor to reduce time calculating a filtered and inverted audio signal.
If you want to play with the project yourself, I’ve open sourced the code under MIT license. Have fun.
Apple Insider Just announced that Apple researching wireless earphones with bone conduction noise cancelling tech