Active noise cancellation(ANC) in headphones
Started by 1 month ago●13 replies●latest reply 1 month ago●200 viewsHello, I am interested I understanding how ANC in headphones works. My high level understanding is that an external mic listens to the noise then a speaker within the headphones plays the signal necessary to cancel the effect of that noise at the point of the internal mic. Assuming I am correct here, doesn't that mean that there would be very high requirements on the signal processing speed?
Generously, there might be 0.01m between the external mic and speaker, this means the noise has propagated between them in ~30us (if there is only air in between). This seems like a very small amount of time.
So how do they work? How are they fast enough to be able to compute the filters before the noise has passed the speaker?
Thank you
The version you are talking about is called feedforward ANC and while the sound is not travelling in free space, but through the spring-mass system of the ear phone, the time delay might be slightly different but still very short.
The majority of ANC ear-phones use feedback ANC however - they use an internal control microphone and by feeding back it's signal to the loudspeaker (receiver as they call it) through a control filter, they eliminate noise. The basic problem of speed/latency stays the same, however. Even more so since the internal mic can only pick up noise when it is already inside the ear canal.
For low frequencies, however, the latency requirements are relaxed since - even if you are a little late with your anti-noise signal - this corresponds to only a small phase shift which will cause your cancellation to be a little less than perfect, but still rather good.
For both topologies the latency limits the upper bandwidth of broadband ANC - hence most ANC systems only work well in the lower to mid frequencies. Note that for narrow-band applications you could design a filter to match the required phase+N*360° at the desired frequency, but not for all frequencies.
In practical implementations and chips there is usually a very high sample-rate ANC path from mic to receiver with common rates of 192-384kHz - I think I have also seen 768kHz somewhere.
Hi Andrew,
Assuming you are correct, yes state-of-the-art small DSPs can be extremely fast, with 10nm or less process and high clock rates (2-3 GHz). At 2 GHz that's 60,000 SIMD instructions in 30 usec, more than enough to calculate several filters.
But, they may not need to be that fast in the general case, if background noise is relatively monotonous. Even if another person starts talking, 30 usec is only 2 audio samples at a typical "wideband audio" sampling rate (16 kHz). At high sampling rates that AudioEdge mentions, there would be more samples to work with, but still not so many that an ANC algorithm couldn't make some initial, very fast response.
-Jeff
Thank you both, this is very helpful.
Most consumer ANC headsets use analog electronics to cancel outside energy like you describe. Since it is analog there is no dependence on conversion or processor speed.
Hello,
Yes, there are. There are DSP audio codecs for headphones that fulfil those low-latency requirements.
1-sample delay at 48kHz would work as it is 20.8us. Then there is the secondary path impulse that includes the electro-acoustic part=audio amplifier+microspeaker+path to microphone inside the headphone or at the ear. This part must be less than 10us now in order to stay causal and be able to cancel up to 1kHz.
So this is now the latency requirements for a feedforward ANC filter.
For a feedback it must be less than the delay betweeen the microspeaker to microphone inside the headphone or at the ear.
To sum up for latency requirements (no matter what filtering it is used analog or DSP) is to assess the primary path delay = external microphone to internal microphone and to a microphone at the entrance of the ear canal and the secondary path = microspeaker to the internal microphone inside the headphone or at the entrance.
The hardware for ANC for headphones offers ICs with operational amplifiers that can also be tuned to do ANC to match some ideal ANC frequency responses. The trend now is moving towards DSP audio codecs as they are fast and as it was mentioned before the can go to a very high sampling rate and have also a second processing unit for the adaptive part.
Hope this helps!
For consumer applications codecs and processors add cost and power consumption that are outside the specs of most requirements. Digital processing has been possible for a long time, but most consumer ANC headsets (even the expensive aviation stuff that I use) still use analog electronics for cost and power consumption reasons.
I've seen schematics for active noise cancellation done entirely in analog and it's remarkably simple to get basic operation. I am curious how it's done in consumer-grade bluetooth headsets & the like. Apple Airpods have noise cancellation functionality and I strongly suspect it's done in DSP as the teardowns I've seen suggest the microphones are MEMS PDM based which wouldn't easily support analog operation.
Yes, equipment that already has digital signals from either the source or the media link (BT) are in a different solution space. A typical headset, though, that gets an analog signal in to start with and has to run ANC on a battery will likely not favor a DSP solution, since, as you mention, the analog implementations are tiny and mature designs and work really well.
Only in the last couple years have the very high-end aviation headsets (>$1k) moved to digital ANR, apparently mostly to incorporate BT and other dumb stuff like a battery and CO monitor that talk to you with a synthetic voice. Anything less than that is still analog ANR. I've got both and can't tell the difference in the ANR performance. The talking battery monitor is annoying, though. ;)
There is one provider of ICs with analog ANC than recently moved also into digital, as also in this case there is a need for analog components that for packaging requirements analog ANC for wirelless headphone and earphone do not meet these requirements.
So these needs also drove a major change.
There are low-power, low latency audio DSP codecs for bluetooth headphones/earphones and many big IC player and headphone/earphones have DSP ANC.
There is also a lot of new literature that is demonstrating DSP ANC with these codecs.
I've been looking at a "typical" PDM microphone for the specs, i.e. https://www.farnell.com/datasheets/3704043.pdf Mostly to get an idea of how fast the DSP has to be processed. I think the relevant spec to work out the timing would be the group delay:
Am I correct in my understanding that for a 1000Hz signal I would expect to wait 10us before the signal would appear within the PDM data?
yes for a feed forward solution, the noise picked up by the outer mic Nout times the complex f-dependant gain of the microphone Gmic times the f-dependant gain of the receiver Gsp (secondary path) has to be equal to minus the noise inside the ear canal Near (which is similar to Nout times primary path P).
Nout * Gmic * Gsp := Near ~= Nout * P
The latency must as low as possible,as you 30us primary path as you wrote initially. It is important to stay inside this time limits no matter analog or dsp filtering. Latency affects performance and stability.
A great white paper from knowless about anc microphones is
https://www.knowles.com/docs/default-source/defaul...
Analog systems are still a thing.