matlab UI to debug pitch estimator
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 8 Sep 2009 04:40:09 +0000 (04:40 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 8 Sep 2009 04:40:09 +0000 (04:40 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@42 01035d8c-6547-0410-b346-abe4f91aad63

codec2/octave/plamp.m
codec2/octave/plpitch.m [new file with mode: 0644]

index 223dfb9fe3c0bbeda567d8438d9ffa7dfabf9257..cf7618cef12e6725a3ac594f132b935e1913f1c4 100644 (file)
@@ -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 (file)
index 0000000..c335d8f
--- /dev/null
@@ -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
+