gr-baz Package
codec2_internal.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  FILE........: codec2_internal.h
4  AUTHOR......: David Rowe
5  DATE CREATED: 22 March 2011
6 
7  Some internal structures and states broken out here as they are useful for
8  testing and development.
9 
10 \*---------------------------------------------------------------------------*/
11 
12 /*
13  Copyright (C) 2011 David Rowe
14 
15  All rights reserved.
16 
17  This program is free software; you can redistribute it and/or modify
18  it under the terms of the GNU Lesser General Public License version 2.1, as
19  published by the Free Software Foundation. This program is
20  distributed in the hope that it will be useful, but WITHOUT ANY
21  WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23  License for more details.
24 
25  You should have received a copy of the GNU Lesser General Public License
26  along with this program; if not, see <http://www.gnu.org/licenses/>.
27 */
28 
29 #ifndef __CODEC2_INTERNAL__
30 #define __CODEC2_INTERNAL__
31 
32 /*---------------------------------------------------------------------------*\
33 
34  STATES
35 
36 \*---------------------------------------------------------------------------*/
37 
38 typedef struct {
39  float w[M]; /* time domain hamming window */
40  COMP W[FFT_ENC]; /* DFT of w[] */
41  float Pn[2*N]; /* trapezoidal synthesis window */
42  float Sn[M]; /* input speech */
43  float hpf_states[2]; /* high pass filter states */
44  void *nlp; /* pitch predictor states */
45  float Sn_[2*N]; /* synthesised output speech */
46  float ex_phase; /* excitation model phase track */
47  float bg_est; /* background noise estimate for post filter */
48  float prev_Wo; /* previous frame's pitch estimate */
49  MODEL prev_model; /* previous frame's model parameters */
50  float prev_lsps[LPC_ORD]; /* previous frame's LSPs */
51  float prev_energy; /* previous frame's LPC energy */
52 } CODEC2;
53 
54 /*---------------------------------------------------------------------------*\
55 
56  FUNCTION HEADERS
57 
58 \*---------------------------------------------------------------------------*/
59 
60 void analyse_one_frame(CODEC2 *c2, MODEL *model, short speech[]);
61 void synthesise_one_frame(CODEC2 *c2, short speech[], MODEL *model,float ak[]);
62 
63 #endif