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