Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/private/fsk.h @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 15:50:58 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
---|---|
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 * $Id: fsk.h,v 1.5 2009/04/01 13:22:40 steveu Exp $ | |
26 */ | |
27 | |
28 #if !defined(_SPANDSP_PRIVATE_FSK_H_) | |
29 #define _SPANDSP_PRIVATE_FSK_H_ | |
30 | |
31 /*! | |
32 FSK modem transmit descriptor. This defines the state of a single working | |
33 instance of an FSK modem transmitter. | |
34 */ | |
35 struct fsk_tx_state_s | |
36 { | |
37 int baud_rate; | |
38 /*! \brief The callback function used to get the next bit to be transmitted. */ | |
39 get_bit_func_t get_bit; | |
40 /*! \brief A user specified opaque pointer passed to the get_bit function. */ | |
41 void *get_bit_user_data; | |
42 | |
43 /*! \brief The callback function used to report modem status changes. */ | |
44 modem_tx_status_func_t status_handler; | |
45 /*! \brief A user specified opaque pointer passed to the status function. */ | |
46 void *status_user_data; | |
47 | |
48 int32_t phase_rates[2]; | |
49 int16_t scaling; | |
50 int32_t current_phase_rate; | |
51 uint32_t phase_acc; | |
52 int baud_frac; | |
53 int shutdown; | |
54 }; | |
55 | |
56 /*! | |
57 FSK modem receive descriptor. This defines the state of a single working | |
58 instance of an FSK modem receiver. | |
59 */ | |
60 struct fsk_rx_state_s | |
61 { | |
62 int baud_rate; | |
63 /*! \brief Synchronous/asynchronous framing control */ | |
64 int framing_mode; | |
65 /*! \brief The callback function used to put each bit received. */ | |
66 put_bit_func_t put_bit; | |
67 /*! \brief A user specified opaque pointer passed to the put_bit routine. */ | |
68 void *put_bit_user_data; | |
69 | |
70 /*! \brief The callback function used to report modem status changes. */ | |
71 modem_tx_status_func_t status_handler; | |
72 /*! \brief A user specified opaque pointer passed to the status function. */ | |
73 void *status_user_data; | |
74 | |
75 int32_t carrier_on_power; | |
76 int32_t carrier_off_power; | |
77 power_meter_t power; | |
78 /*! \brief The value of the last signal sample, using the a simple HPF for signal power estimation. */ | |
79 int16_t last_sample; | |
80 /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.29 signal. */ | |
81 int signal_present; | |
82 | |
83 int32_t phase_rate[2]; | |
84 uint32_t phase_acc[2]; | |
85 | |
86 int correlation_span; | |
87 | |
88 complexi32_t window[2][FSK_MAX_WINDOW_LEN]; | |
89 complexi32_t dot[2]; | |
90 int buf_ptr; | |
91 | |
92 int frame_state; | |
93 int frame_bits; | |
94 int baud_phase; | |
95 int last_bit; | |
96 int scaling_shift; | |
97 }; | |
98 | |
99 #endif | |
100 /*- End of file ------------------------------------------------------------*/ |