I want to detect the regions of voice in a song. Currently, I am using the fact that the vocals in the song are recorded as center panned. So, I am removing all center panned audio from the song. However, this removes other instruments such as bass also. So, it sometimes gives false indication of voice being present.
I want a way ( better? than this naive approach?) to be able to detect portions of the song where a singer is singing. There is no specific type of music, I'd like an implementation for any type of song. A sample might be http://www.youtube.com/watch?v=w_Rut4qm33g but I up for any song for which this can be done, even if it has some specific properties.
My current implementation is -
[y, fs] = wavread('song.wav'); subplot(2, 1, 1); plot(y) left = y(:,1); right = y(:,2); yOut(:,1) = (left - right)/2; yOut(:,2) = (left - right)/2; wavwrite(yOut, fs, 'tmp2.wav'); fftL = fft(left); fftR = fft(right); N = size(fftL) N = N(1); M = size(fftR) M = M(1); N = min(N, M); for i = 1:N dif = fftL(i,1) / fftR(i,1); dif = abs(dif); if (dif > 0.7 && dif < 1.5) fftL(i,1) = 0; fftR(i,1) = 0; end; end; leftOut = ifft(fftL); rightOut = ifft(fftR); yOut(:,1) = leftOut; yOut(:,2) = rightOut; subplot(2, 1, 2); plot(yOut) N = size(yOut); N = N(1); for i = 6:N yOut(i) = 1/5* (yOut(i-1) + yOut(i-2) + yOut(i-3) + yOut(i-4) + yOut(i-5)); end wavwrite(yOut, fs, 'tmp.wav');