keys to show not masked points
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 3 Jan 2016 23:42:20 +0000 (23:42 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 3 Jan 2016 23:42:20 +0000 (23:42 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2602 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/newamp_fbf.m

index 891c6541a9ab01c0f06f7e344ed648d923f24794..b15b47b53b16326ef9d7d6860aa2fe1663745f13 100644 (file)
@@ -8,6 +8,8 @@
 % modelling model.
 %
 % Usage:
+%   Make sure codec2-dev is compiled with the -DDUMP option - see README for
+%    instructions.
 %   ~/codec2-dev/build_linux/src$ ./c2sim ../../raw/hts1a.raw --dump hts1a
 %   $ cd ~/codec2-dev/octave
 %   octave:14> newamp_fbf("../build_linux/src/hts1a",50)
@@ -16,6 +18,8 @@ function newamp_fbf(samname, f)
   
   more off;
   newamp;
+  phase_stuff = 0;
+  plot_not_masked = 0;
 
   sn_name = strcat(samname,"_sn.txt");
   Sn = load(sn_name);
@@ -60,7 +64,7 @@ function newamp_fbf(samname, f)
     % optionally show harmonics that are not masked
 
     not_masked_m = find(maskdB < AmdB);
-    if 0
+    if plot_not_masked
       plot(not_masked_m*Wo*4000/pi, 70*ones(1,length(not_masked_m)), 'bk+');
     end
 
@@ -111,23 +115,25 @@ function newamp_fbf(samname, f)
     ak_name = strcat(samname,"_ak.txt");
     ak = load(ak_name);
 
-    [phase Sdb s Aw] = determine_phase(model, f, ak(f,:));
-    figure(3)
-    subplot(211)
-    plot(Sdb)
-    title('Mag (dB)');
-    subplot(212)
-    plot(phase(1:256))
-    hold on;
-    plot(angle(Aw(1:256))+0.5,'g')
-    hold off;
-    title('Phase (rads)');
-    figure(4)
-    plot(s)
+    if phase_stuff
+      [phase Sdb s Aw] = determine_phase(model, f, ak(f,:));
+      figure(3)
+      subplot(211)
+      plot(Sdb)
+      title('Mag (dB)');
+      subplot(212)
+      plot(phase(1:256))
+      hold on;
+      plot(angle(Aw(1:256))+0.5,'g')
+      hold off;
+      title('Phase (rads)');
+      figure(4)
+      plot(s)
+    end
 
     % interactive menu
 
-    printf("\rframe: %d  menu: n-next  b-back  p-png  q-quit m-all", f);
+    printf("\rframe: %d  menu: n-next  b-back a-allmasks o-notmasked q-quit", f);
     fflush(stdout);
     k = kbhit();
     if (k == 'n')
@@ -143,6 +149,13 @@ function newamp_fbf(samname, f)
          plot_all_masks = 0;
       end
     end
+    if k == 'o'
+      if plot_not_masked == 0
+         plot_not_masked = 1;
+      else
+         plot_not_masked = 0;
+      end
+    end
   until (k == 'q')
   printf("\n");