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

📄 gaeccnls.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 ----------------------------------------*/
/*--------------------- public vars ---------------------------------------*/
/*--------------------- local vars ----------------------------------------*/
/*--------------------- local functions -----------------------------------*/
/*-------------------------------------------------------------------------*/

/*-------------------------------------------------------------------------*/
#if defined(_dsp)
void                        gaec_cancel_dcC
#else
void                        gaec_cancel_dc
#endif
/*-------------------------------------------------------------------------*/
(
GAEC_tDb *pDb,
GAEC_tSc *pSc,
S16 *psAdf,
S16 *psErr,
S16 blk,
S16 band
)
{
    int  iRcv = GAEC_ADF_BSZ + blk;
	int  tap;
    S32  ac0;
    S16 *psRcv;

    psRcv = &(pDb->psRcv [GAEC_RCV_SZ * band + iRcv]);
    if (band) psAdf++;

    ac0 = (((S32)pSc->aasSin[band][blk])<<(15-pDb->asShft[band]));
	for(tap = 0; tap < GAEC_ADF_SZ; tap++)
	{
		ac0 -= *psRcv-- * (S32)*psAdf;
        psAdf += 2;
	}
    psErr[GAEC_BLKS*band+blk] = _Srnd(ac0, pDb->asShft[band]);
}

/*-------------------------------------------------------------------------*/
#if defined(_dsp)
void                        gaec_cancel_acC
#else
void                        gaec_cancel_ac
#endif
/*-------------------------------------------------------------------------*/
(
GAEC_tDb *pDb,
GAEC_tSc *pSc,
S16 *psAdf,
S16 *psErr,
S16 blk
)
{
    int  iRcv = GAEC_ADF_BSZ + blk;
	int  tap;
    int  band;
    S32  ac0;
	S32  ac1;

    for (band = 1; band < GAEC_BANDS; band++)
	{
        S16 *psRcvI = &(pDb->psRcv[(band+         0)*GAEC_RCV_SZ + iRcv]);
        S16 *psRcvQ = &(pDb->psRcv[(band+GAEC_BANDS)*GAEC_RCV_SZ + iRcv]);
        S16 *psAdfI = &(psAdf[band*GAEC_ADF_SZ*2  ]);
        S16 *psAdfQ = &(psAdf[band*GAEC_ADF_SZ*2+1]);

        ac0 = (((S32)pSc->aasSin[band           ][blk])<<(15-pDb->asShft[band]));
        ac1 = (((S32)pSc->aasSin[band+GAEC_BANDS][blk])<<(15-pDb->asShft[band]));

		for(tap = 0; tap < GAEC_ADF_SZ; tap++)
		{
			ac0 -= *psRcvI-- * (S32)*psAdfI;
			ac1 -= *psRcvQ-- * (S32)*psAdfI;
            psAdfI += 2;
        }
        psRcvI += GAEC_ADF_SZ;
        psRcvQ += GAEC_ADF_SZ;
		for(tap = 0; tap < GAEC_ADF_SZ; tap++)
		{
            ac1 += *psRcvI-- * (S32)*psAdfQ;
			ac0 -= *psRcvQ-- * (S32)*psAdfQ;
            psAdfQ += 2;
		}
        psErr[band*GAEC_BLKS+blk] = _Srnd(ac0, pDb->asShft[band]);
        psErr[(band+GAEC_BANDS)*GAEC_BLKS+blk] = _Srnd(ac1, pDb->asShft[band]);
	}
}

/*--------------------- public  functions ---------------------------------*/

⌨️ 快捷键说明

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