Software Noise Cancellation?
DangerTenor asks: "As I flew around the world, lusting after my coworker's $300 BOSE Quiet Comfort Noise-cancelling headphones, I looked down at my laptop computer and noticed the built-in microphone. Has anyone written or considered writing software to run noise-cancellation based on the built-in mic?"
Although previous posters were correct in saying that it's impossible to have the speakers cancel sound on the fly, because the delay would cause the inverse wave to be out of sync, I could definitely see writing some software that would cancel constant or regular, repetitive sounds. My only isse is that the built-in mics are generally very low-quality.
Has anyone considered writing software to filter a computer's fan? That would be really cool, and probably pretty easy to do...some little tray program that constantly runs the inverse sound over your speakers...hmmm.
But there is another kind of evil that we must fear most... and that is the indifference of good men.
Mod me offtopic - those damn headphones are worth it.
quis fimum scribit?
What some other people here forget is that by-and-large, the noise created by a PC's fans are stationary signals.
No, they are not.
Don't take my word for it. Record some and run it through your favorite MP3 player, with a reasonably sized FFT filter going in realtime. Watch the FFT display jerk spasmodically. Even the wiggling isn't as regular as you think; if you could do an FFT of the FFT, you'd see that. It's noise, it really is, and even if it sounds to your ear like it's "the same" noise, your computer hears it as anything but.
For extra bonus points (and to really enhance your understanding of what noise really is!), open that noise recording in a sound program. Zoom in really tight, until you can see one wave cycle (from 0, to max, to 0, to min, back to 0 again. It may cross 0 a few times in that span, so eyeball it. You can't really be wrong, so it's not that big a deal, as long as the two ends meet up when you're done.) Copy that sound for 1 or 2 seconds worth, and play it. (Copy and paste it twice, highlight that, copy and paste again, and duplicate that; you'll be into seconds in no time.) Take a moment and ask yourself what you expect this to sound like. Then play it. Is that what you expected? Still don't believe me? Take a larger snippet, three or four waves.
Noise is really, really dynamic, and you can't predict what it is going to do next.
Oh, and there's no such thing as noise cancellation, by the way, only cancelling certain sounds at certain isolated locations. That's why you need two headphones, one dedicated to each ear, to cancel noise. A single microphone cannot cancel noise for two ears across a set of frequencies, period, especially if it doesn't know where those ears are.
Again, don't take my word for it, draw it. Draw equally-spaced concentric circles emanating from a point. Draw equally spaced concentric circles of the same size emanating from another point. The distance between the two concentric circles is the frequency, and let's say one circle's lines is the bottom of the signal, and the other the top. The places where the circle touch the sound is canceled (in this hopelessly perfect little world where nothing is interfering with the sound). In the middle of each of the little quadrangles you build, the sound is doubled. You'll see it's impossible to complete and totally cancel the sound unless the two sources are exactly the same... which is not surprising because that's equivalent to preventing it in the first place!
And lest ye think that you can put your ears at two of the meeting points (again, totally and completely ignoring the sound's interaction with the environment)... draw another set of circles using the same sources, but multiplying the distance between each concentric circle by, say, 8/7s. And 1/3. And 87/34s. And everything in between. All at once.
Please try these things before trying to pick them apart; human intuition and wave phenomena are notoriously poor bedfellows.