From 0ba699511c136e0215fd2f75e2800be920221497 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 11 Apr 2019 22:53:00 +0200 Subject: Rework tone detector - Send buffer pointers from ISR to userspace - Use ADC interrupt to fetch data, not TIM6 - Increase size of buffer and do double-buffering - Implement DTMF detectors - Compare relative results instead of using absolute thresholds - Add an IIR averaging filter on the results --- src/common/includes/Audio/tone.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/common/includes/Audio/tone.h') diff --git a/src/common/includes/Audio/tone.h b/src/common/includes/Audio/tone.h index 861a472..b8a7f72 100644 --- a/src/common/includes/Audio/tone.h +++ b/src/common/includes/Audio/tone.h @@ -30,18 +30,17 @@ #define TONE_BUFFER_LEN AUDIO_IN_BUF_LEN -#define TONE_N 100 +#define TONE_N 400 struct tone_detector { float coef; float Q1; float Q2; - float threshold; int num_samples_analysed; }; -void tone_init(int threshold); +void tone_init(void); /* Return 1 when 1750 detected, 0 otherwise */ int tone_1750_status(void); -- cgit v1.2.3