@@ -141,6 +141,12 @@ class GoertzelDetector {
141
141
*/
142
142
bool isDetected (float threshold) const { return magnitude > threshold; }
143
143
144
+ /* *
145
+ * @brief Check if the detected magnitude is above the configured threshold
146
+ * @return True if magnitude is above configured threshold
147
+ */
148
+ bool isDetected () const { return isDetected (config.threshold ); }
149
+
144
150
/* *
145
151
* @brief Reset the detector state
146
152
*/
@@ -167,7 +173,7 @@ class GoertzelDetector {
167
173
*/
168
174
const GoertzelConfig& getConfig () const { return config; }
169
175
170
- private :
176
+ protected :
171
177
GoertzelConfig config;
172
178
float coeff = 0 .0f ;
173
179
@@ -182,17 +188,31 @@ class GoertzelDetector {
182
188
};
183
189
184
190
/* *
185
- * @brief AudioStream implementation that processes audio data through Goertzel
186
- * algorithm. This class acts as a passthrough filter that can detect specific
187
- * frequencies in the audio stream.
191
+ * @brief AudioStream-based multi-frequency Goertzel detector for real-time audio analysis.
192
+ *
193
+ * GoertzelStream enables efficient detection of one or more target frequencies in a continuous audio stream.
194
+ * It acts as a transparent filter: audio data flows through unchanged, while the class analyzes the signal for specified tones.
195
+ *
196
+ * Key Features:
197
+ * - Detects multiple frequencies simultaneously (DTMF, tone detection, etc.)
198
+ * - Supports runtime addition of frequencies via addFrequency()
199
+ * - Works with various sample formats: 8/16/24/32-bit (see below)
200
+ * - Channel-aware: can analyze a specific channel in multi-channel audio
201
+ * - Callback system: notifies user when a frequency is detected above threshold
202
+ * - Non-intrusive: does not modify or block audio data
203
+ * - Configurable detection parameters (block size, threshold, volume, etc.)
188
204
*
189
- * Use the addFrequency method to add multiple frequencies for detection. ,
205
+ * Usage:
206
+ * 1. Configure the stream with GoertzelConfig or AudioInfo (sample rate, channels, etc.)
207
+ * 2. Add one or more target frequencies using addFrequency()
208
+ * 3. Optionally set a detection callback with setFrequencyDetectionCallback()
209
+ * 4. Use write() or readBytes() to process audio data; detection runs automatically
190
210
*
191
- * Supports multiple sample formats:
192
- * - 8-bit: unsigned samples (0-255), converted to signed (-128 to 127)
193
- * - 16-bit: signed samples (-32768 to 32767)
194
- * - 24-bit: signed samples stored as 4 bytes, little-endian
195
- * - 32-bit: signed samples (-2147483648 to 2147483647 )
211
+ * Supported sample formats:
212
+ * - 8-bit: unsigned (0-255), internally converted to signed (-128 to 127)
213
+ * - 16-bit: signed (-32768 to 32767)
214
+ * - 24-bit: signed, packed format
215
+ * - 32-bit: signed (-2^31 to 2^31-1 )
196
216
*
197
217
*
198
218
* @ingroup dsp
0 commit comments