diff matlab/bmm/carfac/CARFAC_IHCStep.m @ 462:87699cb4cf71

Major AGC improvements mostly
author dicklyon@google.com
date Thu, 01 Mar 2012 19:49:24 +0000
parents f8ba7ad93fa9
children
line wrap: on
line diff
--- a/matlab/bmm/carfac/CARFAC_IHCStep.m	Mon Feb 27 21:50:20 2012 +0000
+++ b/matlab/bmm/carfac/CARFAC_IHCStep.m	Thu Mar 01 19:49:24 2012 +0000
@@ -27,11 +27,11 @@
 
 if just_hwr
   ihc_out = max(0, filters_out);
-  state.ihc_accum = state.ihc_accum + max(0, ihc_out);
+  state.ihc_accum = state.ihc_accum + ihc_out;
 else
   one_cap = coeffs.one_cap;
 
-  detect = CARFAC_Detect(filters_out/2);  % detect with HWR or so
+  detect = CARFAC_Detect(filters_out);  % detect with HWR or so
 
   if one_cap
     ihc_out = detect .* state.cap_voltage;
@@ -56,7 +56,7 @@
   state.lpf2_state = state.lpf2_state + coeffs.lpf_coeff * ...
     (state.lpf1_state - state.lpf2_state);
 
-  ihc_out = state.lpf2_state;
+  ihc_out = state.lpf2_state - coeffs.rest_output;
 
-  state.ihc_accum = state.ihc_accum + max(0, ihc_out - coeffs.rest_output);
+  state.ihc_accum = state.ihc_accum + max(0, ihc_out);
 end