Advertisement
Guest User

Untitled

a guest
Mar 25th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1.  
  2.  
  3. FFTSize = 4096;
  4.  
  5.  
  6. Y = wavread('zenity.wav');
  7. Y = Y(:,1);
  8. sr = 44100;
  9. current_window = zeros(FFTSize, 1);
  10.  
  11. final = zeros(length(Y), 1);
  12.  
  13.  
  14. for k = 1:length(Y)/(FFTSize/2)-1
  15. for m = 1:FFTSize
  16. current_window(m, 1) = Y((k-1)*(FFTSize/2)+m, 1);
  17. end;
  18.  
  19. current_window = current_window.*hamming(FFTSize);
  20.  
  21. Ydft = fft(current_window, FFTSize);
  22.  
  23. a = abs(Ydft);
  24. p = angle(Ydft);
  25.  
  26. for kk = 30:FFTSize %not sure of this part but you can modify and get it to work from there
  27. a(kk,1) = 0;
  28. end;
  29.  
  30.  
  31.  
  32. ift = ifft (a.*exp(sqrt(-1)*p), FFTSize);
  33.  
  34.  
  35.  
  36.  
  37. for m = 1:FFTSize
  38. final(m+(k-1)*(FFTSize/2), 1) = final(m+(k-1)*(FFTSize/2), 1) + ift(m);
  39. end;
  40.  
  41.  
  42. end;
  43.  
  44.  
  45. wavwrite(final, 44100,16,'zenityout.wav')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement