spandsp 0.0.6

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*/
33 struct fsk_tx_state_s
34{
35 int baud_rate;
36 /*! \brief The callback function used to get the next bit to be transmitted. */
37 get_bit_func_t get_bit;
38 /*! \brief A user specified opaque pointer passed to the get_bit function. */
39 void *get_bit_user_data;
40
41 /*! \brief The callback function used to report modem status changes. */
42 modem_tx_status_func_t status_handler;
43 /*! \brief A user specified opaque pointer passed to the status function. */
44 void *status_user_data;
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*/
58 struct fsk_rx_state_s
59{
60 int baud_rate;
61 /*! \brief Synchronous/asynchronous framing control */
62 int framing_mode;
63 /*! \brief The callback function used to put each bit received. */
64 put_bit_func_t put_bit;
65 /*! \brief A user specified opaque pointer passed to the put_bit routine. */
66 void *put_bit_user_data;
67
68 /*! \brief The callback function used to report modem status changes. */
69 modem_tx_status_func_t status_handler;
70 /*! \brief A user specified opaque pointer passed to the status function. */
71 void *status_user_data;
72
73 int32_t carrier_on_power;
74 int32_t carrier_off_power;
75 power_meter_t power;
76 /*! \brief The value of the last signal sample, using the a simple HPF for signal power estimation. */
77 int16_t last_sample;
78 /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.29 signal. */
79 int signal_present;
80
81 int32_t phase_rate[2];
82 uint32_t phase_acc[2];
83
84 int correlation_span;
85
86 complexi32_t window[2][FSK_MAX_WINDOW_LEN];
87 complexi32_t dot[2];
88 int buf_ptr;
89
90 int frame_state;
91 int frame_bits;
92 int baud_phase;
93 int last_bit;
94 int scaling_shift;
95};
96
97#endif
98/*- End of file ------------------------------------------------------------*/
put_bit_func_t
void(* put_bit_func_t)(void *user_data, int bit)
Definition async.h:105
get_bit_func_t
int(* get_bit_func_t)(void *user_data)
Definition async.h:108
complexi32_t
Definition complex.h:100
fsk_rx_state_s
Definition private/fsk.h:59
fsk_rx_state_s::put_bit
put_bit_func_t put_bit
The callback function used to put each bit received.
Definition private/fsk.h:64
fsk_rx_state_s::status_handler
modem_tx_status_func_t status_handler
The callback function used to report modem status changes.
Definition private/fsk.h:69
fsk_rx_state_s::signal_present
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:79
fsk_rx_state_s::last_sample
int16_t last_sample
The value of the last signal sample, using the a simple HPF for signal power estimation.
Definition private/fsk.h:77
fsk_rx_state_s::framing_mode
int framing_mode
Synchronous/asynchronous framing control.
Definition private/fsk.h:62
fsk_rx_state_s::put_bit_user_data
void * put_bit_user_data
A user specified opaque pointer passed to the put_bit routine.
Definition private/fsk.h:66
fsk_rx_state_s::status_user_data
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition private/fsk.h:71
fsk_tx_state_s
Definition private/fsk.h:34
fsk_tx_state_s::status_user_data
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition private/fsk.h:44
fsk_tx_state_s::get_bit_user_data
void * get_bit_user_data
A user specified opaque pointer passed to the get_bit function.
Definition private/fsk.h:39
fsk_tx_state_s::get_bit
get_bit_func_t get_bit
The callback function used to get the next bit to be transmitted.
Definition private/fsk.h:37
fsk_tx_state_s::status_handler
modem_tx_status_func_t status_handler
The callback function used to report modem status changes.
Definition private/fsk.h:42
power_meter_t
Definition power_meter.h:49