minor mods to lsp pdf and plamp scripts
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 27 Nov 2010 00:11:00 +0000 (00:11 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 27 Nov 2010 00:11:00 +0000 (00:11 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@253 01035d8c-6547-0410-b346-abe4f91aad63

codec2/octave/lsp_pdf.m
codec2/octave/plamp.m

index 28184096013d3f75113c98c1e136787a03d51778..b54127fd85baf89aa441b2026495ee1602e5ecb8 100644 (file)
@@ -7,7 +7,7 @@ function lsp_pdf(lsp)
 
   % LSPs
 
-  figure(3);
+  figure(1);
   clf;
   [x,y] = hist(lsp(:,1),100);
   plot(y*4000/pi,x,";1;");
@@ -26,7 +26,7 @@ function lsp_pdf(lsp)
 
   % LSP differences
 
-  figure(4);
+  figure(2);
   clf;
   subplot(211)
   [x,y] = hist(lsp(:,1),100);
@@ -51,4 +51,36 @@ function lsp_pdf(lsp)
   endfor
   hold off;
   grid;
+
+  % LSP differences delta from last frame
+
+  lspd(:,1) = lsp(:,1);
+  lspd(:,2:10) = lsp(:,2:10) - lsp(:,1:9);
+
+  [m,n] = size(lspd);
+  lspdd = lspd(5:m,:) -  lspd(1:m-4,:);
+  
+  figure(3);
+  clf;
+  subplot(211)
+  for i=1:5
+    [x,y] = hist(lspdd(:,i),100);
+    legend = sprintf("%d;%d;",i,i);
+    plot(y*4000/pi,x,legend);
+    hold on;
+  endfor
+  hold off;
+  grid;
+  axis([-200 200 0 35000]);
+
+  subplot(212)
+  for i=6:10
+    [x,y] = hist(lspdd(:,i),100);
+    legend = sprintf("%d;%d;",i-5,i);
+    plot(y*4000/pi,x,legend);
+    hold on;
+  endfor
+  hold off;
+  grid;
+  axis([-200 200 0 16000]);
 endfunction
index dc4682ea8343962821febbe1faa9cba5f3d24d15..b8c471d399767689224fb209965dd7cdd8112991 100644 (file)
@@ -79,9 +79,12 @@ function plamp(samname, f)
     hold on;
 %    plot((0:255)*4000/256, Sw(f-2,:),";Sw;");
     plot((0:255)*4000/256, Sw(f,:),";Sw;");
-    plot((0:255)*4000/256, Sw_(f,:),";Sw_;g");
-    if (Ew_on == 1)
-        plot((0:255)*4000/256, Ew(f,:),";Ew_;r");
+    
+    if (file_in_path(".",sw__name))
+       plot((0:255)*4000/256, Sw_(f,:),";Sw_;g");
+       if (Ew_on == 1)
+          plot((0:255)*4000/256, Ew(f,:),";Ew_;r");
+       endif
     endif
  
     if (file_in_path(".",modelq_name))
@@ -179,7 +182,7 @@ function plamp(samname, f)
       pngname = sprintf("%s_%d_sw.png",samname,f);
       print(pngname, '-dpng', "-S500,500")
       pngname = sprintf("%s_%d_sw_large.png",samname,f);
-      print(pngname, '-dpng', "-S800,600")
+      print(pngname, '-dpng', "-S1200,800")
     endif
 
   until (k == 'q')