DSPRelated.com
Forums

Software Noise-Cancelling?

Started by Graham Siener September 22, 2005
Hello,

No idea if this is in the right group, but most of my searches landed
me here.  I think it'd be great to have a PC with a microphone (e.g.
laptop) perform the noise cancelling that headphones do in hardware.

I have no idea about what kind of horsepower this would take a cpu vs.
hardware, but is this feasible?

Basically, plug your regular headphones into the laptop, click "Go" on
your noise cancelling software and let it take care of the rest.

Ideas, thoughts, interest?

Thanks,
Graham

Graham  Siener wrote:
> Hello, > > No idea if this is in the right group, but most of my searches landed > me here. I think it'd be great to have a PC with a microphone (e.g. > laptop) perform the noise cancelling that headphones do in hardware. > > I have no idea about what kind of horsepower this would take a cpu vs. > hardware, but is this feasible? > > Basically, plug your regular headphones into the laptop, click "Go" on > your noise cancelling software and let it take care of the rest. > > Ideas, thoughts, interest? > > Thanks, > Graham
I'm not a noise cancelling guru, but my understanding is that NC headphones sense the noise using a built-in microphone that is close to the ear. I don't see how you can emulate that in the PC. John
"john" <johns@xetron.com> wrote in message 
news:1127418077.289160.142200@g44g2000cwa.googlegroups.com...
> > Graham Siener wrote: >> Hello, >> >> No idea if this is in the right group, but most of my searches landed >> me here. I think it'd be great to have a PC with a microphone (e.g. >> laptop) perform the noise cancelling that headphones do in hardware. >> >> I have no idea about what kind of horsepower this would take a cpu vs. >> hardware, but is this feasible? >> >> Basically, plug your regular headphones into the laptop, click "Go" on >> your noise cancelling software and let it take care of the rest. >> >> Ideas, thoughts, interest? >> >> Thanks, >> Graham > > I'm not a noise cancelling guru, but my understanding is that NC > headphones sense the noise using a built-in microphone that is close to > the ear. I don't see how you can emulate that in the PC. > > John
Nor am I a guru, but I believe you are correct. I think the microphone has to be close to the ear to determine if the ear is hearing the primary sounds plus any noise. Then the noise is inverted and summed into the speakers at the appropriate levels to cancel out the noise. But I'm kind of just guessing since I'm too lazy to learn this technology. Thomas
These  noise cancellers use adaptive filters such as LMS (or RLS). The
microphone *inside* the headphones is used as the error signal for the
filter, which it tries to minimize. It also has a microphone outside
the headphone which is the input to the filter.

I don't think it would be possible for you to implement such system
without the mics inside the heaphone to provide an error signal. If you
have an estimate of the general characteristics of the noise (if the
noise is stationary), you might be able to design a Wiener filter, but
that would only apply to that type of noise, and you would not be
compensating for the heaphone transfer function. If you can get the
head-phone transfer function that might work...(note, the transfer
function for how sounds *outside* the headphone get attenuated by the
headphone, and not the voltage to SPL TF of the headphone).

You can only cancel low freq noise for starters like the annoying
sounds on a plane for instance - there are limitations but it depends
on the latency of the PC - I think it coudl be done - in fact I have
seen papers where it has been done for vibrations  for instance and the
language used was LabVIEW.

Naebad

