Analog Noise Cancelling Headphones

73,797

145

52

Posted in TechnologyElectronics

Introduction: Analog Noise Cancelling Headphones

Noise cancelling headphones are an ideal choice for many music listeners for their ability to cut out ambient noise without raising the audio volume to levels that might be dangerous for the ear. Even with no music playing, the headphones have the ability to mute ambient noise – perfect for those trying to work or sleep in environments where ambient noise is commonplace (e.g. airplanes, outside, etc). There are several methods of noise cancellation with headphones. The idea behind the majority of designs involves placing a microphone on the outside of the headphones to pick up the ambient noise; this noise is then inverted and played into the ear with the music in hopes that the noise and inverted noise cancel each other out keeping in mind that the inverted signal’s delay also needs to be altered in order to insure the noise and inverted noise waved arrive to the ears at the same time. Other designs contain more complex feedback systems such as those designs that use a microphone on the inside of the headphone to determine the level of noise cancellation that is occurring.  Additionally, digital designs that incorporate adaptive filtering are prevalent in many commercial products today. Our particular project involves the use of a purely analog design, with a mic mounted to the outside of each ear, inverting the mic output, and summing this output with the music before sending the music into the ear.

This instructable will describe how to build an all analog stereo noise cancelling headphone system using opamps, resistors, and capacitors. The design presented here targets noise below 1 kHz which encompasses much of the ambient noise from planes, fans, cars, environment, etc. The above schematic is for one channel only. Simply duplicate this and you have stereo.

To build the full system in stereo you will need:

1 x pair of over ear headphones
6 x LT1056 OpAmp
2 x ECM-60PC-R Electret Mic
2 x 3.5mm Audio Jacks

2 x 0.01µF Cap
4 x 1nF Cap
8 x 10µF Cap

2 x 100Ω Res
2 x 1kΩ Res
2 x 2.2kΩ Res
2 x 4.7kΩ Res
8 x 10kΩ Res
2 x 13kΩ Res
2 x 22kΩ Res
2 x 1MΩ Res
2 x 500k Potentiometer

Lots of wires
A power supply (we used +/- 8V, but 9V works too!) capable of at least 30mA
Breadboard to build and test
Oscilliscope for testing

This instructable was made by Simon Basilico and Chris Russ as part of a project for EE 122A at Stanford University taught by Professor Greg Kovacs and Laurent Giovangrandi with help from
TA Bill Esposito.



Step 1: The Block Diagram

The signal path can be seen in the block diagram above. First, the noise is passed into the mic where it goes to a preamp then an all pass filter to delay the signal.  Finally the noise is input to the summing amp and added to the music signal. This stage also inverts the noise as a summing amplifier is a special case of the standard inverting amp.  The amplitude of the noise is determined by this stage and must be tuned to achieve proper noise cancellation.  The inverted noise plus music signal is then played through the headphones and cancels out the unwanted noise. The next steps explain each stage further.

Step 2: Mic Setup and Power Supply Filter

The microphone stage is constructed according to the schematic above. The low pass filter on the power supply Vdd (R11, C5, C6, C7) is needed to remove high frequency noise from appearing at the mic output.  This is especially important if you are using a digital power supply. R10 is used to properly bias the mic and C2 is an AC coupling capacitor used to remove the DC offset and only pass the noise signal that the mic is detecting. This configuration was found on the data sheet for the mic. The output of C2 leads to the preamp stage.

Mic datasheet: http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_136574_-1

Step 3: Mic Pre Amp

The mic preamp stage is used to amplify the noise signal to a level where we can actually process it. The gain of this part actually depends on the frequency of the incoming signal. In simple terms, this stage acts as a unity gain amp for DC and a non-inverting amp with gain R1/R2 (22/1 here) for all other frequencies. This is again to reduce the DC component of the noise-cancelling signal. The problem with DC is that it causes an offset in the noise-cancelling signal which will cause the system to not work correctly.

Non-Inverting Amp Description (Page 3):http://www.ti.com/lit/an/snoa621c/snoa621c.pdf
LT1056 Datasheet: http://cds.linear.com/docs/en/datasheet/10556fc.pdf

Step 4: All-Pass Filter

The all-pass stage delays the noise-cancelling signal and preserves unity gain. The delay is needed because the noise sound that we wish to cancel takes time to get from the mic to your ear. Electronic signals are much faster than sound so it is necessary to slow down the noise-cancelling signal or else the two will not arrive at your ears at the same time.

All-Pass Filter Description: http://www.analog.com/static/imported-files/tutorials/MT-202.pdf
LT1056 Datasheet: http://cds.linear.com/docs/en/datasheet/10556fc.pdf

Step 5: All-Pass Filter Design

This step is a more in depth description of how the all-pass was designed and is not a build step. You can skip ahead if you want or continue reading to learn more!

We first measured the distance from the mic to your ear (2cm). Then calculated how much time a sound wave takes to travel this distance using:
     Distance(from mic to ear) = rate(speed of sound) x time delay
     Time delay = 2 x 10-2 m / 340 m/s ≈ 60µsec
Then, to find the phase lag in degrees needed we used the equation:
     Phase lag = time delay x frequency x 360
     Phase lag = 60µsec x frequency x 360
From here we needed to decide what range of frequencies we wanted to cancel out. We chose 1 kHz as the max and calculated what the lag needs to be for two points:
     @60Hz : phase lag = 1.3 degrees
     @1 kHz : phase lag = 21.6 degrees
From here, we tweaked the value of R4 and C3+C4 to get the phase shift to be at our desired values.

Step 6: Summing Amp

