comparison src/cs/layer1/gtt_include/ctm/conv_poly.h @ 0:4e78acac3d88

src/{condat,cs,gpf,nucleus}: import from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:23:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /*
2 *******************************************************************************
3 *
4 * COPYRIGHT (C) 2000 BY ERICSSON EUROLAB DEUTSCHLAND GmbH
5 *
6 * The program(s) may be used and/or copied only with the
7 * written permission from Ericsson or in accordance
8 * with the terms and conditions stipulated in the agreement or
9 * contract under which the program(s) have been supplied.
10 *
11 *******************************************************************************
12 *
13 * File : conv_poly.h
14 * Purpose : Header file for conv_poly.c
15 * Author : Francisco Javier Gil Gomez
16 *
17 *******************************************************************************
18 */
19
20 #ifndef conv_poly_h
21 #define conv_poly_h
22
23 #include "ctm_defines.h" /* CHC_RATE, CHC_K */
24
25 /* The constants CHC_RATE (rate of the channel codec) and */
26 /* CHC_K (constraint length) are defined in ctm_defines */
27
28 #define NUM_NODES (1<<(CHC_K-1)) /* MUST BE 2^(CHC_K-1) */
29 #define BLOCK 5 /* We perform the analysis of the */
30 // /* paths along BLOCK*CHC_K steps */
31
32
33 /* POLYXYZ = Polynomial for generating an optimum short constraint */
34 /* length convolutional code with rate = 1/X and constraint length = Y */
35
36 /* Polynoms for rate = 1/2 */
37
38 #define POLY23A 0x7
39 #define POLY23B 0x5
40
41 #define POLY24A 0XF
42 #define POLY24B 0XB
43
44 #define POLY25A 0X17
45 #define POLY25B 0X19
46
47 #define POLY26A 0X2F
48 #define POLY26B 0X35
49
50 #define POLY27A 0X4F
51 #define POLY27B 0X6D
52
53 #define POLY28A 0X9F
54 #define POLY28B 0XE5
55
56 #define POLY29A 0X1AF
57 #define POLY29B 0X11D
58
59 /* Polynoms for rate = 1/3 */
60
61 #define POLY33A 0x7
62 #define POLY33B 0x7
63 #define POLY33C 0x5
64
65 #define POLY34A 0xF
66 #define POLY34B 0xB
67 #define POLY34C 0xD
68
69 #define POLY35A 0x1F
70 #define POLY35B 0x1B
71 #define POLY35C 0x15
72
73 #define POLY36A 0x2F
74 #define POLY36B 0x2B
75 #define POLY36C 0x3D
76
77 #define POLY37A 0x4F
78 #define POLY37B 0x57
79 #define POLY37C 0x6D
80
81 #define POLY38A 0xEF
82 #define POLY38B 0x9B
83 #define POLY38C 0xA9
84
85 /* Polynoms for rate = 1/4 */
86 /* cf. Lin and Costello,
87 "Error Control Coding: Fundamentals and Applications" */
88
89 #define POLY43A 0x5
90 #define POLY43B 0x7
91 #define POLY43C 0x7
92 #define POLY43D 0x7
93
94 #define POLY44A 0xB
95 #define POLY44B 0xD
96 #define POLY44C 0xD
97 #define POLY44D 0xF
98
99 #define POLY45A 0x15
100 #define POLY45B 0x17
101 #define POLY45C 0x1B
102 #define POLY45D 0x1F
103
104 #define POLY46A 0x2B
105 #define POLY46B 0x37
106 #define POLY46C 0x39
107 #define POLY46D 0x3D
108
109 #define POLY47A 0x5D
110 #define POLY47B 0x5D
111 #define POLY47C 0x67
112 #define POLY47D 0x73
113
114 #define POLY48A 0x9D
115 #define POLY48B 0xBD
116 #define POLY48C 0xCB
117 #define POLY48D 0xEF
118
119 #define POLY49A 0x133
120 #define POLY49B 0x15D
121 #define POLY49C 0x1DB
122 #define POLY49D 0x1E5
123
124 typedef struct
125 {
126 WORD16 impulse_response[CHC_RATE*CHC_K];
127 WORD16 temp[CHC_RATE*CHC_K];
128 } conv_encoder_t;
129
130 typedef struct
131 {
132 WORD32 metric; /* Metric of the node after updating */
133 WORD32 oldmetric; /* Metric of the node before updating */
134 WORD16 base_output; /* Output of the node when the input is 0 */
135 WORD16 continue_path_from; /* Last node from which the actual node
136 will continue the path */
137 WORD16 new_entry; /* Value to be added to the path (0 or 1) */
138 WORD16 path[BLOCK*CHC_K]; /* Path ending in the node */
139 WORD16 temppath[BLOCK*CHC_K]; /* Temp path used for the updating */
140
141 } node_t;
142
143 typedef struct
144 {
145 node_t nodes[NUM_NODES];
146 WORD16 number_of_steps;
147 } viterbi_t;
148
149 void polynomials(WORD16 rate, WORD16 k,
150 WORD16* polya, WORD16* polyb,
151 WORD16* polyc, WORD16* polyd);
152
153 #endif