do_zfilt.c

来自「4.8k/s速率FS1016标准语音压缩源码」· C语言 代码 · 共 97 行

C
97
字号
/**************************************************************************** ROUTINE*		do_zfilt*		do_zfilt_dynamic** FUNCTION*		pole filter - given a filter structure*		do_zfilt assumes static coefficients*		do_zfilt_dynamic assumes changing coefficients** SYNOPSIS*		subroutine do_zfilt(flt, coef, data)**   formal **                       data    I/O*       name            type    type    function*       -------------------------------------------------------------------	*	flt		FILTER	i/o	FILTER structure*	coef		float	 i	coefficients*	data		float	i/o	input/filtered output data	*****************************************************************************       * DESCRIPTION**	Nonrecursive all-zero in-place time-domain filter.*	The filter is implemented in a direct form realisation.**               N       -i*       H(z) = SUM b(i)z*              i=0**       x(t) ->---(z0)----- b0 >------+-----> y(t)*                  |                  |*                  z1------ b1 >------+*                  |                  |*                  z2------ b2 >------+*                  |                  |*                  :                  :*                  |                  |*                  zN------ bN >------+******************************************************************************* CALLED BY**	FindAdaptResidual FindLPCResidual UpdateEverything*	HPF_InSpeech HPF_OutSpeech PostFilter ****************************************************************************/#include "celpfilt.h"void do_zfilt(FILTER *flt,float data[]){  register float ar;  int t, j;  for (t = 0; t < flt->data_length; t++)  {    flt->memory[0] = data[t];    ar   = 0.0;    for (j = flt->order; j > 0; j--)    {      ar  += flt->memory[j] * flt->coef[j];      flt->memory[j] = flt->memory[j-1];    }    data[t] = ar + flt->memory[0] * flt->coef[0];  }}void do_zfilt_dynamic(FILTER 	*flt,float	coef[],float 	data[]){  register float ar;  int t, j;  for (t = 0; t < flt->data_length; t++)  {    flt->memory[0] = data[t];    ar   = 0.0;    for (j = flt->order; j > 0; j--)    {      ar  += flt->memory[j] * coef[j];      flt->memory[j] = flt->memory[j-1];    }    data[t] = ar + flt->memory[0] * coef[0];  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?