spandsp  0.0.6
private/super_tone_rx.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/super_tone_rx.h - Flexible telephony supervisory tone detection.
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2003 Steve Underwood
9  *
10  * All rights reserved.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 2.1,
14  * as published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 #if !defined(_SPANDSP_PRIVATE_SUPER_TONE_RX_H_)
27 #define _SPANDSP_PRIVATE_SUPER_TONE_RX_H_
28 
29 #define SUPER_TONE_BINS 128
30 
32 {
33  int f1;
34  int f2;
35  int recognition_duration;
36  int min_duration;
37  int max_duration;
38 };
39 
41 {
42  int used_frequencies;
43  int monitored_frequencies;
44  int pitches[SUPER_TONE_BINS/2][2];
45  int tones;
46  super_tone_rx_segment_t **tone_list;
47  int *tone_segs;
49 };
50 
52 {
54  float energy;
55  int detected_tone;
56  int rotation;
57  tone_report_func_t tone_callback;
58  tone_segment_func_t segment_callback;
59  void *callback_data;
60  super_tone_rx_segment_t segments[11];
61  goertzel_state_t state[];
62 };
63 
64 #endif
65 /*- End of file ------------------------------------------------------------*/
make_goertzel_descriptor
void make_goertzel_descriptor(goertzel_descriptor_t *t, float freq, int samples)
Create a descriptor for use with either a Goertzel transform.
Definition: tone_detect.c:59
tone_generate.h
super_tone_rx_init
super_tone_rx_state_t * super_tone_rx_init(super_tone_rx_state_t *s, super_tone_rx_descriptor_t *desc, tone_report_func_t callback, void *user_data)
Definition: super_tone_rx.c:255
super_tone_rx_add_tone
int super_tone_rx_add_tone(super_tone_rx_descriptor_t *desc)
Definition: super_tone_rx.c:106
goertzel_init
goertzel_state_t * goertzel_init(goertzel_state_t *s, goertzel_descriptor_t *t)
Initialise the state of a Goertzel transform.
Definition: tone_detect.c:70
super_tone_rx
int super_tone_rx(super_tone_rx_state_t *s, const int16_t amp[], int samples)
Apply supervisory tone detection processing to a block of audio samples.
Definition: super_tone_rx.c:445
goertzel_result
float goertzel_result(goertzel_state_t *s)
Evaluate the final result of a Goertzel transform.
Definition: tone_detect.c:156
super_tone_rx_descriptor_s
Definition: private/super_tone_rx.h:41
goertzel_update
int goertzel_update(goertzel_state_t *s, const int16_t amp[], int samples)
Update the state of a Goertzel transform.
Definition: tone_detect.c:119
super_tone_rx_release
int super_tone_rx_release(super_tone_rx_state_t *s)
Definition: super_tone_rx.c:295
super_tone_rx_add_element
int super_tone_rx_add_element(super_tone_rx_descriptor_t *desc, int tone, int f1, int f2, int min, int max)
Definition: super_tone_rx.c:120
complex.h
super_tone_rx_free
int super_tone_rx_free(super_tone_rx_state_t *s)
Definition: super_tone_rx.c:301
super_tone_rx_make_descriptor
super_tone_rx_descriptor_t * super_tone_rx_make_descriptor(super_tone_rx_descriptor_t *desc)
Definition: super_tone_rx.c:198
super_tone_rx_fillin
int super_tone_rx_fillin(super_tone_rx_state_t *s, int samples)
Allow for a missing block of samples to a supervisory tone detector.
Definition: super_tone_rx.c:485
super_tone_rx_state_s
Definition: private/super_tone_rx.h:52
goertzel_state_s
Definition: tone_detect.h:46
super_tone_rx_segment_s
Definition: private/super_tone_rx.h:32
super_tone_rx_tone_callback
void super_tone_rx_tone_callback(super_tone_rx_state_t *s, tone_report_func_t callback, void *user_data)
Definition: super_tone_rx.c:239
super_tone_rx_free_descriptor
int super_tone_rx_free_descriptor(super_tone_rx_descriptor_t *desc)
Definition: super_tone_rx.c:216
goertzel_descriptor_s
Definition: tone_detect.h:33
super_tone_rx_segment_callback
void super_tone_rx_segment_callback(super_tone_rx_state_t *s, tone_segment_func_t callback)
Definition: super_tone_rx.c:248