~ubuntu-branches/ubuntu/trusty/gnuradio/trusty

« back to all changes in this revision

Viewing changes to gr-vocoder/lib/codec2/codec2_internal.h

  • Committer: Package Import Robot
  • Author(s): A. Maitland Bottoms
  • Date: 2014-01-05 12:14:43 UTC
  • mfrom: (2.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20140105121443-je18dkof6uhox808
Tags: 3.7.2.1-5
use correct compiler for unstable build

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
  FILE........: codec2_internal.h
4
4
  AUTHOR......: David Rowe
5
 
  DATE CREATED: April 16 2012
 
5
  DATE CREATED: 22 March 2011
6
6
 
7
 
  Header file for Codec2 internal states, exposed via this header
8
 
  file to assist in testing.
 
7
  Some internal structures and states broken out here as they are useful for
 
8
  testing and development.
9
9
 
10
10
\*---------------------------------------------------------------------------*/
11
11
 
12
12
/*
13
 
  Copyright (C) 2012 David Rowe
 
13
  Copyright (C) 2011 David Rowe
14
14
 
15
15
  All rights reserved.
16
16
 
27
27
*/
28
28
 
29
29
#ifndef __CODEC2_INTERNAL__
30
 
#define __CODEC2_INTERNAL__
31
 
 
32
 
struct CODEC2 {
33
 
    int           mode;
34
 
    kiss_fft_cfg  fft_fwd_cfg;             /* forward FFT config                        */
35
 
    float         w[M];                    /* time domain hamming window                */
36
 
    COMP          W[FFT_ENC];              /* DFT of w[]                                */
37
 
    float         Pn[2*N];                 /* trapezoidal synthesis window              */
38
 
    float         Sn[M];                   /* input speech                              */
39
 
    float         hpf_states[2];           /* high pass filter states                   */
40
 
    void         *nlp;                     /* pitch predictor states                    */
41
 
 
42
 
    kiss_fft_cfg  fft_inv_cfg;             /* inverse FFT config                        */
43
 
    float         Sn_[2*N];                /* synthesised output speech                 */
44
 
    float         ex_phase;                /* excitation model phase track              */
45
 
    float         bg_est;                  /* background noise estimate for post filter */
46
 
    float         prev_Wo_enc;             /* previous frame's pitch estimate           */
47
 
    MODEL         prev_model_dec;          /* previous frame's model parameters         */
48
 
    float         prev_lsps_dec[LPC_ORD];  /* previous frame's LSPs                     */
49
 
    float         prev_e_dec;              /* previous frame's LPC energy               */
50
 
 
51
 
    int           lpc_pf;                  /* LPC post filter on                        */
52
 
    int           bass_boost;              /* LPC post filter bass boost                */
53
 
    float         beta;                    /* LPC post filter parameters                */
54
 
    float         gamma;
55
 
 
56
 
    float         xq_enc[2];               /* joint pitch and energy VQ states          */
57
 
    float         xq_dec[2];
58
 
 
59
 
    int           smoothing;               /* enable smoothing for channels with errors */
60
 
};
 
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[]);
61
62
 
62
63
#endif