SHARE
TWEET

Untitled

gimo Nov 22nd, 2017 (edited) 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. clear all;
  2. %VARIABLES
  3. %Scale
  4. sc = 120;
  5. hu = 100;
  6. alpha=sc/hu;
  7. %Read audio
  8. [signal,Fs]=audioread('test.mp3', [2 800001]);
  9.  
  10. x = signal(:,1);
  11. w = hann(800000);
  12. Y = zeros(1,800000);
  13. xwin = x.*w;
  14. X = fft(xwin,800000);
  15. for i = 1:1:800000
  16.     if round(i*alpha) <800000+1
  17.         Y(i)= X(round(i*alpha));
  18.     else
  19.     Y(i) = 0;
  20.     end
  21.      YPhase(i) = Y(i)* exp(1j*1);
  22. end
  23. y = real(ifft(YPhase,800000));
  24. for i = 1:1:800000
  25.     if round(i*alpha^-1) <800000+1
  26.          wfix(i) = (w(i)/w(round(i*alpha^-1)));
  27.     else
  28.          wfix(i) = 0;
  29.  
  30.     end
  31. end
  32.  
  33. out = y.*wfix;
  34. plot(out);
  35. sound(out,Fs);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top