spandsp  3.0.0
godard.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * godard.h - Godard symbol timing error detector.
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2024 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_GODARD_H_)
27 #define _SPANDSP_GODARD_H_
28 
30 
32 {
33 #if defined(SPANDSP_USE_FIXED_POINTx)
34  /*! Low band edge filter coefficients */
35  int32_t low_band_edge_coeff[3];
36  /*! High band edge filter coefficients */
37  int32_t high_band_edge_coeff[3];
38  /*! The blended filter coefficient */
39  int32_t mixed_edges_coeff_3;
40 
41  /*! Error needed to cause a coarse step in the baud alignment */
42  int32_t coarse_trigger;
43  /*! Error needed to cause a fine step in the baud alignment */
44  int32_t fine_trigger;
45 #else
46  /*! Low band edge filter coefficients */
48  /*! High band edge filter coefficients */
50  /*! The blended filter coefficient */
52 
53  /*! Error needed to cause a coarse step in the baud alignment */
55  /*! Error needed to cause a fine step in the baud alignment */
56  float fine_trigger;
57 #endif
58  /*! The size of a coarse step in the baud alignment. This is used to rapidly
59  pull in the alignment during symbol acquisition. We need to switch to
60  finer steps as we pull in the alignment, or the equalizer will not
61  adapt well. */
63  /*! The size of a fine step in the baud alignment. This is used to track
64  smaller amounts of misalignment once we are roughly on the symbols. */
65  int fine_step;
67 
68 #if defined(__cplusplus)
69 extern "C"
70 {
71 #endif
72 
73 SPAN_DECLARE(godard_ted_descriptor_t *) godard_ted_make_descriptor(godard_ted_descriptor_t *desc,
74  float sample_rate,
75  float baud_rate,
76  float carrier_freq,
77  float alpha,
78  float coarse_trigger,
79  float fine_trigger,
80  int coarse_step,
81  int fine_step);
82 
83 SPAN_DECLARE(int) godard_ted_free_descriptor(godard_ted_descriptor_t *s);
84 
85 SPAN_DECLARE(int) godard_ted_correction(godard_ted_state_t *s);
86 
87 #if defined(SPANDSP_USE_FIXED_POINTx)
88 SPAN_DECLARE(void) godard_ted_rx(godard_ted_state_t *s, int16_t sample);
89 #else
90 SPAN_DECLARE(void) godard_ted_rx(godard_ted_state_t *s, float sample);
91 #endif
92 
93 SPAN_DECLARE(int) godard_ted_per_baud(godard_ted_state_t *s);
94 
95 SPAN_DECLARE(godard_ted_state_t *) godard_ted_init(godard_ted_state_t *s, const godard_ted_descriptor_t *desc);
96 
97 SPAN_DECLARE(int) godard_ted_release(godard_ted_state_t *s);
98 
99 SPAN_DECLARE(int) godard_ted_free(godard_ted_state_t *s);
100 
101 #if defined(__cplusplus)
102 }
103 #endif
104 #endif
105 /*- End of file ------------------------------------------------------------*/
Definition: private/godard.h:29
float mixed_band_edges_coeff_3
Definition: godard.h:51
int coarse_step
Definition: godard.h:62
int fine_step
Definition: godard.h:65
float high_band_edge_coeff[3]
Definition: godard.h:49
float low_band_edge_coeff[3]
Definition: godard.h:47
float fine_trigger
Definition: godard.h:56
Definition: godard.h:31
float coarse_trigger
Definition: godard.h:54