Sfoglia il codice sorgente

cal: some fixes and additions when plotting capsule frequency response

Fernando Pablo Lopez-Lezcano 8 anni fa
parent
commit
8c7d8df336

+ 6 - 3
calibration/src/sphear_capsule_plot_frequency_response.m

@@ -56,11 +56,9 @@ function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fm
 
     f = figure;
     hold on;
+    title(sprintf("capsule %d", c), "fontweight", "bold", "fontsize", 16);
     fr = (1:fft_size/2) * FS/fft_size;
     grid on;
-    angle = 360 / 16 * (m - 1);
-    %% we add the title as a subfigure in the paper
-    %% title(sprintf("azimuth = %.1f degrees", angle));
     axis([fmin, fmax, ymin, ymax]);
     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]);
@@ -68,6 +66,7 @@ function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fm
     set(ca,"fontweight","bold","linewidth",1.5)
     pbaspect([16, 9, 1])
     for m = measurements
+      angle = 360 / 16 * (m - 1);
       if (m == 1)
 	col = "k";
       else
@@ -81,7 +80,11 @@ function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fm
 	  end
 	end
       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)),
+	   "fontweight", "bold", "fontsize", 12, "verticalalignment", "baseline", "color", col);
     end
     hold off;
   end