Sfoglia il codice sorgente

fix some plot options

Fernando Pablo Lopez-Lezcano 7 anni fa
parent
commit
9205ea45e6
1 ha cambiato i file con 20 aggiunte e 8 eliminazioni
  1. 20 8
      calibration/src/sphear_capsule_plot_frequency_response.m

+ 20 - 8
calibration/src/sphear_capsule_plot_frequency_response.m

@@ -48,12 +48,20 @@ function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fm
 	sfft(m,c,:) = fastsmooth(20*log10(abs(fft(SIG(m,c,:), fft_size))), smooth, 2, 1);
       else
 	sfft(m,c,:) = 20*log10(abs(fft(SIG(m,c,:), fft_size)));
+
+	%% print peaks...
+%%	[amps, locs] = sphear_findpeaks(reshape(sfft(m,c,:), [], 1), 12);
+%%	for l = 1:numel(locs)
+%%	  if ((locs(l) > 3000) && (locs(l) < 6000) && (amps(l) > -25))
+%%	    printf("c:%d m:%d  a=%f, l=%f\n", c, m, amps(l), locs(l));
+%%	  end
+%%	end
+
       end
     end
     %% color plot
     copts = ['k', 'r', 'b', 'g', ':g', ':b', ':r', ':k'];
     cext = "_color";
-
     f = figure;
     hold on;
     title(sprintf("capsule %d", c), "fontweight", "bold", "fontsize", 16);
@@ -63,17 +71,18 @@ function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fm
     tics('y', [6, 3, 0, -3, -6, -9, -12, -15, -20, -25, -30, -40, -50]);
     tics('x', [300, 500, 1000, 2000, 3000, 5000, 7000, 10000, 15000, 20000]);
     ca=get (gcf, "currentaxes");
-    set(ca,"fontweight","bold","linewidth",1.5)
+    set(ca,"fontweight","bold","linewidth",1.25)
     pbaspect([16, 9, 1])
+    mi = 1;
     for m = measurements
-      angle = 360 / 16 * (m - 1);
-      if (m == 1)
+      angle = 360 / 16 * (mi - 1);
+      if (mi == 1)
 	col = "k";
       else
-	if (m < 8)
+	if (mi < 8)
 	  col = "r";
 	else
-	  if (m == 9)
+	  if (mi == 9)
 	    col = "g";
 	  else
 	    col = "b";
@@ -82,9 +91,12 @@ function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fm
       end
       fidx=500 * (1.075^m);
       idx=round(fft_size/fmax*fidx/2);
-      semilogx(fr, sfft(m,c,1:end/2), col, "linewidth", 1.5);
-      text(fidx, sfft(m,c,idx), sprintf("%d:%d @ %.2f", m, angle, sfft(m,c,idx)),
+      semilogx(fr, sfft(m,c,1:end/2), col, "linewidth", 1.25);
+      text(fidx, sfft(mi,c,idx) / 1.02, sprintf("%d:%d", m, angle),
 	   "fontweight", "bold", "fontsize", 12, "verticalalignment", "baseline", "color", col);
+%%      text(fidx, sfft(mi,c,idx), sprintf("%d:%d @ %.2f", mi, angle, sfft(mi,c,idx)),
+%%	   "fontweight", "bold", "fontsize", 12, "verticalalignment", "baseline", "color", col);
+      mi = mi + 1;
     end
     hold off;
   end