Lines Matching refs:det

47 echo_can_disable_detector_init(struct ec_disable_detector_state *det)  in echo_can_disable_detector_init()  argument
52 biquad2_init(&det->notch, in echo_can_disable_detector_init()
59 det->channel_level = 0; in echo_can_disable_detector_init()
60 det->notch_level = 0; in echo_can_disable_detector_init()
61 det->tone_present = FALSE; in echo_can_disable_detector_init()
62 det->tone_cycle_duration = 0; in echo_can_disable_detector_init()
63 det->good_cycles = 0; in echo_can_disable_detector_init()
64 det->hit = 0; in echo_can_disable_detector_init()
69 echo_can_disable_detector_update(struct ec_disable_detector_state *det, in echo_can_disable_detector_update() argument
74 notched = biquad2(&det->notch, amp); in echo_can_disable_detector_update()
81 det->channel_level += ((abs(amp) - det->channel_level) >> 5); in echo_can_disable_detector_update()
82 det->notch_level += ((abs(notched) - det->notch_level) >> 4); in echo_can_disable_detector_update()
83 if (det->channel_level > 280) { in echo_can_disable_detector_update()
86 if (det->notch_level * 6 < det->channel_level) { in echo_can_disable_detector_update()
88 if (!det->tone_present) { in echo_can_disable_detector_update()
90 if (det->tone_cycle_duration >= 425 * 8 in echo_can_disable_detector_update()
91 && det->tone_cycle_duration <= 475 * 8) { in echo_can_disable_detector_update()
92 det->good_cycles++; in echo_can_disable_detector_update()
93 if (det->good_cycles > 2) in echo_can_disable_detector_update()
94 det->hit = TRUE; in echo_can_disable_detector_update()
96 det->tone_cycle_duration = 0; in echo_can_disable_detector_update()
98 det->tone_present = TRUE; in echo_can_disable_detector_update()
100 det->tone_present = FALSE; in echo_can_disable_detector_update()
101 det->tone_cycle_duration++; in echo_can_disable_detector_update()
103 det->tone_present = FALSE; in echo_can_disable_detector_update()
104 det->tone_cycle_duration = 0; in echo_can_disable_detector_update()
105 det->good_cycles = 0; in echo_can_disable_detector_update()
107 return det->hit; in echo_can_disable_detector_update()