Răsfoiți Sursa

try to optimize which directions to use for extracting the filter shapes from the B format power frequency response (not very clear for the 8 capsule array)

Fernando Pablo Lopez-Lezcano 9 ani în urmă
părinte
comite
ab544f172b
1 a modificat fișierele cu 50 adăugiri și 30 ștergeri
  1. 50 30
      calibration/src/sphear_calibration_common.m

+ 50 - 30
calibration/src/sphear_calibration_common.m

@@ -176,13 +176,6 @@ end
 %% Extract average shapes of B format filters
 %%
 
-%% assuming 16 measurements equally spaced around the microphone
-TETRA_CARDINALS = [1, 5, 9, 13];
-TETRA_DIAGONALS = [3, 7, 11, 15];
-
-OCTA_CARDINALS = [1, 3, 5, 7, 9, 11, 13, 15];
-OCTA_DIAGONALS = [2, 4, 6, 8, 10, 12, 14, 16];
-
 %% measurements:
 %% 0 -> use defaults
 %% 1 -> use all measurements
@@ -190,39 +183,66 @@ OCTA_DIAGONALS = [2, 4, 6, 8, 10, 12, 14, 16];
 %% 3 -> use diagonal measurements
 
 function [W X Y Z U V] = sphear_bf_extract_filter_shapes(B, measurements)
+  %% cardinal and diagonal directions for four capsule array
+  TETRA_CARDINALS = [1, 5, 9, 13];
+  TETRA_DIAGONALS = [3, 7, 11, 15];
+  %% cardinal and diagonal directions for eight capsule array
+  OCTA_CARDINALS = [1, 3, 5, 7, 9, 11, 13, 15];
+  OCTA_DIAGONALS = [2, 4, 6, 8, 10, 12, 14, 16];
+  %% best directions for octa WXY
+  OCTA_FLAT = OCTA_DIAGONALS;
+  OCTA_BRIGHT = OCTA_CARDINALS;
+  %% best directions for octa UV
+  U_DIRS = [1, 5, 9, 13];
+  V_DIRS = [3, 7, 11, 15];
+  %% all directions
+  ALL_DIRS = [1:16];
+
   if (measurements == 0)
+    %% cardinal directions
     if (size(B, 2) > 4)
-      W_m = [1, 3, 5, 7, 9, 11, 13, 15];
-      X_m = [4, 5, 6, 12, 13, 14];
-      Y_m = [16, 1, 2, 8, 9, 10];
+      %% 8 capsules
+      %% averaging all measurements for W seems to do better
+      W_m = OCTA_FLAT;
+      Y_m = OCTA_FLAT;
+      X_m = OCTA_FLAT;
       Z_m = W_m;
-      %%U_m = [1, 5, 9, 13];
-      %%V_m = [3, 7, 11, 15];
-      U_m = [1:16];
-      V_m = [1:16];
+      U_m = U_DIRS;
+      V_m = V_DIRS;
     else
-      W_m = [1, 5, 9, 13];
-      X_m = [1, 9];
-      Y_m = [5, 13];
+      %% four capsules
+      W_m = TETRA_CARDINALS;
+      X_m = TETRA_CARDINALS;
+      Y_m = TETRA_CARDINALS;
       Z_m = W_m;
-      U_m = [1, 5, 9, 13];
-      V_m = [3, 7, 11, 15];
     end
   else
     if (measurements == 1)
-      W_m = [1:16];
-      X_m = [1:16];
-      Y_m = [1:16];
-      Z_m = [1:16];
-      U_m = [1:16];
-      V_m = [1:16];
+      %% diagonal directions
+      if (size(B, 2) > 4)
+	%% 8 capsules
+	W_m = OCTA_BRIGHT;
+	Y_m = OCTA_BRIGHT;
+	X_m = OCTA_BRIGHT;
+	Z_m = W_m;
+	U_m = U_DIRS;
+	V_m = V_DIRS;
+      else
+	%% four capsules
+	W_m = TETRA_DIAGONALS;
+	X_m = TETRA_DIAGONALS;
+	Y_m = TETRA_DIAGONALS;
+	Z_m = W_m;
+      end
     else
       if (measurements == 2)
-	W_m = [1, 5, 9, 13];
-	X_m = [1, 5, 9, 13];
-	Y_m = [1, 5, 9, 13];
-	Z_m = [1, 5, 9, 13];
-      else
+	%% average all measurements for all components
+	W_m = ALL_DIRS;
+	X_m = ALL_DIRS;
+	Y_m = ALL_DIRS;
+	Z_m = ALL_DIRS;
+	U_m = ALL_DIRS;
+	V_m = ALL_DIRS;
       end
     end
   end