diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-11-05 06:24:13 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-11-05 06:24:13 +0000 |
commit | e2fb6ee2a17f307a8822d7087430df241e81ae45 (patch) | |
tree | 91b04cd46f70d728b9ff797cacd9d2c43eaa7958 | |
parent | 9fc7e50f64426eef1bd0f77fa6906bf590c293bc (diff) |
Implement training for mec3
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@265 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-x | mec3.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -225,4 +225,19 @@ static inline echo_can_state_t *echo_can_create(int taps, int adaption_mode) return ec; } +static inline int echo_can_traintap(echo_can_state_t *ec, int pos, short val) +{ + /* Reset hang counter to avoid adjustments after + initial forced training */ + ec->hcntr = ec->taps << 1; + if (pos >= ec->taps) + return 1; + ec->a_i[pos] = val << 17; + ec->a_s[pos] = val << 1; + if (++pos >= ec->taps) + return 1; + return 0; +} + + #endif |