private/modem_connect_tones.h

Go to the documentation of this file.
00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * private/modem_connect_tones.c - Generation and detection of tones
00005  *                                 associated with modems calling and
00006  *                                 answering calls.
00007  *
00008  * Written by Steve Underwood <steveu@coppice.org>
00009  *
00010  * Copyright (C) 2006 Steve Underwood
00011  *
00012  * All rights reserved.
00013  *
00014  * This program is free software; you can redistribute it and/or modify
00015  * it under the terms of the GNU Lesser General Public License version 2.1,
00016  * as published by the Free Software Foundation.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU Lesser General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public
00024  * License along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00026  *
00027  * $Id: modem_connect_tones.h,v 1.2 2009/01/29 18:30:14 steveu Exp $
00028  */
00029  
00030 /*! \file */
00031 
00032 #if !defined(_SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_)
00033 #define _SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_
00034 
00035 /*!
00036     Modem connect tones generator descriptor. This defines the state
00037     of a single working instance of the tone generator.
00038 */
00039 struct modem_connect_tones_tx_state_s
00040 {
00041     int tone_type;
00042 
00043     int32_t tone_phase_rate;
00044     uint32_t tone_phase;
00045     int16_t level;
00046     /*! \brief Countdown to the next phase hop */
00047     int hop_timer;
00048     /*! \brief Maximum duration timer */
00049     int duration_timer;
00050     uint32_t mod_phase;
00051     int32_t mod_phase_rate;
00052     int16_t mod_level;
00053 };
00054 
00055 /*!
00056     Modem connect tones receiver descriptor. This defines the state
00057     of a single working instance of the tone detector.
00058 */
00059 struct modem_connect_tones_rx_state_s
00060 {
00061     /*! \brief The tone type being detected. */
00062     int tone_type;
00063     /*! \brief Callback routine, using to report detection of the tone. */
00064     tone_report_func_t tone_callback;
00065     /*! \brief An opaque pointer passed to tone_callback. */
00066     void *callback_data;
00067 
00068     /*! \brief The notch filter state. */
00069     float z1;
00070     float z2;
00071     /*! \brief The in notch power estimate */
00072     int notch_level;
00073     /*! \brief The total channel power estimate */
00074     int channel_level;
00075     /*! \brief Sample counter for the small chunks of samples, after which a test is conducted. */
00076     int chunk_remainder;
00077     /*! \brief TRUE is the tone is currently confirmed present in the audio. */
00078     int tone_present;
00079     /*! \brief */
00080     int tone_on;
00081     /*! \brief A millisecond counter, to time the duration of tone sections. */
00082     int tone_cycle_duration;
00083     /*! \brief A count of the number of good cycles of tone reversal seen. */
00084     int good_cycles;
00085     /*! \brief TRUE if the tone has been seen since the last time the user tested for it */
00086     int hit;
00087     /*! \brief A V.21 FSK modem context used when searching for FAX preamble. */
00088     fsk_rx_state_t v21rx;
00089     /*! \brief The raw (stuffed) bit stream buffer. */
00090     unsigned int raw_bit_stream;
00091     /*! \brief The current number of bits in the octet in progress. */
00092     int num_bits;
00093     /*! \brief Number of consecutive flags seen so far. */
00094     int flags_seen;
00095     /*! \brief TRUE if framing OK has been announced. */
00096     int framing_ok_announced;
00097 };
00098 
00099 #endif
00100 /*- End of file ------------------------------------------------------------*/

Generated on Tue Aug 4 03:36:01 2009 for spandsp by  doxygen 1.5.9