These days, many of my classmates are asking to help them removing vocals from songs for my school’s Singing Contest. I’m doing these things for quite a long time and I’m already used to it.
Suddenly, I feel like digging out how vocal removal works so I searched in the internet. I found there are many ways in doing this like using FFT to eliminate the frequency of the vocals or using the FFT of different signals to eliminate the vocals. Among all of them I found one that is surprisingly easy to implant – phase cancellation.
In phase cancellation, it’ll make an assumption that the vocals are recorded using one microphone only. Since the vocals are manifested equally across the channels, we can invert the phase of one of the channel and add that signal to the another track to eliminate the vocals. This produce pretty good result as long as the vocals are recorded in stereo and follows the assumption. This algorithm does not work well or at all when the audio is mono or the vocals are recorded using more than one microphones or the music is also recorded with only one microphone.
OK. Here’s the algorithm:
output[i] = (inputL[i] - inputR[i]) / 2;
output[i] = (inputR[i] - inputL[i]) / 2;
That why I said that it’s easy, it’s only a piece of simple math.
Do you want a working example running in your web browser? Here’s one that is created with the web audio API and HTML5 Drag & Drop API. Enjoy!