The noise cancelling headphones uses the following mathematical formula. I’m guessing that you can make one device to cancel all sounds that disturb you while you are studying/working on something . Check it out.
A article in Wired magazine mentioned this. ” Sounds are waves. The Fourier Transform analyzes a given wave, and produces the equivalent of its audio opposite. When that’s played, the two more or less cancel out, silencing your audio environs. Present audio headphones from companies like Bose, Sony, Phillips etc already have sound canceling algorithms built into them.