Advertisement
Guest User

proba

a guest
Jan 18th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.63 KB | None | 0 0
  1. %Reading the file
  2. [y, fs] = audioread('bogis.wav');
  3.  
  4. %Creating the vector according to which delay is varied
  5. a= 0.01;
  6. b= 0.4;
  7. low_n = round(a*fs);
  8. high_n = round(b*fs);
  9.  
  10. delay_step = 2 /(1/fs);
  11. n = low_n;
  12. no_points = length(y(:,1));
  13. out_wav(:,1) = zeros(1,no_points);
  14.  
  15. for i=1:no_points
  16.     if(i<=2*fs)
  17.        delay(i) = (((a*b)/2)*i) + a*fs;
  18.     elseif(i>2*fs && i<=4*fs)
  19.        delay(i) = (-(a-b)/2)*(i-2*fs)+b*fs;
  20.     end
  21. end
  22.  
  23. %     n = i-delay;
  24. %     if n>0
  25. %         out_wav(i) = y(i)+y(n);
  26. %     else
  27. %         out_wav(i) = y(i);
  28. %     end
  29. % end
  30.  
  31. p = audioplayer(out_wav,fs);
  32. play(p);
  33. plot(out_wav);
  34. pause;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement