diff trunk/matlab/bmm/carfac/CARFAC_Design.m @ 560:ab7fabe2af5d

fix some bugs I left in IHC one-cap and just-hwr modes
author dicklyon@google.com
date Mon, 23 Apr 2012 21:02:04 +0000
parents 89b1fe5de60f
children 3dff17554c6d
line wrap: on
line diff
--- a/trunk/matlab/bmm/carfac/CARFAC_Design.m	Tue Apr 10 05:40:18 2012 +0000
+++ b/trunk/matlab/bmm/carfac/CARFAC_Design.m	Mon Apr 23 21:02:04 2012 +0000
@@ -333,8 +333,9 @@
 function IHC_coeffs = CARFAC_DesignIHC(IHC_params, fs, n_ch)
 
 if IHC_params.just_hwr
-  IHC_coeffs = struct('just_hwr', 1);
-  saturation_output = 10;  % HACK: assume some max out
+    IHC_coeffs = struct( ...
+      'n_ch', n_ch, ...
+      'just_hwr', 1);
 else
   if IHC_params.one_cap
     ro = 1 / CARFAC_Detect(2);  % output resistance
@@ -346,7 +347,6 @@
     r0 = 1 / CARFAC_Detect(0);
     current = 1 / (ri + r0);
     cap_voltage = 1 - current * ri;
-      IHC_coeffs.rest_output = IHC_out;
     IHC_coeffs = struct( ...
       'n_ch', n_ch, ...
       'just_hwr', 0, ...
@@ -362,7 +362,8 @@
       'cap_voltage', IHC_coeffs.rest_cap, ...
       'lpf1_state', 0, ...
       'lpf2_state', 0, ...
-      'ihc_accum', 0);  else
+      'ihc_accum', 0);  
+  else
     ro = 1 / CARFAC_Detect(2);  % output resistance
     c2 = IHC_params.tau2_out / ro;
     r2 = IHC_params.tau2_in / c2;