Procházet zdrojové kódy

remove special case for A2B matrix calculation, normalize second order components of matrix separately

Fernando Pablo Lopez-Lezcano před 9 roky
rodič
revize
5adc6de099
1 změnil soubory, kde provedl 8 přidání a 12 odebrání
  1. 8 12
      calibration/src/sphear_calibration_common.m

+ 8 - 12
calibration/src/sphear_calibration_common.m

@@ -102,19 +102,15 @@ end
 function [A2B PV COND ERROR] = sphear_calculate_a2b(R)
   [A2B PV ERROR] = A2B_matrix(R);
   %% normalize matrix
-  A2B = A2B ./ mean(mean(abs(A2B)));
-  %% return condition number
-  COND = cond(A2B);
-end
-
-function [A2B PV COND ERROR] = sphear_octa_calculate_a2b(R, uv_factor)
-  [A2B PV ERROR] = A2B_octa_matrix(R);
-  %% normalize matrix
-  %
-  %% ignore anything above first order as that will be difference
-  %% microphones that will be low level in the reference frequency
-  %% range and will skew the mean
+  %%
+  %% normalize first order components of the matrix first
   A2B = A2B ./ mean(mean(abs(A2B(:,1:4))));
+  if (size(A2B, 2) > 4)
+    %% U/V are difference microphones, so at the reference
+    %% frequency range their signal is much lower than the
+    %% first order components, so normalize separately
+    A2B(:,5:6) = A2B(:,5:6) ./ mean(mean(abs(A2B(:,5:6))));
+  end
   %% return condition number
   COND = cond(A2B);
 end