Utilizing a Microcontroller to Incorporate a specified phase shift

Discussion in 'Embedded Systems and Microcontrollers' started by kunkunster, Apr 27, 2014.

  1. kunkunster

    Thread Starter New Member

    Apr 27, 2014
    Hey Everybody,

    I am taking an electronics course in college and as a final project my partner and I have decided to make noise cancelling headphones. At first we thought it would be enough to connect our microphone to an inverting op-amp and output the signal into our headphones. When we did this and found that we could still hear all of the ambient sounds around us we began to investigate. Utilizing an oscilloscope we were able to find that post op-amp we had a 180 degree inversion but post headphone output we had more of a 250-290 degree offset. We are working in the frequency range of below 20,000 Hz and we are aware that the phase offset can vary with frequency.

    A TA told us he heard of a way to utilize a microcontroller to adjust our phase shift. He said it would be possible to do utilizing "rotating stacks", but thats all he knew on the topic. I've tried to search the internet for anything similar but I may be looking for the wrong thing. Can anyone on here help us out?
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    It time domain phase shift is just time delay.
  3. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    That is probably the best way, at your level of skill.

    The problem is that you have used a capacitor coupled headphone amp. You need to change the headphone amp to a DC coupled non-inverting amp, like most modern push-pull (classAB) amp chips. That may also require a dual PSU (+/- PSU).

    You could also go to a small class D amp chip, provided it is DC coupled. That will give zero phase inversion AND can run from a single + PSU rail.
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
  5. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    That technique uses a fixed delay time, which can only provide 180' phase shift (ie noise cancelling) at ONE fixed frequency and one noise source. Noise into the headphones will generally come from multiple sources and mutiple frequencies.

    That's a part of the reason I suggested your original method of just using an inverted amp would be better for noise cancellation. :)