comparison src/sig_proc.h @ 0:56410792419a

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