2
0

plpitch.m 694 B

123456789101112131415161718192021222324252627282930313233343536
  1. % Copyright David Rowe 2009
  2. % This program is distributed under the terms of the GNU General Public License
  3. % Version 2
  4. %
  5. % plpitch.m
  6. % Plots two pitch tracks on top of each other, used for comparing pitch
  7. % estimators
  8. function plpitch(pitch1_name, pitch2_name, start_fr, end_fr)
  9. pitch1 = load(pitch1_name);
  10. pitch2 = load(pitch2_name);
  11. st = 1;
  12. en = length(pitch1);
  13. if (nargin >= 3)
  14. st = start_fr;
  15. endif
  16. if (nargin >= 4)
  17. en = end_fr;
  18. endif
  19. figure(1);
  20. clf;
  21. l1 = strcat("r;",pitch1_name,";")
  22. l1
  23. st
  24. en
  25. plot(pitch1(st:en), l1);
  26. axis([1 en-st 20 160]);
  27. l2 = strcat("g;",pitch2_name,";");
  28. hold on;
  29. plot(pitch2(st:en),l2);
  30. hold off;
  31. endfunction