spandsp 0.0.6

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 ------------------------------------------------------------*/
fsk_rx_state_t
struct fsk_rx_state_s fsk_rx_state_t
Definition fsk.h:142
modem_connect_tones_rx_state_s
Definition private/modem_connect_tones.h:58
modem_connect_tones_rx_state_s::tone_callback
tone_report_func_t tone_callback
Callback routine, using to report detection of the tone.
Definition private/modem_connect_tones.h:62
modem_connect_tones_rx_state_s::callback_data
void * callback_data
An opaque pointer passed to tone_callback.
Definition private/modem_connect_tones.h:64
modem_connect_tones_rx_state_s::num_bits
int num_bits
The current number of bits in the octet in progress.
Definition private/modem_connect_tones.h:95
modem_connect_tones_rx_state_s::notch_level
int32_t notch_level
The in notch power estimate.
Definition private/modem_connect_tones.h:73
modem_connect_tones_rx_state_s::chunk_remainder
int chunk_remainder
Sample counter for the small chunks of samples, after which a test is conducted.
Definition private/modem_connect_tones.h:79
modem_connect_tones_rx_state_s::tone_cycle_duration
int tone_cycle_duration
A millisecond counter, to time the duration of tone sections.
Definition private/modem_connect_tones.h:85
modem_connect_tones_rx_state_s::am_level
int32_t am_level
The 15Hz AM power estimate.
Definition private/modem_connect_tones.h:77
modem_connect_tones_rx_state_s::good_cycles
int good_cycles
A count of the number of good cycles of tone reversal seen.
Definition private/modem_connect_tones.h:87
modem_connect_tones_rx_state_s::flags_seen
int flags_seen
Number of consecutive flags seen so far.
Definition private/modem_connect_tones.h:97
modem_connect_tones_rx_state_s::channel_level
int32_t channel_level
The total channel power estimate.
Definition private/modem_connect_tones.h:75
modem_connect_tones_rx_state_s::z15hz_1
float z15hz_1
The 15Hz AM filter state.
Definition private/modem_connect_tones.h:70
modem_connect_tones_rx_state_s::tone_present
int tone_present
TRUE is the tone is currently confirmed present in the audio.
Definition private/modem_connect_tones.h:81
modem_connect_tones_rx_state_s::tone_type
int tone_type
The tone type being detected.
Definition private/modem_connect_tones.h:60
modem_connect_tones_rx_state_s::hit
int hit
TRUE if the tone has been seen since the last time the user tested for it.
Definition private/modem_connect_tones.h:89
modem_connect_tones_rx_state_s::v21rx
fsk_rx_state_t v21rx
A V.21 FSK modem context used when searching for FAX preamble.
Definition private/modem_connect_tones.h:91
modem_connect_tones_rx_state_s::framing_ok_announced
int framing_ok_announced
TRUE if framing OK has been announced.
Definition private/modem_connect_tones.h:99
modem_connect_tones_rx_state_s::raw_bit_stream
unsigned int raw_bit_stream
The raw (stuffed) bit stream buffer.
Definition private/modem_connect_tones.h:93
modem_connect_tones_rx_state_s::znotch_1
float znotch_1
The notch filter state.
Definition private/modem_connect_tones.h:67
modem_connect_tones_tx_state_s
Definition private/modem_connect_tones.h:38
modem_connect_tones_tx_state_s::hop_timer
int hop_timer
Countdown to the next phase hop.
Definition private/modem_connect_tones.h:45
modem_connect_tones_tx_state_s::duration_timer
int duration_timer
Maximum duration timer.
Definition private/modem_connect_tones.h:47