From bbf8d44d8c56d99b591af05b5b2f039ed540a01c Mon Sep 17 00:00:00 2001 From: drowe67 Date: Tue, 8 Sep 2009 04:40:09 +0000 Subject: [PATCH] matlab UI to debug pitch estimator git-svn-id: https://svn.code.sf.net/p/freetel/code@42 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2/octave/plamp.m | 2 +- codec2/octave/plpitch.m | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 codec2/octave/plpitch.m diff --git a/codec2/octave/plamp.m b/codec2/octave/plamp.m index 223dfb9f..cf7618ce 100644 --- a/codec2/octave/plamp.m +++ b/codec2/octave/plamp.m @@ -48,7 +48,7 @@ function plamp(samname, f) do figure(1); clg; - s = [ Sn(2*f+1,:) Sn(2*f+2,:) ]; + s = [ Sn(2*f-1,:) Sn(2*f,:) ]; plot(s); axis([1 length(s) -20000 20000]); diff --git a/codec2/octave/plpitch.m b/codec2/octave/plpitch.m new file mode 100644 index 00000000..c335d8f4 --- /dev/null +++ b/codec2/octave/plpitch.m @@ -0,0 +1,36 @@ +% Copyright David Rowe 2009 +% This program is distributed under the terms of the GNU General Public License +% Version 2 +% +% plpitch.m +% Plots two pitch tracks on top of each other, used for comparing pitch +% estimators + +function plpitch(pitch1_name, pitch2_name, start_fr, end_fr) + + pitch1 = load(pitch1_name); + pitch2 = load(pitch2_name); + + st = 1; + en = length(pitch1); + if (nargin >= 3) + st = start_fr; + endif + if (nargin >= 4) + en = end_fr; + endif + + figure(1); + clg; + l1 = strcat("r;",pitch1_name,";") + l1 + st + en + plot(pitch1(st:en), l1); + axis([1 en-st 20 160]); + l2 = strcat("g;",pitch2_name,";"); + hold on; + plot(pitch2(st:en),l2); + hold off; +endfunction + -- 2.25.1