spandsp
0.0.6
Main Page
Related Pages
Classes
Files
File List
File Members
private/modem_connect_tones.h
Go to the documentation of this file.
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
28
/*! \file */
29
30
#if !defined(_SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_)
31
#define _SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_
32
33
/*!
34
Modem connect tones generator descriptor. This defines the state
35
of a single working instance of the tone generator.
36
*/
37
struct
modem_connect_tones_tx_state_s
38
{
39
int
tone_type;
40
41
int32_t tone_phase_rate;
42
uint32_t tone_phase;
43
int16_t level;
44
/*! \brief Countdown to the next phase hop */
45
int
hop_timer
;
46
/*! \brief Maximum duration timer */
47
int
duration_timer
;
48
uint32_t mod_phase;
49
int32_t mod_phase_rate;
50
int16_t mod_level;
51
};
52
53
/*!
54
Modem connect tones receiver descriptor. This defines the state
55
of a single working instance of the tone detector.
56
*/
57
struct
modem_connect_tones_rx_state_s
58
{
59
/*! \brief The tone type being detected. */
60
int
tone_type
;
61
/*! \brief Callback routine, using to report detection of the tone. */
62
tone_report_func_t
tone_callback
;
63
/*! \brief An opaque pointer passed to tone_callback. */
64
void
*
callback_data
;
65
66
/*! \brief The notch filter state. */
67
float
znotch_1
;
68
float
znotch_2;
69
/*! \brief The 15Hz AM filter state. */
70
float
z15hz_1
;
71
float
z15hz_2;
72
/*! \brief The in notch power estimate */
73
int32_t
notch_level
;
74
/*! \brief The total channel power estimate */
75
int32_t
channel_level
;
76
/*! \brief The 15Hz AM power estimate */
77
int32_t
am_level
;
78
/*! \brief Sample counter for the small chunks of samples, after which a test is conducted. */
79
int
chunk_remainder
;
80
/*! \brief TRUE is the tone is currently confirmed present in the audio. */
81
int
tone_present
;
82
/*! \brief */
83
int
tone_on;
84
/*! \brief A millisecond counter, to time the duration of tone sections. */
85
int
tone_cycle_duration
;
86
/*! \brief A count of the number of good cycles of tone reversal seen. */
87
int
good_cycles
;
88
/*! \brief TRUE if the tone has been seen since the last time the user tested for it */
89
int
hit
;
90
/*! \brief A V.21 FSK modem context used when searching for FAX preamble. */
91
fsk_rx_state_t
v21rx
;
92
/*! \brief The raw (stuffed) bit stream buffer. */
93
unsigned
int
raw_bit_stream
;
94
/*! \brief The current number of bits in the octet in progress. */
95
int
num_bits
;
96
/*! \brief Number of consecutive flags seen so far. */
97
int
flags_seen
;
98
/*! \brief TRUE if framing OK has been announced. */
99
int
framing_ok_announced
;
100
};
101
102
#endif
103
/*- End of file ------------------------------------------------------------*/
src
spandsp
private
modem_connect_tones.h
Generated by
1.8.1.1