Thomas Magma wrote:
> "john" <johns@xetron.com> wrote in message > news:1127418077.289160.142200@g44g2000cwa.googlegroups.com... > > > > Graham Siener wrote: > >> Hello, > >> > >> No idea if this is in the right group, but most of my searches landed > >> me here. I think it'd be great to have a PC with a microphone (e.g. > >> laptop) perform the noise cancelling that headphones do in hardware. > >> > >> I have no idea about what kind of horsepower this would take a cpu vs. > >> hardware, but is this feasible? > >> > >> Basically, plug your regular headphones into the laptop, click "Go" on > >> your noise cancelling software and let it take care of the rest. > >> > >> Ideas, thoughts, interest? > >> > >> Thanks, > >> Graham > > > > I'm not a noise cancelling guru, but my understanding is that NC > > headphones sense the noise using a built-in microphone that is close to > > the ear. I don't see how you can emulate that in the PC. > > > > John > > Nor am I a guru, but I believe you are correct. I think the microphone has > to be close to the ear to determine if the ear is hearing the primary sounds > plus any noise. Then the noise is inverted and summed into the speakers at > the appropriate levels to cancel out the noise. > > But I'm kind of just guessing since I'm too lazy to learn this technology. > > Thomas
The OP's idea could perhaps be modified to make less expensive, higher quality noise cancelling headphones that require a laptop (or other computer): Create inexpensive headphones that have a microphone on each earpiece, then feed the sound from the microphones through the mic port (or, better, the USB port which might eliminate a split cable between mic and speaker ports, makes the device compatible with laptops with no mic port, and allows for stereo input from the mic). Run software on the laptop to process the mic inputs to the cancel the noise that the user will hear and embed it in the audio going to his ear. Thus you have a batteryless, processorless accessory that takes advantage of existing processing power in the laptop. It would be great for people on airplanes or even people in cubicles (like me, uggh). A really smart algorithm could optionally reduce its noise cancelling quality if the laptop CPU gets busy. Cheers! --M
Ikaro wrote:
> These noise cancellers use adaptive filters such as LMS (or RLS). The > microphone *inside* the headphones is used as the error signal for the > filter, which it tries to minimize. It also has a microphone outside > the headphone which is the input to the filter. > > I don't think it would be possible for you to implement such system > without the mics inside the heaphone to provide an error signal. If you > have an estimate of the general characteristics of the noise (if the > noise is stationary), you might be able to design a Wiener filter, but > that would only apply to that type of noise, and you would not be > compensating for the heaphone transfer function. If you can get the > head-phone transfer function that might work...(note, the transfer > function for how sounds *outside* the headphone get attenuated by the > headphone, and not the voltage to SPL TF of the headphone).
Right. In my other post in this thread, I was thinking that the algorithm on the laptop would have low-level access to whatever signal is about to go out to the headphones and could process it directly. The software would likely require some operating system-dependent driver writing as well as higher level DSP algorithm development. Cheers! --M
http://www.menet.umn.edu/~shyams/ug_anc.html

HAve a look here - this is active noise control in a duct of some sort.
(using a PC)

Naebad

Graham  Siener wrote:
> No idea if this is in the right group, but most of my searches landed > me here. I think it'd be great to have a PC with a microphone (e.g. > laptop) perform the noise cancelling that headphones do in hardware. > > I have no idea about what kind of horsepower this would take a cpu vs. > hardware, but is this feasible? > > Basically, plug your regular headphones into the laptop, click "Go" on > your noise cancelling software and let it take care of the rest. > > Ideas, thoughts, interest?
You might need to calibrate the PC noise cancelling software by hooking up external microphones which can be attached both outside and inside the headphones. You might also need to recalibrate every time you move your head in relation to the PC/laptop, or if the noise sound source changes in the direction it's coming from, relative to the relationship between your head and the PC/laptop microphone, depending on the frequencies you wish to cancel of course. I think a difference of one foot makes the difference between being in or out of phase at somewhere around 500 Hz (using 1 ft/mS as the speed of sound). Get in-phase and you double the noise volume rather than cancel it. Ouch! IMHO. YMMV. -- Ron rhn A.T nicholson d.O.t C-o-M
You may need to write your device driver to do the LMS algorithm on an
interrupt-driven sample-by sample-basis.  The normal Windows block-oriented
processing introduces significant delays.

This would prove unacceptable if the normal intentional generation of
sidetone is to be employed.

The operator gets subliminal cues about how loud to talk from the sidetone.
If delay exceeds a small number of milliseconds, the operator will stutter
and hesitate while speaking.

Jim Adamthwaite.