private/modem_connect_tones.h
Go to the documentation of this file.
/*
* SpanDSP - a series of DSP components for telephony
*
* private/modem_connect_tones.c - Generation and detection of tones
* associated with modems calling and
* answering calls.
*
* Written by Steve Underwood <steveu@coppice.org>
*
* Copyright (C) 2006 Steve Underwood
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*! \file */
#if !defined(_SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_)
#define _SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_
/*!
Modem connect tones generator descriptor. This defines the state
of a single working instance of the tone generator.
*/
struct modem_connect_tones_tx_state_s
{
int tone_type;
int32_t tone_phase_rate;
uint32_t tone_phase;
int16_t level;
/*! \brief Countdown to the next phase hop */
int hop_timer;
/*! \brief Maximum duration timer */
int duration_timer;
uint32_t mod_phase;
int32_t mod_phase_rate;
int16_t mod_level;
};
/*!
Modem connect tones receiver descriptor. This defines the state
of a single working instance of the tone detector.
*/
struct modem_connect_tones_rx_state_s
{
/*! \brief The tone type being detected. */
int tone_type;
/*! \brief Callback routine, using to report detection of the tone. */
tone_report_func_t tone_callback;
/*! \brief An opaque pointer passed to tone_callback. */
void *callback_data;
/*! \brief The notch filter state. */
float znotch_1;
float znotch_2;
/*! \brief The 15Hz AM filter state. */
float z15hz_1;
float z15hz_2;
/*! \brief The in notch power estimate */
int32_t notch_level;
/*! \brief The total channel power estimate */
int32_t channel_level;
/*! \brief The 15Hz AM power estimate */
int32_t am_level;
/*! \brief Sample counter for the small chunks of samples, after which a test is conducted. */
int chunk_remainder;
/*! \brief TRUE is the tone is currently confirmed present in the audio. */
int tone_present;
/*! \brief */
int tone_on;
/*! \brief A millisecond counter, to time the duration of tone sections. */
int tone_cycle_duration;
/*! \brief A count of the number of good cycles of tone reversal seen. */
int good_cycles;
/*! \brief TRUE if the tone has been seen since the last time the user tested for it */
int hit;
/*! \brief A V.21 FSK modem context used when searching for FAX preamble. */
fsk_rx_state_t v21rx;
/*! \brief The raw (stuffed) bit stream buffer. */
unsigned int raw_bit_stream;
/*! \brief The current number of bits in the octet in progress. */
int num_bits;
/*! \brief Number of consecutive flags seen so far. */
int flags_seen;
/*! \brief TRUE if framing OK has been announced. */
int framing_ok_announced;
};
#endif
/*- 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