Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.42 KB | None | 0 0
  1. %% load and process data
  2. [Y, FS] = audioread('alemi.mp3');
  3.  
  4. [S,F,T,P] = spectrogram(Y(:,1),4096,4000,4096,FS,'yaxis');
  5.  
  6. %% make a plot
  7. maxF = 1e3;
  8. myF = F(F<maxF);
  9. figure
  10. C  = log10(P(F<maxF,:));
  11. imagesc(T,myF,C)
  12. set(gca,'YDir','Normal')
  13. caxis([min(min(C)) max(max(C))])
  14.  
  15. set(gca,'FontSize',16)
  16.  
  17. axis tight
  18. xlabel 'Time (s)', ylabel 'Frequency (Hz)'
  19. colormap gray
  20. ylim([0 maxF])
  21.  
  22. print -dpng boing_alemi.png
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement