spandsp  3.0.0
private/fsk.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/fsk.h - FSK modem transmit and receive parts
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2003 Steve Underwood
9  *
10  * All rights reserved.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 2.1,
14  * as published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 #if !defined(_SPANDSP_PRIVATE_FSK_H_)
27 #define _SPANDSP_PRIVATE_FSK_H_
28 
29 /*!
30  FSK modem transmit descriptor. This defines the state of a single working
31  instance of an FSK modem transmitter.
32 */
34 {
35  int baud_rate;
36  /*! \brief The callback function used to get the next bit to be transmitted. */
38  /*! \brief A user specified opaque pointer passed to the get_bit function. */
40 
41  /*! \brief The callback function used to report modem status changes. */
43  /*! \brief A user specified opaque pointer passed to the status function. */
45 
46  int32_t phase_rates[2];
47  int16_t scaling;
48  int32_t current_phase_rate;
49  uint32_t phase_acc;
50  int baud_frac;
51  int shutdown;
52 };
53 
54 /*!
55  FSK modem receive descriptor. This defines the state of a single working
56  instance of an FSK modem receiver.
57 */
59 {
60  int baud_rate;
61  /*! \brief Synchronous/asynchronous/framed control */
63  int data_bits;
64  int parity;
65  int stop_bits;
66  int total_data_bits;
67  /*! \brief The callback function used to put each bit received. */
69  /*! \brief A user specified opaque pointer passed to the put_bit routine. */
71 
72  /*! \brief The callback function used to report modem status changes. */
74  /*! \brief A user specified opaque pointer passed to the status function. */
76 
77  int32_t carrier_on_power;
78  int32_t carrier_off_power;
79  power_meter_t power;
80  /*! \brief The value of the last signal sample, using the a simple HPF for signal power estimation. */
81  int16_t last_sample;
82  /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.29 signal. */
84 
85  int32_t phase_rate[2];
86  uint32_t phase_acc[2];
87 
88  int correlation_span;
89 
90  complexi32_t window[2][FSK_MAX_WINDOW_LEN];
91  complexi32_t dot[2];
92  int buf_ptr;
93 
94  int frame_pos;
95  uint16_t frame_in_progress;
96  int baud_phase;
97  int last_bit;
98  int scaling_shift;
99 
100  /*! A count of the number of parity errors seen. */
102  /*! A count of the number of character framing errors seen. */
104 };
105 
106 #endif
107 /*- End of file ------------------------------------------------------------*/
Definition: private/power_meter.h:33
span_modem_status_func_t status_handler
The callback function used to report modem status changes.
Definition: private/fsk.h:42
void * put_bit_user_data
A user specified opaque pointer passed to the put_bit routine.
Definition: private/fsk.h:70
int(* span_get_bit_func_t)(void *user_data)
Definition: async.h:127
int signal_present
>0 if a signal above the minimum is present. It may or may not be a V.29 signal.
Definition: private/fsk.h:83
span_modem_status_func_t status_handler
The callback function used to report modem status changes.
Definition: private/fsk.h:73
int framing_mode
Synchronous/asynchronous/framed control.
Definition: private/fsk.h:62
Definition: private/fsk.h:58
void(* span_modem_status_func_t)(void *user_data, int status)
Definition: async.h:131
void(* span_put_bit_func_t)(void *user_data, int bit)
Definition: async.h:123
Definition: private/fsk.h:33
void * get_bit_user_data
A user specified opaque pointer passed to the get_bit function.
Definition: private/fsk.h:39
int framing_errors
Definition: private/fsk.h:103
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition: private/fsk.h:75
int parity_errors
Definition: private/fsk.h:101
int16_t last_sample
The value of the last signal sample, using the a simple HPF for signal power estimation.
Definition: private/fsk.h:81
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition: private/fsk.h:44
span_get_bit_func_t get_bit
The callback function used to get the next bit to be transmitted.
Definition: private/fsk.h:37
Definition: complex.h:99
span_put_bit_func_t put_bit
The callback function used to put each bit received.
Definition: private/fsk.h:68