Mercurial > hg > aimc
comparison trunk/matlab/bmm/carfac/CARFAC_Design.m @ 617:2767ce76a1b0
Minor tweaks to AGC params, state update, and hacking script.
author | dicklyon@google.com |
---|---|
date | Thu, 09 May 2013 18:24:51 +0000 |
parents | 101289a936be |
children | d0ff15c36828 |
comparison
equal
deleted
inserted
replaced
616:f0d5975f541c | 617:2767ce76a1b0 |
---|---|
69 CF_AGC_params = struct( ... | 69 CF_AGC_params = struct( ... |
70 'n_stages', 4, ... | 70 'n_stages', 4, ... |
71 'time_constants', [1, 4, 16, 64]*0.002, ... | 71 'time_constants', [1, 4, 16, 64]*0.002, ... |
72 'AGC_stage_gain', 2, ... % gain from each stage to next slower stage | 72 'AGC_stage_gain', 2, ... % gain from each stage to next slower stage |
73 'decimation', [8, 2, 2, 2], ... % how often to update the AGC states | 73 'decimation', [8, 2, 2, 2], ... % how often to update the AGC states |
74 'AGC1_scales', [1.0, 1.4, 2.0, 2.8], ... % in units of channels | 74 'AGC1_scales', [1.0, 1.4, 2.0, 2.8]*1.0, ... % in units of channels |
75 'AGC2_scales', [1.6, 2.25, 3.2, 4.5], ... % spread more toward base | 75 'AGC2_scales', [1.0, 1.4, 2.0, 2.8]*1.65, ... % spread more toward base |
76 'AGC_mix_coeff', 0.5); | 76 'AGC_mix_coeff', 0.5); |
77 end | 77 end |
78 | 78 |
79 if nargin < 5 | 79 if nargin < 5 |
80 % HACK: these constant control the defaults | 80 % HACK: these constant control the defaults |
81 one_cap = 0; % bool; 0 for new two-cap hack | 81 one_cap = 1; % bool; 1 for Allen model, as text states we use |
82 just_hwr = 0; % book; 0 for normal/fancy IHC; 1 for HWR | 82 just_hwr = 0; % book; 0 for normal/fancy IHC; 1 for HWR |
83 if just_hwr | 83 if just_hwr |
84 CF_IHC_params = struct('just_hwr', 1, ... % just a simple HWR | 84 CF_IHC_params = struct('just_hwr', 1, ... % just a simple HWR |
85 'ac_corner_Hz', 20); | 85 'ac_corner_Hz', 20); |
86 else | 86 else |
414 | 414 |
415 %% | 415 %% |
416 % default design result, running this function with no args, should look | 416 % default design result, running this function with no args, should look |
417 % like this, before CARFAC_Init puts state storage into it: | 417 % like this, before CARFAC_Init puts state storage into it: |
418 % | 418 % |
419 % | 419 |
420 % CF = CARFAC_Design | 420 % CF = CARFAC_Design |
421 % CAR_params = CF.CAR_params | 421 % CAR_params = CF.CAR_params |
422 % AGC_params = CF.AGC_params | 422 % AGC_params = CF.AGC_params |
423 % IHC_params = CF.IHC_params | 423 % IHC_params = CF.IHC_params |
424 % CAR_coeffs = CF.ears(1).CAR_coeffs | 424 % CAR_coeffs = CF.ears(1).CAR_coeffs |
452 % n_stages: 4 | 452 % n_stages: 4 |
453 % time_constants: [0.0020 0.0080 0.0320 0.1280] | 453 % time_constants: [0.0020 0.0080 0.0320 0.1280] |
454 % AGC_stage_gain: 2 | 454 % AGC_stage_gain: 2 |
455 % decimation: [8 2 2 2] | 455 % decimation: [8 2 2 2] |
456 % AGC1_scales: [1 1.4000 2 2.8000] | 456 % AGC1_scales: [1 1.4000 2 2.8000] |
457 % AGC2_scales: [1.6000 2.2500 3.2000 4.5000] | 457 % AGC2_scales: [1.6500 2.3100 3.3000 4.6200] |
458 % AGC_mix_coeff: 0.5000 | 458 % AGC_mix_coeff: 0.5000 |
459 % IHC_params = | 459 % IHC_params = |
460 % just_hwr: 0 | 460 % just_hwr: 0 |
461 % one_cap: 0 | 461 % one_cap: 1 |
462 % tau_lpf: 8.0000e-05 | 462 % tau_lpf: 8.0000e-05 |
463 % tau1_out: 0.0100 | 463 % tau_out: 5.0000e-04 |
464 % tau1_in: 0.0200 | 464 % tau_in: 0.0100 |
465 % tau2_out: 0.0025 | |
466 % tau2_in: 0.0050 | |
467 % ac_corner_Hz: 20 | 465 % ac_corner_Hz: 20 |
468 % CAR_coeffs = | 466 % CAR_coeffs = |
469 % n_ch: 71 | 467 % n_ch: 71 |
470 % velocity_scale: 0.0500 | 468 % velocity_scale: 0.1000 |
471 % v_offset: 0.0400 | 469 % v_offset: 0.0400 |
472 % v2_corner: 0.2000 | |
473 % r1_coeffs: [71x1 double] | 470 % r1_coeffs: [71x1 double] |
474 % a0_coeffs: [71x1 double] | 471 % a0_coeffs: [71x1 double] |
475 % c0_coeffs: [71x1 double] | 472 % c0_coeffs: [71x1 double] |
476 % h_coeffs: [71x1 double] | 473 % h_coeffs: [71x1 double] |
477 % g0_coeffs: [71x1 double] | 474 % g0_coeffs: [71x1 double] |
480 % n_ch: 71 | 477 % n_ch: 71 |
481 % n_AGC_stages: 4 | 478 % n_AGC_stages: 4 |
482 % AGC_stage_gain: 2 | 479 % AGC_stage_gain: 2 |
483 % AGC_epsilon: [0.1659 0.0867 0.0443 0.0224] | 480 % AGC_epsilon: [0.1659 0.0867 0.0443 0.0224] |
484 % decimation: [8 2 2 2] | 481 % decimation: [8 2 2 2] |
485 % AGC_polez1: [0.1699 0.1780 0.1872 0.1903] | 482 % AGC_polez1: [0.1737 0.1818 0.1921 0.1948] |
486 % AGC_polez2: [0.2388 0.2271 0.2216 0.2148] | 483 % AGC_polez2: [0.2472 0.2336 0.2288 0.2207] |
487 % AGC_spatial_iterations: [1 1 1 1] | 484 % AGC_spatial_iterations: [1 1 1 1] |
488 % AGC_spatial_FIR: [3x4 double] | 485 % AGC_spatial_FIR: [3x4 double] |
489 % AGC_spatial_n_taps: [3 3 3 3] | 486 % AGC_spatial_n_taps: [3 3 3 3] |
490 % AGC_mix_coeffs: [0 0.0454 0.0227 0.0113] | 487 % AGC_mix_coeffs: [0 0.0454 0.0227 0.0113] |
491 % AGC_gain: 15 | 488 % AGC_gain: 15 |
492 % detect_scale: 0.0667 | 489 % detect_scale: 0.0667 |
493 % AGC_spatial_FIR = | 490 % AGC_spatial_FIR = |
494 % 0.2744 0.2829 0.2972 0.2999 | 491 % 0.2856 0.2930 0.3099 0.3111 |
495 % 0.3423 0.3571 0.3512 0.3616 | 492 % 0.3108 0.3314 0.3212 0.3365 |
496 % 0.3832 0.3600 0.3516 0.3385 | 493 % 0.4036 0.3756 0.3689 0.3524 |
497 % IHC_coeffs = | 494 % IHC_coeffs = |
498 % n_ch: 71 | 495 % n_ch: 71 |
499 % just_hwr: 0 | 496 % just_hwr: 0 |
500 % lpf_coeff: 0.4327 | 497 % lpf_coeff: 0.4327 |
501 % out1_rate: 0.0045 | 498 % out_rate: 0.0996 |
502 % in1_rate: 0.0023 | 499 % in_rate: 0.0045 |
503 % out2_rate: 0.0199 | 500 % one_cap: 1 |
504 % in2_rate: 0.0091 | 501 % output_gain: 49.3584 |
505 % one_cap: 0 | 502 % rest_output: 1.0426 |
506 % output_gain: 12.1185 | 503 % rest_cap: 0.5360 |
507 % rest_output: 0.3791 | |
508 % rest_cap2: 0.7938 | |
509 % rest_cap1: 0.8625 | |
510 % ac_coeff: 0.0057 | 504 % ac_coeff: 0.0057 |
511 | |
512 | |
513 |