Lines Matching refs:det

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