comparison spandsp-0.0.6pre17/src/spandsp/private/super_tone_rx.h @ 4:26cd8f1ef0b1

import spandsp-0.0.6pre17
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Fri, 25 Jun 2010 15:50:58 +0200
parents
children
comparison
equal deleted inserted replaced
3:c6c5a16ce2f2 4:26cd8f1ef0b1
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 * $Id: super_tone_rx.h,v 1.1 2008/11/30 10:17:31 steveu Exp $
26 */
27
28 #if !defined(_SPANDSP_PRIVATE_SUPER_TONE_RX_H_)
29 #define _SPANDSP_PRIVATE_SUPER_TONE_RX_H_
30
31 #define BINS 128
32
33 struct super_tone_rx_segment_s
34 {
35 int f1;
36 int f2;
37 int recognition_duration;
38 int min_duration;
39 int max_duration;
40 };
41
42 struct super_tone_rx_descriptor_s
43 {
44 int used_frequencies;
45 int monitored_frequencies;
46 int pitches[BINS/2][2];
47 int tones;
48 super_tone_rx_segment_t **tone_list;
49 int *tone_segs;
50 goertzel_descriptor_t *desc;
51 };
52
53 struct super_tone_rx_state_s
54 {
55 super_tone_rx_descriptor_t *desc;
56 float energy;
57 int detected_tone;
58 int rotation;
59 tone_report_func_t tone_callback;
60 void (*segment_callback)(void *data, int f1, int f2, int duration);
61 void *callback_data;
62 super_tone_rx_segment_t segments[11];
63 goertzel_state_t state[];
64 };
65
66 #endif
67 /*- End of file ------------------------------------------------------------*/

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.