Răsfoiți Sursa

small changes to support Octathingy calibration and second order horizontal Ambisonics

Fernando Pablo Lopez-Lezcano 9 ani în urmă
părinte
comite
26af985aef

+ 6 - 6
calibration/src/sphear_bf_plot.m

@@ -39,20 +39,20 @@ function [BF] = sphear_bf_plot(BF, fmin, fmax, rmax, cardioid = 0)
   %% to close the polar plots we repeat the first point
   m = size(BF, 1);
   n = 32;
-  BF(m + 1,:) = BF(1,:);
+  BF(m + 1,:,:) = BF(1,:,:);
   theta = (0:m)*(2*pi/m);
   thetaf = (0:n)*(2*pi/n);
-  
+
   %% plot it as a function of angle
   if (cardioid)
-    bname = cellstr(['W'; 'X'; 'Y'; 'Cardioid']);
+    bname = cellstr(['W'; 'X'; 'Y'; 'Cardioid'; 'U'; 'V']);
   else
-    bname = cellstr(['W'; 'X'; 'Y'; 'Z']);
+    bname = cellstr(['W'; 'X'; 'Y'; 'Z'; 'U'; 'V']);
   end
 
   f = figure;
-  for b = 1:4
-    subplot(2, 2, b);
+  for b = 1:size(BF, 2)
+    subplot(2, 3, b);
     hold on;
     grid off;
     axis square;

+ 9 - 3
calibration/src/sphear_bf_plot_frequency_response.m

@@ -49,9 +49,9 @@ function [] = sphear_bf_plot_frequency_response(BF, fmin, fmax, ymin, ymax, Fs,
     end
   end
 
-  for m = 1:16
+  for m = 1:size(BF, 1)
     %% calculate B format frequency responses
-    for b = 1:4
+    for b = 1:size(BF, 2)
       if (smooth > 0)
 	bfft(m,b,:) = fastsmooth(20*log10(abs(fft(BF(m,b,:), Nfft))), smooth, 2, 1);
       else
@@ -95,7 +95,13 @@ function [] = sphear_bf_plot_frequency_response(BF, fmin, fmax, ymin, ymax, Fs,
       semilogx(fr, bfft(m,2,1:end/2), xopts, "linewidth", 1.5);
       semilogx(fr, bfft(m,3,1:end/2), yopts, "linewidth", 1.5);
       semilogx(fr, bfft(m,4,1:end/2), zopts, "linewidth", 1.5);
-      l = legend('W', 'X', 'Y', 'Z');
+      if (size(BF, 2) > 4)
+	semilogx(fr, bfft(m,5,1:end/2), 'r--;U;', "linewidth", 1.5);
+	semilogx(fr, bfft(m,6,1:end/2), 'b--;V;', "linewidth", 1.5);
+	l = legend('W', 'X', 'Y', 'Z', 'U', 'V');
+      else
+	l = legend('W', 'X', 'Y', 'Z');
+      end
       legend(l, 'location', 'west');
       hold off;
       if (strcmp(plot_on, 'eps') || strcmp(plot_on, 'epsc') || plot_on == 1)