comparison trunk/matlab/bmm/carfac/CARFAC_Design.m @ 559:89b1fe5de60f

Simplify AGC_Step, moving multi-aural cross coupling to new function CARFAC_Cross_Couple
author dicklyon@google.com
date Tue, 10 Apr 2012 05:40:18 +0000
parents 910efa18d8f5
children ab7fabe2af5d
comparison
equal deleted inserted replaced
558:8ca6eb401a03 559:89b1fe5de60f
149 'v_offset', CAR_params.v_offset, ... 149 'v_offset', CAR_params.v_offset, ...
150 'v2_corner', CAR_params.v2_corner, ... 150 'v2_corner', CAR_params.v2_corner, ...
151 'v_damp_max', CAR_params.v_damp_max ... 151 'v_damp_max', CAR_params.v_damp_max ...
152 ); 152 );
153 153
154 % don't really need these zero arrays, but it's a clue to what fields
155 % and types are need in ohter language implementations:
154 CAR_coeffs.r1_coeffs = zeros(n_ch, 1); 156 CAR_coeffs.r1_coeffs = zeros(n_ch, 1);
155 CAR_coeffs.a0_coeffs = zeros(n_ch, 1); 157 CAR_coeffs.a0_coeffs = zeros(n_ch, 1);
156 CAR_coeffs.c0_coeffs = zeros(n_ch, 1); 158 CAR_coeffs.c0_coeffs = zeros(n_ch, 1);
157 CAR_coeffs.h_coeffs = zeros(n_ch, 1); 159 CAR_coeffs.h_coeffs = zeros(n_ch, 1);
158 CAR_coeffs.g0_coeffs = zeros(n_ch, 1); 160 CAR_coeffs.g0_coeffs = zeros(n_ch, 1);
211 'n_ch', n_ch, ... 213 'n_ch', n_ch, ...
212 'n_AGC_stages', n_AGC_stages, ... 214 'n_AGC_stages', n_AGC_stages, ...
213 'AGC_stage_gain', AGC_params.AGC_stage_gain); 215 'AGC_stage_gain', AGC_params.AGC_stage_gain);
214 216
215 % AGC1 pass is smoothing from base toward apex; 217 % AGC1 pass is smoothing from base toward apex;
216 % AGC2 pass is back, which is done first now 218 % AGC2 pass is back, which is done first now (in double exp. version)
217 AGC1_scales = AGC_params.AGC1_scales; 219 AGC1_scales = AGC_params.AGC1_scales;
218 AGC2_scales = AGC_params.AGC2_scales; 220 AGC2_scales = AGC_params.AGC2_scales;
219 221
220 AGC_coeffs.AGC_epsilon = zeros(1, n_AGC_stages); % the 1/(tau*fs) roughly 222 AGC_coeffs.AGC_epsilon = zeros(1, n_AGC_stages); % the 1/(tau*fs) roughly
221 decim = 1; 223 decim = 1;
291 293
292 AGC_coeffs.AGC_gain = total_DC_gain; 294 AGC_coeffs.AGC_gain = total_DC_gain;
293 295
294 % adjust the detect_scale by the total DC gain of the AGC filters: 296 % adjust the detect_scale by the total DC gain of the AGC filters:
295 AGC_coeffs.detect_scale = AGC_params.detect_scale / total_DC_gain; 297 AGC_coeffs.detect_scale = AGC_params.detect_scale / total_DC_gain;
296
297 298
298 % % print some results 299 % % print some results
299 AGC_coeffs 300 AGC_coeffs
300 AGC_spatial_FIR = AGC_coeffs.AGC_spatial_FIR 301 AGC_spatial_FIR = AGC_coeffs.AGC_spatial_FIR
301 AGC_spatial_iterations = AGC_coeffs.AGC_spatial_iterations 302 AGC_spatial_iterations = AGC_coeffs.AGC_spatial_iterations