how do noise cancelling headphones work so fast

509 views

So I understand the basic principles behind noise cancellation. You essentially use a microphone to record incoming sound waves and create an inverse wave that destructively interferes with the initial wave, thus, cancelling it out. But I don’t understand, practically, how this is done.

Let’s assume the sound wave makes contact with the microphone in the AirPod, which analyses the wave and shoots out an inverse wave, but by that point – the initial sound wave would surely have already reached my ears. The AirPod basically needs to cancel the sound wave before it moves roughly a centimetre or it’s too late.

The speed of sound (in a standard environment like air) is 343 meters per second or 34,300 centimetres per second; this means the AirPod has 1/34,300 seconds or ~0.03 miliseconds to do these operations to cancel the wave. That just seems absurd to me for such a tiny chip in the bloody AirPod.

Someone fix my confusion please.

In: 678

31 Answers

Anonymous 0 Comments

The other answers do a great job of describing how fast computers are, but in reality, they don’t need to be to solve this specific problem. (Although it certainly helps.)

The purpose of noise cancelling is to lessen the impact of sound that humans can and usually do hear. This constrains the bounds of frequency and amplitude that need to be negated, simplifying the problem.

Since every sound is a wave that goes on for some amount of time, the counter wave can actually start “late” and still be effective. Sure, it may lag in time, or maybe even slightly out of phase, but it will still mitigate some of the sound.

Fast computers mean that this can be done faster than you can perceive. However, instead of noise cancelling, imagine harmonizing instead. A singer doesn’t need to start singing in harmony on the very first soundwave to harmonize. Sure, it may take a noticeable amount of time to hear the harmony but the vast amount of the time the singer will sound in harmony, even as underlying sounds change.

Anyway, fast computers make this an easy problem. But they are not strictly necessary.

Anonymous 0 Comments

This channel is super informative and covers this question in good detail https://youtu.be/VIi04uD8LtY?si=Vko_S_gmzoAIfTv3

Anonymous 0 Comments

Specialized chips (hardware, not software) are capable of flipping the wave and combining it with the incoming wave to produce the destructive interference necessary for noise cancellation. This process is effectively instantaneous.

Software solutions will always have a small amount of lag – whether it’s detectable or not depends on many factors.

Anonymous 0 Comments

Electricity moves much much much faster than sound, so the sound isn’t canceled right when it is detected, it is able to be analyzed and the headphones do their thing

Anonymous 0 Comments

Sound is very fast. 343 meters per second.

Electricity moves at the speed of light.

299792458m/s

Rougly a MILLION times faster. That electric signal can go though roughly 10km of wires and processers before it gets to the speaker and still get to the speak at the same time as the sound wave.

There isn’t MILES of wire in your headphones so they actually have to slow down and delay the signal to the speaker so that it won’t be getting there BEFORE the sound wave.

Anonymous 0 Comments

0.03ms isn’t fast.

A simple processor running at a slow rate of 1Megahertz can do one operation in 0.001 milliseconds which is an order of magnitude higher than required for sound processing.

Anonymous 0 Comments

Probably a silly question. But theoretically, can light be cancelled out in a similar way?

Anonymous 0 Comments

Based on many comments here it seems there’s many levels and qualities of ANC … like wow…

I recently got my very first ANC ear buds which is EarFun Air Pro 3… all along i thought ANC are gimmicks and dun see why i should spend $100 $200 on a gimmick…

Can say im very pleasantly surprised because those Air Pro 3 are very affordable and the ANC is very good, but now since these are my one and only ear buds, and im sure there are… but how these earbuds compared to those big brands like BOSE, SONY, APPLE that cost $200 $300 a pop? Is the noise cancelling really much better on those big brands?

Please give your review/opinion if you do own actually a pair of Earfun Air Pro 3…

Anonymous 0 Comments

The trick is in that the circuit doesn’t need to act before sound moves 1cm. The circuit can be late and in fact it always is . Ever noticed that ANC only changes a low huming sounds rather than the crispy high sounds? Also Ever noticed that it never completely gets rid of them but only makes them quieter? The first part is because ANC is slow and it can only work with slow changes and low frequency sound is a slow change. The second part is that even with the slow changes ANC is always a little behind so it never is totally inversing the phase, it’s off by a few degrees.

Full cancellation happens at 180 degree phase shift which corresponds to half a wavelength delay. ANC needs to be between 0 and quarter wavelength late for ANC to work properly if it’s more than that, ANC will add to noise rather than attenuating it. There’s a lot of wiggle room. At low frequencies it’s closer to 0 because these waves are so long and change pressure slowly, that proportionally the little delay is smaller ( phase is simply a portion of a wave). Towards the higher pitched sounds, the frequency is so high that ANC can’t keep up – a tiny delay causes big change in phase. Eventually at some point ANC is too late and it starts adding noise rather than reducing it. Usually around 3kHz with the good headsets today.

The low sounds that ANC cancels are around 100Hz. We’re talking about waves 1/100th of a second. Half a wave of this is 1/200th of a second. During this time the sound travels 1.7m. Now since at this point we’re already 180* out of phase, ANC doesn’t need to inverse the signal, just mix it with itself but delayed. It won’t work perfectly but it hints at something.

I know this isn’t very ELI5 but the takeaway from this is that ANC doesn’t need to be perfect to work. The second, more confusing part is that in anything that repeats (which is waves) delay and inversion are almost the same thing. By inverting the wave you make an up, where there was down and down, where there was up. If the wave is repeating on and on and on, you can just copy it and delay this copy until it aligns just like the inverted version. You can draw a wave on two strips of paper and slide the paper to see how waves go into alignment and out of it as you “delay” one strip.

An person who designs an ANC decides for what frequencies the circuit inverses the signal (where the delay is negligible compared to the wave period) and when to nuance it so that even though it’s late, it still has at least some effect. This is hard to imagine without drawings but you can do some phase exercises on paper, where you draw a phase shift on checkered paper and count the difference on each spot and plot the resultant waveform. You’ll see that even though the waves not always cancel completely, they still attenuate and that’s exactly what ANC headphones do – they don’t need to be perfectly on time, just enough to do at least a little part of their job.

People don’t know this but sound cancellation happens in your ear and headphones even without ANC, except the canceled sound is not necessarily noise but music. Because phase shift can happen through delay, you can bounce a wave two times so that it aligns with itself out of phase. This causes many headphones to have strong dips in their response – the driver produces sound at this frequency but then the wave destroys itself. We call that destructive interference. You can see them on [a popular headset here](https://www.rtings.com/images/graphs/headphones/hyperx/cloud-ii/frequency-response-graph.png). The deep notch at 4kHz and the smaller notches above 10k are caused by phase cancellation just like it happens in ANC but purely acoustically and without any electronics. In the first dip it’s quite clear that the wave is almost perfectly out of phase with itself and the notch ends up really deep. in the smaller notches on the right, the cancellation wasn’t nearly as strong most likely because the phase wasn’t perfectly aligned. There may be other factors at play but I just wanted to get this point across.

Anonymous 0 Comments

I see a lot of people mentioning that computers are fast.

But another thing – they work best with repetitive sounds.
Fx. If you’re on a plane, the engine sound will be constant – so the chip will also do some predictive measures in order to anticipate sounds coming in the future.