small mods to octave scripts
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 13 Feb 2012 01:14:56 +0000 (01:14 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 13 Feb 2012 01:14:56 +0000 (01:14 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@315 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/phase2.m
codec2-dev/octave/pllsp.m

index ea58dcbe11c79f748250680febe0e0a14642ef7a..fc9462b506e0e98da218304d2907df7be3677a6e 100644 (file)
@@ -7,21 +7,17 @@ function phase2(samname, png)
   N = 16000;
 
   f=45;
-  model = load("../src/hts1a_model.txt");
+  model = load("../src/hts1a_phase_model.txt");
   phase = load("../src/hts1a_phase_phase.txt");
   Wo = model(f,1);
   P=2*pi/Wo;
   L = model(f,2);
   A = model(f,3:(L+2));
   phi = phase(f,1:L);
-  phi = zeros(1,L);
-  for m=L/2:L
-    phi(m) = 2*pi*rand(1,1);
-  end
 
   s = zeros(1,N);
 
-  for m=1:L
+  for m=1:L/2
     s_m = A(m)*cos(m*Wo*(0:(N-1)) + phi(m));
     s = s + s_m;
   endfor
index 15da6748c27e7f27d1e4b5ce8fb3a5c6590570db..0606d3cab6c0c469610022e931539f315d487660 100644 (file)
@@ -31,16 +31,16 @@ function pllsp(rawfile,
 
   figure(1);
   clf;
-  %subplot(211);
+  subplot(211);
   sp = s((start_f-2)*80:(end_f-2)*80);
   plot(sp);
 
-  %subplot(212);
-  %plot(lpc10_snr((start_f+1):end_f)-lsp_snr((start_f+1):end_f));
+  subplot(212);
+  plot(lpc10_snr((start_f+1):end_f)-lsp_snr((start_f+1):end_f));
 
   figure(2);
   plot((4000/pi)*lsp((start_f+1):end_f,:));
   hold on;
-  plot((4000/pi)*lsp_((start_f+1):end_f,:));
+  plot((4000/pi)*lsp_((start_f+1):end_f,:),'+-');
   hold off;
 endfunction