Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/private/modem_connect_tones.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/modem_connect_tones.c - Generation and detection of tones | |
5 * associated with modems calling and | |
6 * answering calls. | |
7 * | |
8 * Written by Steve Underwood <steveu@coppice.org> | |
9 * | |
10 * Copyright (C) 2006 Steve Underwood | |
11 * | |
12 * All rights reserved. | |
13 * | |
14 * This program is free software; you can redistribute it and/or modify | |
15 * it under the terms of the GNU Lesser General Public License version 2.1, | |
16 * as published by the Free Software Foundation. | |
17 * | |
18 * This program is distributed in the hope that it will be useful, | |
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 * GNU Lesser General Public License for more details. | |
22 * | |
23 * You should have received a copy of the GNU Lesser General Public | |
24 * License along with this program; if not, write to the Free Software | |
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
26 * | |
27 * $Id: modem_connect_tones.h,v 1.3 2009/11/02 13:25:20 steveu Exp $ | |
28 */ | |
29 | |
30 /*! \file */ | |
31 | |
32 #if !defined(_SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_) | |
33 #define _SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_ | |
34 | |
35 /*! | |
36 Modem connect tones generator descriptor. This defines the state | |
37 of a single working instance of the tone generator. | |
38 */ | |
39 struct modem_connect_tones_tx_state_s | |
40 { | |
41 int tone_type; | |
42 | |
43 int32_t tone_phase_rate; | |
44 uint32_t tone_phase; | |
45 int16_t level; | |
46 /*! \brief Countdown to the next phase hop */ | |
47 int hop_timer; | |
48 /*! \brief Maximum duration timer */ | |
49 int duration_timer; | |
50 uint32_t mod_phase; | |
51 int32_t mod_phase_rate; | |
52 int16_t mod_level; | |
53 }; | |
54 | |
55 /*! | |
56 Modem connect tones receiver descriptor. This defines the state | |
57 of a single working instance of the tone detector. | |
58 */ | |
59 struct modem_connect_tones_rx_state_s | |
60 { | |
61 /*! \brief The tone type being detected. */ | |
62 int tone_type; | |
63 /*! \brief Callback routine, using to report detection of the tone. */ | |
64 tone_report_func_t tone_callback; | |
65 /*! \brief An opaque pointer passed to tone_callback. */ | |
66 void *callback_data; | |
67 | |
68 /*! \brief The notch filter state. */ | |
69 float znotch_1; | |
70 float znotch_2; | |
71 /*! \brief The 15Hz AM filter state. */ | |
72 float z15hz_1; | |
73 float z15hz_2; | |
74 /*! \brief The in notch power estimate */ | |
75 int32_t notch_level; | |
76 /*! \brief The total channel power estimate */ | |
77 int32_t channel_level; | |
78 /*! \brief The 15Hz AM power estimate */ | |
79 int32_t am_level; | |
80 /*! \brief Sample counter for the small chunks of samples, after which a test is conducted. */ | |
81 int chunk_remainder; | |
82 /*! \brief TRUE is the tone is currently confirmed present in the audio. */ | |
83 int tone_present; | |
84 /*! \brief */ | |
85 int tone_on; | |
86 /*! \brief A millisecond counter, to time the duration of tone sections. */ | |
87 int tone_cycle_duration; | |
88 /*! \brief A count of the number of good cycles of tone reversal seen. */ | |
89 int good_cycles; | |
90 /*! \brief TRUE if the tone has been seen since the last time the user tested for it */ | |
91 int hit; | |
92 /*! \brief A V.21 FSK modem context used when searching for FAX preamble. */ | |
93 fsk_rx_state_t v21rx; | |
94 /*! \brief The raw (stuffed) bit stream buffer. */ | |
95 unsigned int raw_bit_stream; | |
96 /*! \brief The current number of bits in the octet in progress. */ | |
97 int num_bits; | |
98 /*! \brief Number of consecutive flags seen so far. */ | |
99 int flags_seen; | |
100 /*! \brief TRUE if framing OK has been announced. */ | |
101 int framing_ok_announced; | |
102 }; | |
103 | |
104 #endif | |
105 /*- End of file ------------------------------------------------------------*/ |