spandsp  0.0.6
private/super_tone_rx.h
00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * private/super_tone_rx.h - Flexible telephony supervisory tone detection.
00005  *
00006  * Written by Steve Underwood <steveu@coppice.org>
00007  *
00008  * Copyright (C) 2003 Steve Underwood
00009  *
00010  * All rights reserved.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 2.1,
00014  * as published by the Free Software Foundation.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  */
00025 
00026 #if !defined(_SPANDSP_PRIVATE_SUPER_TONE_RX_H_)
00027 #define _SPANDSP_PRIVATE_SUPER_TONE_RX_H_
00028 
00029 #define BINS            128
00030 
00031 struct super_tone_rx_segment_s
00032 {
00033     int f1;
00034     int f2;
00035     int recognition_duration;
00036     int min_duration;
00037     int max_duration;
00038 };
00039 
00040 struct super_tone_rx_descriptor_s
00041 {
00042     int used_frequencies;
00043     int monitored_frequencies;
00044     int pitches[BINS/2][2];
00045     int tones;
00046     super_tone_rx_segment_t **tone_list;
00047     int *tone_segs;
00048     goertzel_descriptor_t *desc;
00049 };
00050 
00051 struct super_tone_rx_state_s
00052 {
00053     super_tone_rx_descriptor_t *desc;
00054     float energy;
00055     int detected_tone;
00056     int rotation;
00057     tone_report_func_t tone_callback;
00058     void (*segment_callback)(void *data, int f1, int f2, int duration);
00059     void *callback_data;
00060     super_tone_rx_segment_t segments[11];
00061     goertzel_state_t state[];
00062 };
00063 
00064 #endif
00065 /*- End of file ------------------------------------------------------------*/