Matlab removing vocals

I am writing a program to remove vocals from a song using fft. Before C #, I decided to test the frequency reduction algorithm in Matlab, but I could not get the result as in the example. There is noise. I tried to select any range (0.7 - 1.5), but still ... noise. What don't I have? Please help me write this correctly) Thanks in advance!

[y, fs] = wavread('Song.wav');
left = y(:,1);
right = y(:,2);
fftL = fft(left);
fftR = fft(right);

for i = 1:683550 %in my example 683550
  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;

wavwrite(yOut, fs, 'tmp.wav');

      

+3


source to share


1 answer


From the code, I can see that you are simply classifying frequency content as vocal if it is "equal" in strength between left and right (equal is defined as the ratio between 0.7 and 1.5). I am not familiar with your reasons for this scheme, but it can lead to a decent result.

What you are doing wrong is most likely due to the size of the fft and the fact that you are processing the full signal in one go, so to speak.



Vocals, for example. the song changes over time, so your disguise must change as well. This means you need to split your signal into frames in the time domain and execute your fft and mask separately for each frame. You should also consider using overlap in framing the time domain.

Hello

+1


source







All Articles