diff matlab/bmm/carfac/CARFAC_Close_AGC_Loop.m @ 504:a0869cb1c99b

Major update to how the DOHC works; like in recent book OHC chapter; Design Doc update (a bit)
author dicklyon@google.com
date Thu, 24 May 2012 22:26:56 +0000
parents 896620d9d539
children b3118c9ed67f
line wrap: on
line diff
--- a/matlab/bmm/carfac/CARFAC_Close_AGC_Loop.m	Sat May 12 04:31:59 2012 +0000
+++ b/matlab/bmm/carfac/CARFAC_Close_AGC_Loop.m	Thu May 24 22:26:56 2012 +0000
@@ -24,12 +24,13 @@
 decim1 = CF.AGC_params.decimation(1);
 
 for ear = 1:CF.n_ears
-  extra_damping = CF.ears(ear).AGC_state.AGC_memory(:, 1);  % stage 1 result
+  undamping = 1 - CF.ears(ear).AGC_state.AGC_memory(:, 1); % stage 1 result
   % Update the target stage gain for the new damping:
-  new_g = CARFAC_Stage_g(CF.ears(ear).CAR_coeffs, extra_damping);
+  new_g = CARFAC_Stage_g(CF.ears(ear).CAR_coeffs, undamping);
   % set the deltas needed to get to the new damping:
   CF.ears(ear).CAR_state.dzB_memory = ...
-    (extra_damping - CF.ears(ear).CAR_state.zB_memory) / decim1;
+    (CF.ears(ear).CAR_coeffs.zr_coeffs .* undamping - ...
+    CF.ears(ear).CAR_state.zB_memory) / decim1;
   CF.ears(ear).CAR_state.dg_memory = ...
     (new_g - CF.ears(ear).CAR_state.g_memory) / decim1;
 end