lspwarp.m 602 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. % lspwarp.m
  2. % David Rowe Sep 2012
  3. %
  4. % Experimenting with non-linear LSP frequency axis for LSP quantisation
  5. % Plots a scaled mel axis.
  6. 1;
  7. function mel = freq2mel(f)
  8. mel = 70*log10(1 + f/700);
  9. endfunction
  10. function freq = mel2freq(m)
  11. freq = 700*(10 ^ (m/70) - 1);
  12. endfunction
  13. x = []; y = [];
  14. for freq = 100:25:4000
  15. mel = freq2mel(freq);
  16. x = [x freq];
  17. y = [y mel];
  18. end
  19. plot(x,y)
  20. grid
  21. mel_start = floor(freq2mel(100));
  22. mel_end = floor(freq2mel(4000));
  23. x = []; y = [];
  24. for mel=mel_start:mel_end
  25. freq = mel2freq(mel);
  26. x = [x freq];
  27. y = [y mel];
  28. end
  29. hold on;
  30. plot(x,y, '+')
  31. hold off;