church29/Noise-Cancellation — pull request #17 by church29 (2014-02-25 04:36:16+00:00)
Title: Implemented inversion function

As mentioned in https://github.com/church29/Noise-Cancellation/issues/14
After lots and lots of searching around, I figured out we don't actually need to use an fft to invert the signal. All we have to do for a 16bit_pcm encoded byte stream is convert the 16bit little endian into a short, and invert it and then convert it back into a 16 bit little endian. We have to watch out with the issue of converting the negation of min(16bit) into short due to the value being too great which would result in a popping sound in the signal. I handled this with an if statement but we could probably do the same with proper bit operations. I tested my previous algorithm for this and it seemed to do something, but my bit operations were incorrect so it was a fuzzy signal with popping. Right now, my phone is being a dingus and wont instantiate a mic object, so I will have to proceed with further testing later.