comparison src/cs/layer1/gtt_include/ctm/tonedemod.h @ 0:b6a5e36de839

src/cs: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:39:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b6a5e36de839
1 /*
2 *******************************************************************************
3 *
4 * COPYRIGHT (C) 2000 BY ERICSSON EUROLAB DEUTSCHLAND GmbH
5 * 90411 NUERNBERG, GERMANY, Tel Int + 49 911 5217 100
6 *
7 * The program(s) may be used and/or copied only with the
8 * written permission from Ericsson or in accordance
9 * with the terms and conditions stipulated in the agreement or
10 * contract under which the program(s) have been supplied.
11 *
12 *******************************************************************************
13 *
14 * File : tonedemod.h
15 * Purpose : Demodulator for the Cellular Text Telephone Modem
16 * 1-out-of-4 tones (400, 600, 800, 1000 Hz)
17 * for the coding of each pair of two adjacent bits
18 *
19 * Definition of the type demod_state_t and of the
20 * functions init_tonedemod() and tonedemod()
21 *
22 *******************************************************************************
23 */
24
25 #ifndef tonedemod_h
26 #define tonedemod_h "$Id: $"
27
28 /*
29 *******************************************************************************
30 * INCLUDE FILES
31 *******************************************************************************
32 */
33
34 #include "ctm_defines.h"
35
36 /*
37 *******************************************************************************
38 * DECLARATION OF PROTOTYPES
39 *******************************************************************************
40 */
41
42 typedef struct {
43 WORD16 buffer_tone_rx[3*SYMB_LEN];
44 WORD16 xcorr_t0[2*SYMB_LEN];
45 WORD16 xcorr_t1[2*SYMB_LEN];
46 WORD16 xcorr_t2[2*SYMB_LEN];
47 WORD16 xcorr_t3[2*SYMB_LEN];
48 WORD16 xcorr_wb[2*SYMB_LEN];
49 WORD16 lowpass[SYMB_LEN];
50 WORD16 waveform_t0[SYMB_LEN];
51 WORD16 waveform_t1[SYMB_LEN];
52 WORD16 waveform_t2[SYMB_LEN];
53 WORD16 waveform_t3[SYMB_LEN];
54 WORD16 diff_smooth[SYMB_LEN];
55 } demod_state_t;
56
57
58 /* ----------------------------------------------------------------------- */
59 /* FUNCTION tonedemod() */
60 /* ******************** */
61 /* Tone Demodulator for the Cellular Text Telephone Modem */
62 /* using one out of four tones for coding two bits in parallel within a */
63 /* frame of 40 samples (5 ms). */
64 /* */
65 /* The function has to be called for every frame of 40 samples of the */
66 /* received tone sequence. However, in order to track a non-ideal */
67 /* of the transmitter's and the receiver's clock frequencies, one frame */
68 /* might be shorter (only 39 samples) or longer (41 samples). The */
69 /* of the following frame is indicated by the variable */
70 /* *sampling_correction, which is calculated and returned by this function.*/
71 /* */
72 /* input variables: */
73 /* bits_out contains the 39, 40 or 41 actual samples of the */
74 /* received tones; the bits are soft bits, i.e. they */
75 /* are in the range between -1.0 and 1.0, where the */
76 /* magnitude serves as reliability information */
77 /* num_in_samples number of valid samples in bits_out */
78 /* */
79 /* output variables: */
80 /* bits_out contains the two actual decoded soft bits */
81 /* sampling_correction is either -1, 0, or 1 and indicates whether the */
82 /* next frame shall contain 39, 40, or 41 samples */
83 /* demod_state contains all the memory of tonedemod. Must be */
84 /* initialized using the function init_tonedemod() */
85 /* ----------------------------------------------------------------------- */
86
87 void tonedemod(WORD16 *bits_out,
88 WORD16 *rx_tone_vec,
89 WORD16 num_in_samples,
90 WORD16 *ptr_sampling_correction,
91 demod_state_t *demod_state);
92
93
94 /* ----------------------------------------------------------------------- */
95 /* FUNCTION init_tonedemod() */
96 /* ************************* */
97 /* Initialization of one instance of the Tone Demodulator. The argument */
98 /* must contain a pointer to a variable of type demod_state_t, which */
99 /* contains all the memory of the tone demodulator. Each instance of */
100 /* tonedemod must have its own variable. */
101 /* ----------------------------------------------------------------------- */
102
103 void init_tonedemod(demod_state_t *demod_state);
104
105 #endif
106