comparison trunk/matlab/bmm/carfac/CARFAC_Transfer_Functions.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 55c46c01e522
children 3dff17554c6d
comparison
equal deleted inserted replaced
533:55c46c01e522 534:95a11cca4619
100 % function [stage_z_numerators, stage_z_denominators] = ... 100 % function [stage_z_numerators, stage_z_denominators] = ...
101 % CARFAC_Rational_Functions(CF, chans) 101 % CARFAC_Rational_Functions(CF, chans)
102 % Return transfer functions of all stages as rational functions. 102 % Return transfer functions of all stages as rational functions.
103 103
104 n_ch = CF.n_ch; 104 n_ch = CF.n_ch;
105 coeffs = CF.filter_coeffs; 105 coeffs = CF.CAR_coeffs;
106 min_zeta = CF.filter_params.min_zeta; 106 min_zeta = CF.CAR_params.min_zeta;
107 107
108 a0 = coeffs.a0_coeffs; 108 a0 = coeffs.a0_coeffs;
109 c0 = coeffs.c0_coeffs; 109 c0 = coeffs.c0_coeffs;
110 zr = coeffs.zr_coeffs; 110 zr = coeffs.zr_coeffs;
111 111
112 % get r, adapted if we have state: 112 % get r, adapted if we have state:
113 r = coeffs.r1_coeffs; 113 r = coeffs.r1_coeffs;
114 if isfield(CF, 'filter_state') 114 if isfield(CF, 'CAR_state')
115 state = CF.filter_state; 115 state = CF.CAR_state;
116 zB = state.zB_memory; % current extra damping 116 zB = state.zB_memory; % current extra damping
117 r = r - zr .* zB; 117 r = r - zr .* zB;
118 else 118 else
119 zB = 0; 119 zB = 0;
120 end 120 end