figure(1);
clf;
[x,y] = hist(lsp(:,1),100);
- plot(y*4000/pi,x,";1;");
+ plot(y*4000/pi,x,"+;1;");
hold on;
- for i=2:c
+ for i=2:5
+ [x,y] = hist(lsp(:,i),100);
+ legend = sprintf("+%d;%d;",i,i);
+ plot(y*4000/pi,x,legend);
+ endfor
+ for i=6:c
[x,y] = hist(lsp(:,i),100);
- if (mod(i,2))
- legend = sprintf(";%d;",i);
- else
- legend = sprintf("1;%d;",i);
- endif
+ legend = sprintf("+%d;%d;",i-5,i);
plot(y*4000/pi,x,legend);
endfor
hold off;
hold off;
grid;
axis([-200 200 0 16000]);
+
+ figure(4);
+ clf;
+ plot((4000/pi)*(lsp(2:r,3)-lsp(1:r-1,3)))
endfunction
% This program is distributed under the terms of the GNU General Public License
% Version 2
%
-% Plots a bunch of information realted to LSP quantisation:
+% Plots a bunch of information related to LSP quantisation:
% - speech file
% - LSPs before and after quantisation
% - SNR for each frame
% Note: there is a 160 sample (two frame delay) from the when a sample
% enters the input buffer until it is at the centre of the analysis window
-function pl(rawfile,
- dumpfile_prefix_lpc_only,
- dumpfile_prefix_lsp,
- start_f, end_f)
+function pllsp(rawfile,
+ dumpfile_prefix_lpc_only,
+ dumpfile_prefix_lsp,
+ start_f, end_f)
fs=fopen(rawfile,"rb");
s=fread(fs,Inf,"short");
--- /dev/null
+% pllspdt.m
+% Copyright David Rowe 2010
+% This program is distributed under the terms of the GNU General Public License
+% Version 2
+%
+% Test script to plot differences in LSps between frames
+
+function pllspdt(rawfile,dumpfile_prefix_lsp,lspn, start_f, end_f)
+
+ fs=fopen(rawfile,"rb");
+ s=fread(fs,Inf,"short");
+
+ lsp_name = strcat(dumpfile_prefix_lsp,"_lsp.txt");
+ lsps = load(lsp_name);
+ [m,n]=size(lsps);
+ lsp = lsps(1:2:m,:);
+ lsp_ = lsps(2:2:m,:);
+ lspdt = lsp(2:m/2,:) - lsp(1:m/2-1,:);
+
+ figure(1);
+ clf;
+ sp = s((start_f-2)*80:(end_f-2)*80);
+ plot(sp);
+
+ figure(2);
+ plot((4000/pi)*lspdt((start_f+1):end_f,lspn));
+endfunction