⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gaecepc.c

📁 TI公司DSP/tms320c55x/tms320c54x系列的声学回声消除代码
💻 C
字号:
/*-------------------------------------------------------------------------*
 *                                                                         *
 *   THIS IS AN UNPUBLISHED WORK CONTAINING CONFIDENTIAL AND PROPRIETARY   *
 *   INFORMATION.  IF PUBLICATION OCCURS, THE FOLLOWING NOTICE APPLIES:    *
 *      "COPYRIGHT 2002 MIKET DSP SOLUTIONS, ALL RIGHTS RESERVED"          *
 *                                                                         *
 *-------------------------------------------------------------------------*/

#include "gaeci.h"

/*--------------------- local defs ----------------------------------------*/

#define _NSE_REG        (GAEC_DB(10))

/*--------------------- public vars ---------------------------------------*/

#if !defined (_dsp)
S16 _sEpcRcvXmax;
S16 _sEpcSndXmax;
GAEC_tScEpc _GaecScEpc;
#endif

/*--------------------- local vars ----------------------------------------*/
/*--------------------- local functions -----------------------------------*/

/*-------------------------------------------------------------------------*/

/*-------------------------------------------------------------------------*/
void                        _epc_crit
/*-------------------------------------------------------------------------*/
(
GAEC_tDb *pDb,
GAEC_tSc *pSc
)
{
    S16 sDlt = pDb->sEpcXcr + GAEC_DB(15);

    if (sDlt < -GAEC_CRIT_MAX/3)
        sDlt = -GAEC_CRIT_MAX/3;

    if (sDlt > GAEC_CRIT_MAX/3)
        sDlt = GAEC_CRIT_MAX/3;

    pDb->sEpcCrit += sDlt;

    if (pDb->sEpcCrit < GAEC_CRIT_MIN)
        pDb->sEpcCrit = GAEC_CRIT_MIN;

    if (pDb->sEpcCrit > GAEC_CRIT_MAX)
        pDb->sEpcCrit = GAEC_CRIT_MAX;

}
/*-------------------------------------------------------------------------*/
void                        gaec_epc_xcorrelation
/*-------------------------------------------------------------------------*/
(
GAEC_tDb *pDb,
GAEC_tSc *pSc,
S16 *psRcv,
S16 *psSnd
)
{
    S32 slReg;
    S16 sLevel;

    sLevel = gaec_utl_exp(pDb->sVadRinNse + _NSE_REG);
    slReg = sLevel * (S32)sLevel;
    gaec_epc_in(pDb->asEpcRcvIn, pDb->aslEpcRcv, pSc->u.Epc.asEpcRcv, psRcv, &slReg);

    sLevel = gaec_utl_exp(pDb->sVadErrNse + _NSE_REG);
    slReg = sLevel * (S32)sLevel;
    gaec_epc_in(pDb->asEpcSndIn, pDb->aslEpcSnd, pSc->u.Epc.asEpcSnd, psSnd, &slReg);
    gaec_epc_corr(pDb, &pSc->u.Epc);
    _epc_crit(pDb, pSc);



#if !defined(_dsp)
    {
        int sDelay;
        _sEpcRcvXmax = 0;
        _sEpcSndXmax = 0;
        for (sDelay = GAEC_EPC_MIND; sDelay < GAEC_EPC_MAXD; sDelay++)
        {
            if (_sEpcRcvXmax < pSc->u.Epc.asEpcRcv[sDelay])
                _sEpcRcvXmax = pSc->u.Epc.asEpcRcv[sDelay];
            if (_sEpcSndXmax < pSc->u.Epc.asEpcSnd[sDelay])
                _sEpcSndXmax = pSc->u.Epc.asEpcSnd[sDelay];
        }
		_GaecScEpc = pSc->u.Epc;
    }
#endif

#if 0
    {
        ac0 = _sEpcRcvXmax * (S32) _sEpcRcvXmax;
        S16 sAtt = gaec_utl_en2log(ac0);
        pDb->sEpcXcr += (sAtt + GAEC_DB(20));

        ac0 = _sEpcSndXmax * (S32) _sEpcSndXmax;
        sAtt = gaec_utl_en2log(ac0);
        pDb->sEpcXcr += (sAtt + GAEC_DB(20));
    }
#endif
}

⌨️ 快捷键说明

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