GNU Radio's M17 Package
codec2_internal.h File Reference
#include <stdint.h>
#include <math.h>
#include "kiss_fft.h"
#include "kiss_fftr.h"

Go to the source code of this file.

Classes

struct  model_t
struct  nlp_t
struct  codec2_encoder_t
struct  codec2_decoder_t
struct  codec2_t

Macros

#define M_PI   3.14159265358979323846
#define TWO_PI   (2.0f * M_PI)
#define POW10F(x)
#define BYTES_PER_FRAME   8
#define SAMPLES_PER_FRAME   (2 * N_SAMP)
#define N_S   0.01
#define MAX_AMP   80
#define FFT_ENC   512
#define FFT_DEC   512
#define V_THRESH   6.0
#define V_THRESH_LIN   (powf(10.0f, V_THRESH * 0.1f))
#define LPC_ORD   10
#define P_MAX_S   0.0200f
#define SAMP_RATE   8000
#define N_SAMP   80
#define M_PITCH   320
#define P_MIN   20
#define P_MAX   160
#define W0_MIN   ((2.0 * M_PI) / 160.0)
#define W0_MAX   ((2.0 * M_PI) / 20.0)
#define NW   279
#define TW   40
#define PMAX_M   320
#define COEFF   0.95
#define PE_FFT_SIZE   512
#define DEC   5
#define NDEC   (M_PITCH / DEC)
#define T   0.1
#define CNLP   0.3
#define NLP_NTAP   48
#define NLP_NPHASE   DEC
#define NLP_TAPS_PP   ((NLP_NTAP + DEC - 1) / DEC)
#define WO_BITS   7
#define WO_LEVELS   (1 << WO_BITS)
#define E_BITS   5
#define E_LEVELS   (1 << E_BITS)
#define E_MIN_DB   -10.0
#define E_MAX_DB   40.0
#define LSPD_SCALAR_INDEXES   10
#define LPCPF_GAMMA   0.5
#define LPCPF_BETA   0.2
#define LPCPF_TWO_BETA   (2.0 * LPCPF_BETA)
#define LSP_DELTA1   0.01
#define BG_THRESH   40.0
#define BG_BETA   0.1
#define BG_MARGIN   6.0
#define LPC_ENERGY_FLOOR   1e-6f
#define FFT_R   (TWO_PI / FFT_ENC)
#define FFT_1_R   (FFT_ENC / TWO_PI)
#define CODEC2_RAND_MAX   32767
#define FFT_FWD_MEM_BYTES   4360
#define FFTR_MEM_BYTES   5408

Typedefs

typedef kiss_fft_cpx complex_t
typedef struct model_t model_t
typedef struct nlp_t nlp_t
typedef struct codec2_encoder_t codec2_encoder_t
typedef struct codec2_decoder_t codec2_decoder_t
typedef struct codec2_t codec2_t

Variables

const float nlp_fir [NLP_NTAP]
const float bw_gamma [LPC_ORD+1]
const uint16_t delta_lsp_cb [LPC_ORD][32]

Macro Definition Documentation

◆ BG_BETA

#define BG_BETA   0.1

◆ BG_MARGIN

#define BG_MARGIN   6.0

◆ BG_THRESH

#define BG_THRESH   40.0

◆ BYTES_PER_FRAME

#define BYTES_PER_FRAME   8

◆ CNLP

#define CNLP   0.3

◆ CODEC2_RAND_MAX

#define CODEC2_RAND_MAX   32767

◆ COEFF

#define COEFF   0.95

◆ DEC

#define DEC   5

◆ E_BITS

#define E_BITS   5

◆ E_LEVELS

#define E_LEVELS   (1 << E_BITS)

◆ E_MAX_DB

#define E_MAX_DB   40.0

◆ E_MIN_DB

#define E_MIN_DB   -10.0

◆ FFT_1_R

#define FFT_1_R   (FFT_ENC / TWO_PI)

◆ FFT_DEC

#define FFT_DEC   512

◆ FFT_ENC

#define FFT_ENC   512

◆ FFT_FWD_MEM_BYTES

#define FFT_FWD_MEM_BYTES   4360

◆ FFT_R

#define FFT_R   (TWO_PI / FFT_ENC)

◆ FFTR_MEM_BYTES

#define FFTR_MEM_BYTES   5408

◆ LPC_ENERGY_FLOOR

#define LPC_ENERGY_FLOOR   1e-6f

◆ LPC_ORD

#define LPC_ORD   10

◆ LPCPF_BETA

#define LPCPF_BETA   0.2

◆ LPCPF_GAMMA

#define LPCPF_GAMMA   0.5

◆ LPCPF_TWO_BETA

#define LPCPF_TWO_BETA   (2.0 * LPCPF_BETA)

◆ LSP_DELTA1

#define LSP_DELTA1   0.01

◆ LSPD_SCALAR_INDEXES

#define LSPD_SCALAR_INDEXES   10

◆ M_PI

#define M_PI   3.14159265358979323846

◆ M_PITCH

#define M_PITCH   320

◆ MAX_AMP

#define MAX_AMP   80

◆ N_S

#define N_S   0.01

◆ N_SAMP

#define N_SAMP   80

◆ NDEC

#define NDEC   (M_PITCH / DEC)

◆ NLP_NPHASE

#define NLP_NPHASE   DEC

◆ NLP_NTAP

#define NLP_NTAP   48

◆ NLP_TAPS_PP

#define NLP_TAPS_PP   ((NLP_NTAP + DEC - 1) / DEC)

◆ NW

#define NW   279

◆ P_MAX

#define P_MAX   160

◆ P_MAX_S

#define P_MAX_S   0.0200f

◆ P_MIN

#define P_MIN   20

◆ PE_FFT_SIZE

#define PE_FFT_SIZE   512

◆ PMAX_M

#define PMAX_M   320

◆ POW10F

#define POW10F ( x)
Value:
powf(10.0f, (x))

◆ SAMP_RATE

#define SAMP_RATE   8000

◆ SAMPLES_PER_FRAME

#define SAMPLES_PER_FRAME   (2 * N_SAMP)

◆ T

#define T   0.1

◆ TW

#define TW   40

◆ TWO_PI

#define TWO_PI   (2.0f * M_PI)

◆ V_THRESH

#define V_THRESH   6.0

◆ V_THRESH_LIN

#define V_THRESH_LIN   (powf(10.0f, V_THRESH * 0.1f))

◆ W0_MAX

#define W0_MAX   ((2.0 * M_PI) / 20.0)

◆ W0_MIN

#define W0_MIN   ((2.0 * M_PI) / 160.0)

◆ WO_BITS

#define WO_BITS   7

◆ WO_LEVELS

#define WO_LEVELS   (1 << WO_BITS)

Typedef Documentation

◆ codec2_decoder_t

typedef struct codec2_decoder_t codec2_decoder_t

◆ codec2_encoder_t

typedef struct codec2_encoder_t codec2_encoder_t

◆ codec2_t

typedef struct codec2_t codec2_t

◆ complex_t

◆ model_t

typedef struct model_t model_t

◆ nlp_t

typedef struct nlp_t nlp_t

Variable Documentation

◆ bw_gamma

const float bw_gamma[LPC_ORD+1]
extern

◆ delta_lsp_cb

const uint16_t delta_lsp_cb[LPC_ORD][32]
extern

◆ nlp_fir

const float nlp_fir[NLP_NTAP]
extern