This final stage adds the music to the processed noise signal and inverts the sum. The key part here is to tune the gain of the noise-cancelling signal so that its amplitude matches the amplitude of the sound signal. This is one of the more difficult parts of the design and is why the potentiometer has been added.  The music input’s gain will be 1 (R6/R8), while the noise-cancelling signal will have a gain of R6/R7.  After setting up the system, we adjusted this potentiometer until it sounded like there was noise cancellation occurring. This may sound arbitrary, but audio engineering where one of the signals that you are using is a sound wave is very difficult to quantify or see on an instrument.

The music input comes from one channel of the 3.5mm audio jack.

Summing Amp Description (Page 5): http://www.ti.com/lit/an/snoa621c/snoa621c.pdf
LT1056 Datasheet: 
http://cds.linear.com/docs/en/datasheet/10556fc.pdf

Step 7:

The final stage of the system is a current limiting resistor in series with the headphones. The headphones we chose have an impedance of 24 Ω.  With using power rails of +/- 8V this means that the output current could be up to 333mA.  With the R12 added the max current is reduced to 65mA.  This is done to protect the headphones (based on power rating) and your ears (more current means way louder).

The output of R12 is attached to the 3.5mm audio jack so that standard headphones can be connected.

Step 8: Completing the System

Steps 2-6 describe how to build one channel, but we want stereo noise cancelling headphones! Simply build the same circuit again and you’ve got your stereo analog noise-cancelling circuit complete!

At this point, all you need to do is attach the mic to your headphones.  You should aim the mic facing out and in the middle of the headphone. Unfortunately this means you are going to have a long wire from the mic to your circuit and long wires mean that there will be a lot of induced noise, especially at 60Hz.  To help reduce this, we twisted the wires as seen in the picture below.  Shielding would also greatly help, but we did not have the time to implement it.

Step 9: Listen to Noise-less Music

Now you have noise cancelling headphones! These aren’t quite Bose quality headphones, but do noticeably cancel out low frequency noise and are completely analog.

Thanks for reading and if you have any questions we can be reached at:

Simon Basilico: basilico@stanford.edu
Chris Russ: cruss@stanford.edu

Step 10: Important Observations

Here are a few notes about things we noticed that affected the project. 

We had a few issues using 1k resistors with the LT1056 opamps. There were some very strange problems that were resolved when we replaced them with 10k. 

If you use a digital power supply make sure to add the filter from the supply to the mic because the digital supplies tend to be noisy. 

The long wire from the mic to the circuit picks up a lot of noise. This can be mitigated by twisting the wire as shown in the design and also shielding the wire. 




Share

Recommendations

  • Microcontroller Contest

    Microcontroller Contest
  • Science of Cooking

    Science of Cooking
  • Pocket-Sized Contest

    Pocket-Sized Contest
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

52 Comments

i think the distance from the mic to the ear is not usable.
normally the distance from the mic to the speaker should be used for caluclating

This circuit works in theory but not practical, I cannot hear any difference, on my oscilloscope the circuit performs as needed but has no effect on noise.

I cannot work out the R4,C3,C4 values with the formulas provided for frequency 60Hz and 1kHz.

Below is my calculation:

@1kHz: Phase Lag = -2Tan^-1((13k * 2*10^-9)/2pi * 1000) = -8.27 *10^-9???

Please help as my headphones speaker is 3.5cm away from the MIC

This is very interesting. How can I modify this circuit to make active noise cancellation in a mic? I need it to spak at my phone using car speakerphone.

thanke you very much

Can any one send the pic of a complete circuit including wiring of headphones and power supply to board as well. Because I am getting confused a bit how to connect headphones with the circuit drawn.

The ear canal adds about 2-2,5cm to the distance between microphone/speaker membrane and ear drum. Did anyone try optimising the phase delay considering this?

1 reply

Did you follow up on this? Can you tell me how you'd think to go about it?

Great work here ! Thanks !

I'm trying to understand how the system works. I've drawn the Bode Diagrams of each part of the circuit, but the phase change never reaches π either -π... Could someone help me to understand how it works please ?
Thanks ! :)

6 replies

when put through the inverting op amp it's like shifting it by pi

Here is the phase change i've found. The phase change without taking into account the distance between the microphone and the speakers inside the headset is in blue. In magenta this distance has been taken into account. Anyway, the phase changes and does not stay at +/- π... If someone has figured it out and can help me ^^
Thanks !

dephasageFinal.png

Ipl0an,

the phase change will never stay at +/- pi. In this type of circuit, the phase shift to achieve the best noise cancellation is designed around a single frequency. Put simply, there is a lot of research that the author of this 'ible put in to building it, and understanding all of the math behind proving it is a pain.

The link below makes for interesting reading - it is a senior project paper on noise cancellation. You might find your answer there - be warned though, it goes heavily into DSP transfer functions.

http://digitalcommons.calpoly.edu/mwg-internal/de5...

MattB34, thanks for your answer.

However you link seems to be broken I cannot reach the paper. If you could send it again it would really help me.

As a matter of fact, i'm trying to build my own noise cancelling circuit as part of a project for my competitive exams at the end of the year. As a consequence, I am interesting in understanding the maths behind this circuit (even if it means heavy tranfer functions). It would allow me to have a basis of comparison for my circuit.

I've already put a lot of work in establishing the equations behind the circuit, and I would like to understand how the phase shift works.

Thanks for your answers anyway ! :)

Ipl0an, try this google search. The very first link for me is the paper. I understand the analog side to this system, but the transfer functions are a bit out of my area of expertise. DSP is not my strong suit =) These papers got much more in to detail if you are designing a DSP based system. The first 3 links all are senior projects that might help you

Question for you:

Could this be adapted to external speakers to dampen the sound in a room?

i have a doubt with your principle..
Is the cancellation happening in atmosphere of ear. Or the cancellation is taking place within the circuit or electrically?

1 reply

is it ok to remove music input on that circuit???

will it work?