Exploring Active Noise Cancellation (ANC) through a Computer Simulation


I am that type of a person who takes the rather mundane activity of listening to music seriously. When it comes to audio playback, I hold audio bitrate, depth and mixing of a track as essential ingredients that guarantee auditory pleasure. However, if external variables as background noise pervade through the experience, it certainly does not make for a good listening session. I recently bought Sony’s flagship TWS earbuds, the Sony WF-1000XM3, which advertises Active Noise Cancellation as one of its many features. It blocks out background noise pretty well to the degree of near-perfect silence once the buds are put onto the ears. How does it effect such a degree of noise elimination? This short article is an attempt to demonstrate how ANC technology works by simulating the process on a software.

Several companies have for long pondered over this challenge of eliminating as much noise as is possible from a live audio stream. In contemporary times, where videoconferencing and real-time audio transmission has become a norm in many a household, eliminating background noise has taken up much more relevance as a practical engineering problem. For earphones and headphones, the challenge can be resolved by two means. The product may either go for passive noise isolation or can adopt a mix of both noise isolation with Active Noise Cancellation (ANC).

Most of the lower-end auditory devices available in the market rely on passive noise isolation, wherein the padding (or earcups) attempt to physically block out vibrations from reaching the eardrums. Yet, this approach is faulty by its design. Vibrations from background noise are also picked up by the skull and the forehead and subsequently transmitted onto the tiny millimetre-sized bones within our sophisticated ears. On the other hand, Active Noise Cancellation has an entirely different operating principle.

The famed Amar Bose- founder of the multinational Bose firm today- was one of the pioneers to devise headphones that not only minimised noise by isolation alone but also effectively cancelled out whatever noise could be possibly cancelled. To understand how noise cancellation really works in modern premium audio devices, we need to have a fundamental understanding of what we perceive as sound.

Sound is a series of vibrations (or ‘waves’) in a medium. In our case, the medium is air. At each instance of time where the vibrations are present, it has a definite value (or amplitude). A proper arrangement of these vibrations leads to an overlap of fundamental modes and periodic overtones that we understand as the sense of music. Anything erratic and unpleasant (and mostly low frequency) is what we categorise as noise. In the following experiment, we shall attempt to eliminate noise from an outdoor chat. For purpose of the simulation, we will use Audacity (freeware), a powerful software to mix and edit tracks.

The theory behind noise cancellation is very simple, yet a potent tool to combat the problem of unwanted noise. The low-frequency background noise is captured from a microphone and a replica, 180-degree phase-inverted track is produced alongside. In other words, all crests in the original track are been replaced by troughs and vice-versa. Hence, while the files remain the same, the polarities are inverted. Once the inverted file is generated, the two are superimposed to cancel each other out. Here’s the noise sample we shall consider:

Dipankan Bandopadhyay · Background Chatter Noise

The fact that noise is mostly of low frequency (below 700-800 Hz) can be confirmed by observing the spectrographic representation:

Now, let us import the track onto Audacity and observe the time-domain representation of the waveform. Two waveforms appear. The upper waveform is the left channel and the lower one is the right channel.

For purpose of superimposition, we need a replica track. We can simply press Ctrl + A followed by Ctrl + C to copy, and subsequently Ctrl + V to place the duplicate track on the same display panel. Once replicated, the identical tracks are displayed in order, as:

Let us assume that ANC is turned on after a specific duration, say ten seconds. Hence, we will only phase invert by 180 degrees the first waveform from 10s onwards, till the end of the track. It can be easily achieved through Audacity’s built-in phase transform feature that inverts the polarities:

Once inverted, there is no physical difference in terms of the audio quality between the original audio files and the inverted track. In fact, for a practical demonstration, here is the SoundCloud clip of the inverted track (post the ten seconds mark).

Dipankan Bandopadhyay · Inverted Background Chatter Noise

The final step is to superimpose the inverted track with the replica track. It can be done by selecting both the tracks at once, hitting Tracks > Mix > Mix and Render. Once done, Audacity combines both the files, generating the resultant, noise-cancelled file. Here is how the waveform looks now, post noise cancellation:

Notice how, post the ten-second mark, the time domain representation in both channels drops down to zero. This is the beauty of noise cancellation. While one hears the chatter as long as NC is turned off, the unwanted noise is completely cut off once the NC is activated. However, in reality, both tracks are playing at the same time! Here is the spectrographic (frequency-domain) activity of the noise-cancelled file:

There is no activity post the cutoff period simply because all the noise has been completely eliminated by the process of superimposition with the phase inverted track, indicating complete silence. The vertical scale represents frequencies. Finally, to simulate the transition phase between ambient sound entry and beginning of noise cancellation, we can fade out a small portion in time towards the end. The final waveform then looks like this (notice the amplitude diminishing as it approaches the zero crossing):

Here is the resultant SoundCloud rendition of the final noise-cancelled track.

Dipankan Bandopadhyay · Noise Cancelled Outdoor Chatter

The real-time physical implementation of this process requires computational power, and hence, consumes energy. This is why it is incorrect to state noise isolating systems as passive noise cancellation- there is simply nothing like that. The word active denotes that energy is used up to cancel noise from background sources in real-time. My Sony WF-1000XM3 uses its proprietary QN1e processor embedded in the earbuds to do this operation. The real engineering challenge would be to further minimise the power consumption from such active noise cancelling, whilst bringing down costs associated for production of such premium ANC headphones and earbuds.


Leave a Reply

Your email address will not be published. Required fields are marked *