Noise Cancelling in Software?
doc_verma wonders: "There are directions to build noise-cancelling devices in hardware, but what would it take to create noise cancelling in software? Since computers have a speaker-of-sorts and can possibly have a microphone, why not take the input from the mic, reverse-phase it via software, and output it through the speaker? A noise-cancelling feature would be great to run on servers in a rack. It would also be a great app to run on your laptop when you are on a plane."
You'd only get noise cancellation at the rough area around the microphone is, assuming you'd account for the speaker-microphone distance. You have to cancel phase _everywhere_ for it to work for a room, and you can't do that, really, without a huge array of speakers, or speakers exactly co-located with noise sources.
So you could do it in software for headphones, since you just need to cancel noise right at the headphones, which is fine. But it's no good for speakers, unless you have very specific configurations of noise sources that lend themselves to simple cancellation. In general, no way.
Do you sit in the exact same relative position to the speakers (within a quarter of a wavelength or so) at all times? If not, that idea's dead.
I've had this sig for three days.
Your computer's sound input and output are buffered in both software and hardware. This means that there will be a minimum latency measured in tens or hundreds of milliseconds between reading input from the microphone and being able to send corresponding output to the speakers. You can make this latency smaller and more predictable with well-designed hardware, drivers, and applications software, but you'll never be able to do the same "real-time" processing that you can do with dedicated hardware.
Software would generally be too slow. A DSP-based sound card could potentially be programmed to do phase-inversion and time-slew (to account for distance) but an ordinary desktop machine would generally need to be very fast and incorporate real time extensions in the kernel. This is the reason you generally find hardware-only solutions (and in headphones for the reasons mentioned in a peer post). Of course I could be way off....
The problem with quiet fans in a server-room / rack style environment is that the quiet fans typically don't move a lot of air.
I've got a 2u switch, with some 60mm fans in a small 6 foot rack in my basement. The fans aren't too loud in and of themselves, but they make a hell of a lot of wind noise and turbulence - because they run at 5000rpm. Now, since I can control the air temperature a little better in my situation than you might in a server room (by not having a crapload of equipment in the rack), I could probably replace them with 2500rpm fans.
But I digress. The people who make this equipment have to have high airflow - they can't have their equipment fail on you, the consumer, even if you abuse the room they're in (temperature wise...)
I've also played with 1u servers, with insanely fast, whiney whooshing fans. They are REQUIRED, if you ever feel the heat they move off the back - you'd know why.
In short, in a server room, there's not much you can do about the noise. Just insulate the room and keep the noise on the inside.
Karnal
why not take the input from the mic, reverse-phase it via software, and output it through the speaker? well, i suppose the howling, squealing feedback would make you forget about the server fans for a few seconds, but i suspect it would just end up giving you a bigger headache in the long run.
... on a road trip across the West. Eight solid hours of a four year old pontificating. I searched the car high and low for the travel headphones so I could get a break with my MP3 player. Couldn't find them and the only stores for thousands of miles in any direction sold only alcohol, Mormon cookbooks, and knives.
This is a cool idea.
The Luddites were ahead of their time.
I dont know how to noise cancel, but I know how to create a ton! cat /dev/urandom > /dev/dsp :)
You want one of these
The biggest issue is to only have one specific sound source you're trying to muffle. You have to place the microphone as near to the sound source as possible, and the location of your speaker will depend on how long it takes to process the signal. It will also be highly directional unless you rig something up with multiple speakers all aimed in different directions. You will also need to be a certain distance away to allow the reverse-phase sounds to merge and cancel each other out.
The other issue is that it will only work on low pitched sounds, the lower the better. The slower the frequency, the more time you have to do the math and output your opposite signal. High frequency sounds you can pretty much forget about being able to process.
One use for this might be to muffle a single exhaust pipe from a loud motor, but you won't be able to get it to work for general noise. The reason it works in Noise-cancelling headsets is that the microphone is located at the destination of the sound (your ear), rather than at the source. The closer you can get it either end, the better it will work. It's not really worth doing it in Software
One interesting thought about quieting individual fans or motors is to use an Adaptive algorithm. Because most of these devices make a consistent repeating sound, it would be interesting to be able to anticipate the sound source over time and broadcast an estimated calculation before the current sound is even processed and use the processed result to tweak the future estimation. This would work on only reasonably consistent sources and there would be issues with feedback and unexpected noise changes.
Your poor child. I hope you have money saved for the therapist.
Yeah, for me. He got that from his mother.
The Luddites were ahead of their time.
the only stores for thousands of miles in any direction sold only alcohol, Mormon cookbooks, and knives.
Sounds like a bad day for the Mormons if you're hungry.
Stop the world; I need to get off.
This isn't Slashdot worthy material, but I'll answer it with some information anyways.
The key to noise cancelling is direction. The inversed noise has to be travelling in the same direction the noise otherwise would, and it has to be inverted and spat out at almost the exact same time.
While the speed issue isn't a problem, the microphone and speakers aren't good for the directionalness. It works well in headphones, because with headphones you have a very specific direction: in to your ear. The microphone can pick up things relatively directional (depending on the type of mic.) but the speakers are made to spread sound, not to aim it.
That and they would have to be in roughly the same location (within a few cm.) for it to work properly.
What I want, is a noise cancelling dome, so two people can go under it, talk, and have no one outside hear anything, that'd be cool.
I'm sure that would be fine. It's your audio capture device, the pipelines on the card, DMA transfers, bus speed/contention, and system schedulers that are the problem. Oh yeah. All *that* stuff.... And then you need to get back through the bus, card pipelines and out through the DAC to generate output. Phew!
s ystemi ng5 4
Dedicated, you'd probably be fine at 100Mhz or less with the right [embedded : most likely hand coded assembly] software. Most modern desktops have so much crap running all the time however that those precious CPU cycles dissapear very quickly. Even if you could do it, there'd probably be gaps or delays without some nicely written double or triple buffering techniques. These things take time and then therefore kill what you set out to do.....
Actually - If the microphone was placed very close to the source, you may be able to generate some anti-sound "down range" (ie. Your desk) and the latency could be compensated for in that regard. It would take some fine tuning - in fact another microphone at the place where you need the quiet could be used for the system to tune itself. (This of course is assuming there are no walls in the room for the sound to bounce off of so that you aren't trying to defeat 17 "sources" simultaneously).
I'm not claiming any authority on this or saying it can't be done, just stating that it's probably quite a bit more complicated than it may look at first glance. Real time work is not something most "normal" OSes are setup to do. It can be done, but for things to be faster than sound you've got to get your latency WAY WAY WAY down.
http://en.wikipedia.org/wiki/Real_time
http://en.wikipedia.org/wiki/Real-time_computing
http://en.wikipedia.org/wiki/Real-time_operating_
http://en.wikipedia.org/wiki/Audio_signal_process
http://en.wikipedia.org/wiki/Noise_cancellation
http://slashdot.org/article.pl?sid=04/05/27/16412