From: drowe67 Date: Sat, 27 Nov 2010 00:11:00 +0000 (+0000) Subject: minor mods to lsp pdf and plamp scripts X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=b65396d2615dfc64295e4e82419a9dd6d0effbab;p=freetel-svn-tracking.git minor mods to lsp pdf and plamp scripts git-svn-id: https://svn.code.sf.net/p/freetel/code@253 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2/octave/lsp_pdf.m b/codec2/octave/lsp_pdf.m index 28184096..b54127fd 100644 --- a/codec2/octave/lsp_pdf.m +++ b/codec2/octave/lsp_pdf.m @@ -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 diff --git a/codec2/octave/plamp.m b/codec2/octave/plamp.m index dc4682ea..b8c471d3 100644 --- a/codec2/octave/plamp.m +++ b/codec2/octave/plamp.m @@ -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')