Smart Remote 3 nRF52 v1.2
Copy URL
Source
Libraries
bv32fp-1.2
bvcommon.h
1
/*****************************************************************************/
2
/* BroadVoice(R)32 (BV32) Floating-Point ANSI-C Source Code */
3
/* Revision Date: October 5, 2012 */
4
/* Version 1.2 */
5
/*****************************************************************************/
6
7
/*****************************************************************************/
8
/* Copyright 2000-2012 Broadcom Corporation */
9
/* */
10
/* This software is provided under the GNU Lesser General Public License, */
11
/* version 2.1, as published by the Free Software Foundation ("LGPL"). */
12
/* This program is distributed in the hope that it will be useful, but */
13
/* WITHOUT ANY SUPPORT OR WARRANTY; without even the implied warranty of */
14
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LGPL for */
15
/* more details. A copy of the LGPL is available at */
16
/* http://www.broadcom.com/licenses/LGPLv2.1.php, */
17
/* or by writing to the Free Software Foundation, Inc., */
18
/* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19
/*****************************************************************************/
20
21
22
/*****************************************************************************
23
bvcommon.h : Common #defines and prototypes
24
25
$Log$
26
******************************************************************************/
27
28
#ifndef BVCOMMON_H
29
#define BVCOMMON_H
30
31
#include "typedef.h"
32
33
/* Function Prototypes */
34
35
36
void
pp3dec(
37
short
idx,
38
Float *b);
39
40
void
apfilter(
41
Float *a,
/* (i) a[m+1] prediction coefficients (m=10) */
42
int
m,
/* (i) LPC order */
43
Float *x,
/* (i) input signal */
44
Float *y,
/* (o) output signal */
45
int
lg,
/* (i) size of filtering */
46
Float *mem,
/* (i/o) input memory */
47
short
update);
/* (i) flag for memory update */
48
49
void
azfilter(
50
Float *a,
/* (i) prediction coefficients */
51
int
m,
/* (i) LPC order */
52
Float *x,
/* (i) input signal vector */
53
Float *y,
/* (o) output signal vector */
54
int
lg,
/* (i) size of filtering */
55
Float *mem,
/* (i/o) filter memory before filtering */
56
short
update);
/* (i) flag for memory update */
57
58
void
Autocor(
59
Float *r,
/* (o) : Autocorrelations */
60
Float *x,
/* (i) : Input signal */
61
Float *window,
/* (i) : LPC Analysis window */
62
int
l_window,
/* (i) : window length */
63
int
m);
/* (i) : LPC order */
64
65
void
Levinson(
66
Float *r,
/* (i): autocorrelation coefficients */
67
Float *a,
/* (o): LPC coefficients */
68
Float *old_a,
/* (i/o): LPC coefficients of previous frame */
69
int
m);
/* (i): LPC order */
70
71
void
a2lsp(
72
Float pc[],
/* (i) input the np+1 predictor coeff. */
73
Float lsp[],
/* (o) line spectral pairs */
74
Float old_lsp[]);
/* (i/o) old lsp[] (in case not found 10 roots) */
75
76
void
lsp2a(
77
Float *lsp,
/* (i) LSP vector */
78
Float *a);
/* (o) LPC coefficients */
79
80
void
stblz_lsp(Float *lsp,
int
order);
81
int
stblchck(Float *x,
int
vdim);
82
83
/* LPC to LSP Conversion */
84
extern
Float grid[];
85
86
/* LPC bandwidth expansion */
87
extern
Float bwel[];
88
89
/* LPC WEIGHTING FILTER */
90
extern
Float STWAL[];
91
92
/* ----- Basic Codec Parameters ----- */
93
#define LPCO 8
/* LPC Order */
94
#define Ngrd 60
/* LPC to LSP Conversion */
95
96
#define LSPMIN 0.00150f
/* minimum lsp frequency, 6/12 Hz for BV16/BV32 */
97
#define LSPMAX 0.99775f
/* maximum lsp frequency, 3991/7982 Hz for BV16/BV32 */
98
#define DLSPMIN 0.01250f
/* minimum lsp spacing, 50/100 Hz for BV16/BV32 */
99
#define STBLDIM 3
/* dimension of stability enforcement */
100
101
extern
Float pp9cb[];
102
103
#endif
/* BVCOMMON_H */