Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. clear all;
  2. close all;
  3. clc;
  4.  
  5. [yt,Fs]=audioread('F:\odliczanie.wav');
  6.  
  7. %soundsc(yt)
  8.  
  9. t = (0:length(yt)-1)/Fs;
  10. %yt=horzcat(y1,y2);
  11.  
  12. %yt=y1+y2;
  13.  
  14. plot(t,yt,'-o');
  15. grid on;
  16. axis tight;
  17. title('odliczanie.wav');
  18. %title(['Amplitude: ',num2str(A1),' Frequency: ',num2str(F1),' and ',num2str(F2)]);
  19. xlabel('Time (s)');
  20. ylabel('amplitude');
  21.  
  22. b=fir1(64,[10*2/Fs],'low');
  23. figure;
  24. freqz(b,1,Fs,Fs)
  25. figure
  26.  
  27. outlo = filter(b,1,yt);
  28.  
  29. subplot(2,1,1)
  30. plot(t,yt,'k')
  31. title('Original Signal')
  32. ys = ylim;
  33.  
  34. subplot(2,1,2)
  35. plot(t,outlo,'k')
  36. title('Lowpass Filtered Signal')
  37. xlabel('Time (s)')
  38. ylim(ys)
  39.  
  40. soundsc(outlo);
  41.  
  42. figure;
  43. subplot(2,1,1)
  44. spectrogram(yt,256,16,Fs/2,Fs);
  45. title('Original Signal')
  46. subplot(2,1,2)
  47. spectrogram(outlo,256,16,Fs/2,Fs);
  48. title('Lowpass Filtered Signal')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement