00001 /* 00002 * broadvoice - a library for the BroadVoice 16 and 32 codecs 00003 * 00004 * bvcommon.h - 00005 * 00006 * Adapted by Steve Underwood <steveu@coppice.org> from code which is 00007 * Copyright 2000-2009 Broadcom Corporation 00008 * 00009 * All rights reserved. 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU Lesser General Public License version 2.1, 00013 * as published by the Free Software Foundation. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public 00021 * License along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00023 * 00024 * $Id: bvcommon.h,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $ 00025 */ 00026 00027 #include "typedef.h" 00028 00029 #ifndef BVCOMMON_H 00030 #define BVCOMMON_H 00031 00032 /* Function Prototypes */ 00033 00034 void apfilter(const Float *a, /* (i) a[m+1] prediction coefficients (m=10) */ 00035 int m, /* (i) LPC order */ 00036 Float *x, /* (i) input signal */ 00037 Float *y, /* (o) output signal */ 00038 int lg, /* (i) size of filtering */ 00039 Float *mem, /* (i/o) input memory */ 00040 int16_t update); /* (i) flag for memory update */ 00041 00042 void azfilter(const Float *a, /* (i) prediction coefficients */ 00043 int m, /* (i) LPC order */ 00044 Float *x, /* (i) input signal vector */ 00045 Float *y, /* (o) output signal vector */ 00046 int lg, /* (i) size of filtering */ 00047 Float *mem, /* (i/o) filter memory before filtering */ 00048 int16_t update); /* (i) flag for memory update */ 00049 00050 void Autocor(Float *r, /* (o) : Autocorrelations */ 00051 Float *x, /* (i) : Input signal */ 00052 const Float *window, /* (i) : LPC Analysis window */ 00053 int l_window, /* (i) : window length */ 00054 int m); /* (i) : LPC order */ 00055 00056 void Levinson(Float *r, /* (i): autocorrelation coefficients */ 00057 Float *a, /* (o): LPC coefficients */ 00058 Float *old_a, /* (i/o): LPC coefficients of previous frame */ 00059 int m); /* (i): LPC order */ 00060 00061 void a2lsp(Float pc[], /* (i) input the np+1 predictor coeff. */ 00062 Float lsp[], /* (o) line spectral pairs */ 00063 Float old_lsp[]); /* (i/o) old lsp[] (in case not found 10 roots) */ 00064 00065 void lsp2a(Float *lsp, /* (i) LSP vector */ 00066 Float *a); /* (o) LPC coefficients */ 00067 00068 void stblz_lsp(Float *lsp, int order); 00069 00070 int stblchck(Float *x, int vdim); 00071 00072 /* LPC to LSP Conversion */ 00073 extern Float grid[]; 00074 00075 /* LPC bandwidth expansion */ 00076 extern Float bwel[]; 00077 00078 /* LPC WEIGHTING FILTER */ 00079 extern Float STWAL[]; 00080 00081 /* ----- Basic Codec Parameters ----- */ 00082 #define LPCO 8 /* LPC Order */ 00083 #define Ngrd 60 /* LPC to LSP Conversion */ 00084 00085 #define LSPMIN 0.00150 /* minimum LSP frequency, 6/12 Hz for BV16/BV32 */ 00086 #define LSPMAX 0.99775 /* maximum LSP frequency, 3991/7982 Hz for BV16/BV32 */ 00087 #define DLSPMIN 0.01250 /* minimum LSP spacing, 50/100 Hz for BV16/BV32 */ 00088 #define STBLDIM 3 /* dimension of stability enforcement */ 00089 00090 #endif /* BVCOMMON_H */