?? bwexp.c
字號:
/**************************************************************************
*
* ROUTINE
* bwexp
*
* FUNCTION
* Bandwidth expansion of LPC predictor coefficients
*
* SYNOPSIS
* subroutine bwexp(alpha, pc, pcexp, n)
*
* formal
* data I/O
* name type type function
* -------------------------------------------------------------------
* alpha float i Bandwidth expansion factor
* pc float i predictor coefficients
* pcexp float o expanded predictor coefficients
* n int i predictor order
***************************************************************************
*
* DESCRIPTION
*
* Subroutine to perform bandwidth modification by moving the poles
* (or zeros) radially in the z plane. If the bandwidth expansion
* factor (alpha) is less than unity, the bandwidths are expanded by
* shifting the poles (or zeros) toward the origin of the z plane.
* The predictor coefficients are scaled directly according to:
*
* i-1
* a' = a alpha where i = 1, . . . , order+1
* i i
*
* Resulting in a bandwidth expansion of:
*
* -(fs/pi)ln(alpha) Hz
*
* (e.g., fs = 8 kHz, alpha = 0.994127 -> 15 Hz bandwidth expansion)
*
* CELP's LPC predictor coefficient convention is:
* p+1 -(i-1)
* A(z) = SUM a z where a = +1.0
* i=1 i 1
*
***************************************************************************
*
* CALLED BY
*
* autohf confg impls postfilter
*
* CALLS
*
*
*
**************************************************************************/
#include <math.h>
bwexp(alpha, pc, pcexp, n)
int n;
float alpha, pc[], pcexp[];
{
/*
register int i;
for (i = 0; i <= n; i++)
pcexp[i] = pc[i]*pow(alpha,(double)(i));
pcexp[0] = pc[0]*pow(alpha,(double)(0));
pcexp[1] = pc[1]*pow(alpha,(double)(1));
pcexp[2] = pc[2]*pow(alpha,(double)(2));
pcexp[3] = pc[3]*pow(alpha,(double)(3));
pcexp[4] = pc[4]*pow(alpha,(double)(4));
pcexp[5] = pc[5]*pow(alpha,(double)(5));
pcexp[6] = pc[6]*pow(alpha,(double)(6));
pcexp[7] = pc[7]*pow(alpha,(double)(7));
pcexp[8] = pc[8]*pow(alpha,(double)(8));
pcexp[9] = pc[9]*pow(alpha,(double)(9));
pcexp[10] = pc[10]*pow(alpha,(double)(10));
*/
register float tmp;
pcexp[0] = pc[0];
pcexp[1] = pc[1]*alpha;
tmp = alpha * alpha;
pcexp[2] = pc[2]*tmp;
tmp *= alpha;
pcexp[3] = pc[3]*tmp;
tmp *= alpha;
pcexp[4] = pc[4]*tmp;
tmp *= alpha;
pcexp[5] = pc[5]*tmp;
tmp *= alpha;
pcexp[6] = pc[6]*tmp;
tmp *= alpha;
pcexp[7] = pc[7]*tmp;
tmp *= alpha;
pcexp[8] = pc[8]*tmp;
tmp *= alpha;
pcexp[9] = pc[9]*tmp;
tmp *= alpha;
pcexp[10] = pc[10]*tmp;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -