Software-based active noise control using your Mac's microphone and a set of plain earphones.
Do you want a quiet environment but work in an open office? Don't want to shell out £300 for a set of Bose headphones?
Then this project might be useful to you. We can emulate active noise control through signal processing by playing back an inverted interference sound wave of what you're hearing to your ear pieces. All you need is a computer with microphone, a set of ear pieces, and this amazing program.
Theoretically, by taking real-time audio from a computer's microphone and emiting an attenuated sound wave with the same amplitude but with inverted phase, we can cause interference to cancel out unwanted noise.
The 2d-spectrograph below illustrates a recorded 10-second wav file and its inverted sound wave. When both files are played together, they cancel each other out.
To run the program, do
bundle exec ruby script.rb