GNU Radio 3.6.5 C++ API

codec2_internal.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002 
00003   FILE........: codec2_internal.h
00004   AUTHOR......: David Rowe
00005   DATE CREATED: 22 March 2011
00006 
00007   Some internal structures and states broken out here as they are useful for
00008   testing and development.
00009 
00010 \*---------------------------------------------------------------------------*/
00011 
00012 /*
00013   Copyright (C) 2011 David Rowe
00014 
00015   All rights reserved.
00016 
00017   This program is free software; you can redistribute it and/or modify
00018   it under the terms of the GNU Lesser General Public License version 2.1, as
00019   published by the Free Software Foundation.  This program is
00020   distributed in the hope that it will be useful, but WITHOUT ANY
00021   WARRANTY; without even the implied warranty of MERCHANTABILITY or
00022   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
00023   License for more details.
00024 
00025   You should have received a copy of the GNU Lesser General Public License
00026   along with this program; if not, see <http://www.gnu.org/licenses/>.
00027 */
00028 
00029 #ifndef __CODEC2_INTERNAL__
00030 #define  __CODEC2_INTERNAL__
00031 
00032 /*---------------------------------------------------------------------------*\
00033 
00034                              STATES
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 typedef struct {
00039     float  w[M];               /* time domain hamming window                */
00040     COMP   W[FFT_ENC];         /* DFT of w[]                                */
00041     float  Pn[2*N];            /* trapezoidal synthesis window              */
00042     float  Sn[M];              /* input speech                              */
00043     float  hpf_states[2];      /* high pass filter states                   */
00044     void  *nlp;                /* pitch predictor states                    */
00045     float  Sn_[2*N];           /* synthesised output speech                 */
00046     float  ex_phase;           /* excitation model phase track              */
00047     float  bg_est;             /* background noise estimate for post filter */
00048     float  prev_Wo;            /* previous frame's pitch estimate           */
00049     MODEL  prev_model;         /* previous frame's model parameters         */
00050     float  prev_lsps[LPC_ORD]; /* previous frame's LSPs                     */
00051     float  prev_energy;        /* previous frame's LPC energy               */
00052 } CODEC2;
00053 
00054 /*---------------------------------------------------------------------------*\
00055 
00056                              FUNCTION HEADERS
00057 
00058 \*---------------------------------------------------------------------------*/
00059 
00060 void analyse_one_frame(CODEC2 *c2, MODEL *model, short speech[]);
00061 void synthesise_one_frame(CODEC2 *c2, short speech[], MODEL *model,float ak[]);
00062 
00063 #endif