FreeCalypso > hg > gsm-codec-lib
annotate libtwamr/levinson.h @ 430:edbbbf1c4ab1
implement twamr-tseq-dec test program
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 07 May 2024 23:35:41 +0000 |
parents | c713061b6edf |
children |
rev | line source |
---|---|
385
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * R99 Version 3.3.0 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * REL-4 Version 4.1.0 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 * |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 * File : levinson.h |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 * Purpose : Levinson-Durbin algorithm in double precision. |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 * : To compute the LP filter parameters from the |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 * : speech autocorrelations. |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 * |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #ifndef levinson_h |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #define levinson_h "$Id $" |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 /* |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 * INCLUDE FILES |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #include "typedef.h" |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #include "cnst.h" |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 /* |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 * LOCAL VARIABLES AND TABLES |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 /* |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 * DEFINITION OF DATA TYPES |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 typedef struct { |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 Word16 old_A[M + 1]; /* Last A(z) for case of unstable filter */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 } LevinsonState; |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 /* |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 * DECLARATION OF PROTOTYPES |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 ******************************************************************************** |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 void Levinson_reset (LevinsonState *st); |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 /* reset of pre processing state (i.e. set state memory to zero) |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 returns 0 on success |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 int Levinson ( |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 LevinsonState *st, |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 Word16 Rh[], /* i : Rh[m+1] Vector of autocorrelations (msb) */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 Word16 Rl[], /* i : Rl[m+1] Vector of autocorrelations (lsb) */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 Word16 A[], /* o : A[m] LPC coefficients (m = 10) */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 Word16 rc[] /* o : rc[4] First 4 reflection coefficients */ |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 ); |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 |
c713061b6edf
libtwamr: integrate levinson.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #endif |