📄 wcelp.asm
字号:
/**************************************************************************
*
* ROUTINE bwexp
*
* FUNCTION
* Bandwidth expansion of LPC predictor coefficients
*
* SYNOPSIS
* bwexp(float alpha, float *pc, float *pcexp, int 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
* CALLS none
*
**************************************************************************/
void bwexp(float alpha, float *pc, float *pcexp, int n)
{
int i;
int j,ax0,ax1;
long acc,p32;
float tpc[10];
for (i = 0; i <= n; i++)
tpc[i] = pc[i]*pow(alpha,(double)(i));
ax1=alpha*0x8000u; //alpha:1.15
for (i = 0; i <= n; i++)
{ //pcexp[i] = pc[i]*pow(alpha,(double)(i)); pc: 3.13
if(pc[i]>=4.0) {printf("pc>4.0 at bwexp.c .\n"); exit(0); }
if(i==0) { pcexp[i]=pc[i]; continue; }
ax0=pc[i]*0x2000u; //pc:3.13;
p32=ax0;
for(j=0;j<i; j++)
{ p32=p32*ax1; //3.13*1.15->3.13
p32>>=15;
}
pcexp[i]=(float)p32/0x2000u;
}
i=i;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -