annotate libgsmefr/sig_proc.h @ 39:36e1363ad885

libgsmefr: initial import of ETSI header files
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 24 Nov 2022 07:38:23 +0000
parents
children 988fd7ff514f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
39
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*--------------------------------------------------------------*
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * Function prototypes for general SIGnal PROCessing functions. *
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 *--------------------------------------------------------------*/
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 /* Mathematic functions */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 Word32 Inv_sqrt ( /* (o) : output value (range: 0<=val<1) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 Word32 L_x /* (i) : input value (range: 0<=val<=7fffffff) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 void Log2 (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 Word32 L_x, /* (i) : input value */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 Word16 *exponent, /* (o) : Integer part of Log2. (range: 0<=val<=30) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 Word16 *fraction /* (o) : Fractional part of Log2. (range: 0<=val<1)*/
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 Word32 Pow2 ( /* (o) : result (range: 0<=val<=0x7fffffff) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 Word16 exponent, /* (i) : Integer part. (range: 0<=val<=30) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 Word16 fraction /* (i) : Fractional part. (range: 0.0<=val<1.0) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 /* General signal processing */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 void Init_Pre_Process (void);
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 void Pre_Process (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 Word16 signal[], /* Input/output signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 Word16 lg /* Lenght of signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 Word16 Autocorr (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 Word16 x[], /* (i) : Input signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 Word16 m, /* (i) : LPC order */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 Word16 r_h[], /* (o) : Autocorrelations (msb) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 Word16 r_l[], /* (o) : Autocorrelations (lsb) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 const Word16 wind[]/* (i) : window for LPC analysis. */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 void Lag_window (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 Word16 m, /* (i) : LPC order */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 void Levinson (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 Word16 Rh[], /* (i) : Rh[m+1] Vector of autocorrelations (msb) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 Word16 Rl[], /* (i) : Rl[m+1] Vector of autocorrelations (lsb) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 Word16 A[], /* (o) : A[m] LPC coefficients (m = 10) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 Word16 rc[] /* (o) : rc[4] First 4 reflection coefficients */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 void Az_lsp (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 Word16 a[], /* (i) : predictor coefficients */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 Word16 lsp[], /* (o) : line spectral pairs */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 void Lsp_Az (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 Word16 lsp[], /* (i) : line spectral frequencies */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 Word16 a[] /* (o) : predictor coefficients (order = 10) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 void Lsf_lsp (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 Word16 lsf[], /* (i) : lsf[m] normalized (range: 0.0<=val<=0.5) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 Word16 lsp[], /* (o) : lsp[m] (range: -1<=val<1) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 Word16 m /* (i) : LPC order */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 void Lsp_lsf (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 Word16 lsp[], /* (i) : lsp[m] (range: -1<=val<1) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 Word16 lsf[], /* (o) : lsf[m] normalized (range: 0.0<=val<=0.5) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 Word16 m /* (i) : LPC order */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 void Reorder_lsf (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 Word16 *lsf, /* (i/o) : vector of LSFs (range: 0<=val<=0.5) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 Word16 min_dist, /* (i) : minimum required distance */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 Word16 n /* (i) : LPC order */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 void Weight_Fac (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 Word16 gamma, /* (i) : Spectral expansion. */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 Word16 fac[] /* (i/o) : Computed factors. */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 void Weight_Ai (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 Word16 a[], /* (i) : a[m+1] LPC coefficients (m=10) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 const Word16 fac[],/* (i) : Spectral expansion factors. */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 Word16 a_exp[] /* (o) : Spectral expanded LPC coefficients */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 void Residu (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 Word16 a[], /* (i) : prediction coefficients */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 Word16 x[], /* (i) : speech signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 Word16 y[], /* (o) : residual signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 Word16 lg /* (i) : size of filtering */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 void Syn_filt (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 Word16 a[], /* (i) : a[m+1] prediction coefficients (m=10) */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 Word16 x[], /* (i) : input signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 Word16 y[], /* (o) : output signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 Word16 lg, /* (i) : size of filtering */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 Word16 mem[], /* (i/o): memory associated with this filtering. */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 Word16 update /* (i) : 0=no update, 1=update of memory. */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 void Convolve (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 Word16 x[], /* (i) : input vector */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 Word16 h[], /* (i) : impulse response */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 Word16 y[], /* (o) : output vector */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 Word16 L /* (i) : vector size */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 void agc (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 Word16 *sig_in, /* (i) : postfilter input signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 Word16 *sig_out, /* (i/o): postfilter output signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 Word16 agc_fac, /* (i) : AGC factor */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 Word16 l_trm /* (i) : subframe size */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 void agc2 (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 Word16 *sig_in, /* (i) : postfilter input signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 Word16 *sig_out, /* (i/o): postfilter output signal */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 Word16 l_trm /* (i) : subframe size */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 );
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 void preemphasis (
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 Word16 *signal, /* (i/o): input signal overwritten by the output */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 Word16 g, /* (i) : preemphasis coefficient */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 Word16 L /* (i) : size of filtering */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 );