Lines Matching refs:det
33 echo_can_disable_detector_init(struct ec_disable_detector_state *det)
38 biquad2_init(&det->notch,
45 det->channel_level = 0;
46 det->notch_level = 0;
47 det->tone_present = FALSE;
48 det->tone_cycle_duration = 0;
49 det->good_cycles = 0;
50 det->hit = 0;
55 echo_can_disable_detector_update(struct ec_disable_detector_state *det,
60 notched = biquad2(&det->notch, amp);
67 det->channel_level += ((abs(amp) - det->channel_level) >> 5);
68 det->notch_level += ((abs(notched) - det->notch_level) >> 4);
69 if (det->channel_level > 280) {
72 if (det->notch_level * 6 < det->channel_level) {
74 if (!det->tone_present) {
76 if (det->tone_cycle_duration >= 425 * 8
77 && det->tone_cycle_duration <= 475 * 8) {
78 det->good_cycles++;
79 if (det->good_cycles > 2)
80 det->hit = TRUE;
82 det->tone_cycle_duration = 0;
84 det->tone_present = TRUE;
86 det->tone_present = FALSE;
87 det->tone_cycle_duration++;
89 det->tone_present = FALSE;
90 det->tone_cycle_duration = 0;
91 det->good_cycles = 0;
93 return det->hit;