Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Does this exist: software for noise cancellation

Is it possible to take advantage of a modern day pc (or laptop) and create a noise-cancelling dev environment? My laptop has good quality speakers & microphone and plenty of excess CPU.

Is this something someone has managed to pull off?

share|improve this question

migrated from stackoverflow.com Jul 21 '10 at 13:43

This question came from our site for professional and enthusiast programmers.

marked as duplicate by harrymc, random Jul 21 '10 at 19:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
i'd be willing to wear headphones, but would prefer to not even need to do that –  Harry Jul 21 '10 at 4:49
    
and yes i'm aware of off-the-shelf noise cancelling headphones - boring! –  Harry Jul 21 '10 at 4:49
1  
Are you looking to write a program to do this, or are you looking for existing tools? –  Michael Petrotta Jul 21 '10 at 4:52
    
Would prefer to get existing tools –  Harry Jul 21 '10 at 4:54
    
I think that for noise cancellation to work, you have to have a the speakers near your ears, and microphones right next to them. Then you just play back the sounds at the same amplitude but inverted. –  Gabe Jul 21 '10 at 4:55
show 4 more comments

3 Answers

This cannot be done for two reasons.

  1. It needs to be directional. Sound waves are spherical, and spherical waves without common centers don't overlap nicely. So you can't produce a "localized cancellation field". You can only put something very close to your ear and cancel things aiming inwards, because that's unidirectional.

  2. Your microphone and your speakers need to have a known distance between them, and it cannot be off by an appreciable fraction of the wavelength of sound you are trying to cancel.

    • Consider the buzz of your air-conditioner. It's emitting, say, 10KHz. (We're talking spherical cows here.)
    • Speed of sound is 343 m/s. So you can pack 10K waves into 343 meters. That's 0.0343 meters wavelength = approx 3 cm.
    • So your microphone must read the wavelength and create an exact opposite-magnitude wave that lines up with it perfectly.
    • That means it needs to know how far its microphone and speaker are from each other (so it can adjust for the wave travel time), and the relative direction.
    • If it's off by 3cm = 1/10000 of a second, it constructively interferes, making your A/C louder!
    • And if it's not totally on, it doesn't do much but add more noise.
share|improve this answer
add comment

You probably can't do this using a computer. To do noise cancelling you need a really short delay in between receiving the signal and getting the speakers to counteract it. The latency introduced by the PC would almost certainly be too much. Existing noise cancelling devices use fast DSP for this.

share|improve this answer
add comment

I don't know much about the science of acoustics, but from reading the wikipedia article on Noise-Cancellation, it seems like you would need the speakers to be right next to your ears (i.e. earphones) in order for this to work, so that each ear could get the correct (and distinct) anti-noise pattern.

So, if your goal is to not need to wear earphones, I think you might be out of luck.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.