comparison trunk/matlab/bmm/carfac/CARFAC_Close_AGC_Loop.m @ 534:95a11cca4619

Add CARFAC_Design_Doc.txt, CARFAC_Run_Segment.m, and some renames; rename various variables to be more parallel; clean up init code and such.
author dicklyon@google.com
date Fri, 16 Mar 2012 04:19:24 +0000
parents fb60ea429bb8
children 3dff17554c6d
comparison
equal deleted inserted replaced
533:55c46c01e522 534:95a11cca4619
21 % function CF = CARFAC_Close_AGC_Loop(CF) 21 % function CF = CARFAC_Close_AGC_Loop(CF)
22 22
23 % fastest decimated rate determines interp needed: 23 % fastest decimated rate determines interp needed:
24 decim1 = CF.AGC_params.decimation(1); 24 decim1 = CF.AGC_params.decimation(1);
25 25
26 for mic = 1:CF.n_mics 26 for ear = 1:CF.n_ears
27 extra_damping = CF.AGC_state(mic).AGC_memory(:, 1); % stage 1 result 27 extra_damping = CF.AGC_state(ear).AGC_memory(:, 1); % stage 1 result
28 % Update the target stage gain for the new damping: 28 % Update the target stage gain for the new damping:
29 new_g = CARFAC_Stage_g(CF.filter_coeffs(mic), extra_damping); 29 new_g = CARFAC_Stage_g(CF.CAR_coeffs, extra_damping);
30 % set the deltas needed to get to the new damping: 30 % set the deltas needed to get to the new damping:
31 CF.filter_state(mic).dzB_memory = ... 31 CF.CAR_state(ear).dzB_memory = ...
32 (extra_damping - CF.filter_state(mic).zB_memory) / decim1; 32 (extra_damping - CF.CAR_state(ear).zB_memory) / decim1;
33 CF.filter_state(mic).dg_memory = ... 33 CF.CAR_state(ear).dg_memory = ...
34 (new_g - CF.filter_state(mic).g_memory) / decim1; 34 (new_g - CF.CAR_state(ear).g_memory) / decim1;
35 end 35 end