完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,在使用 ADSP 21571 iir硬件加速器的时候,碰到输出异常的问题,下面是我的代码,请帮忙看看配置是否正确
int iir_init(IIR_CHANNEL_HANDLE* iir_channel_handle,int ch_num) { int ch_idx; for(ch_idx = 0; ch_idx < ch_num ; ch_idx++) { iir_tcb[ch_idx].nIIRControl2 = ((iir_channel_handle[ch_idx].nNumBiquads - 1u) << BITP_IIR_CTL2_BIQUADS) | ((iir_channel_handle[ch_idx].nWindowSize - 1u) << BITP_IIR_CTL2_WINDOW); iir_tcb[ch_idx].nCoeffCount = iir_channel_handle[ch_idx].nCoefficientCount; iir_tcb[ch_idx].pCoeffIndex = ConvertAddr(iir_channel_handle[ch_idx].pCoefficientBuff); iir_tcb[ch_idx].nCoeffModify = iir_channel_handle[ch_idx].nCoefficientModify; iir_tcb[ch_idx].pInputBase = ConvertAddr(iir_channel_handle[ch_idx].pInputBuffBase); iir_tcb[ch_idx].pInputindex = ConvertAddr(iir_channel_handle[ch_idx].pInputBuffIndex); iir_tcb[ch_idx].nInputCount = iir_channel_handle[ch_idx].nInputBuffCount; iir_tcb[ch_idx].nInputModify = iir_channel_handle[ch_idx].nInputBuffModify; iir_tcb[ch_idx].pOutputBase = ConvertAddr(iir_channel_handle[ch_idx].pOutputBuffBase); iir_tcb[ch_idx].pOutputIndex = ConvertAddr(iir_channel_handle[ch_idx].pOutputBuffIndex); iir_tcb[ch_idx].nOutputCount = iir_channel_handle[ch_idx].nOutputBuffCount; iir_tcb[ch_idx].nOutputModify = iir_channel_handle[ch_idx].nOutputBuffModify; //iir_tcb[ch_idx].pNextTCB = ConvertAddr( iir_tcb.nIIRControl2); } /*layout TCB*/ for(ch_idx = 0; ch_idx < ch_num ; ch_idx++) { if(ch_idx < (ch_num-1)) { iir_tcb[ch_idx].pNextTCB = ConvertAddr( iir_tcb[ch_idx+1].nIIRControl2); } else { iir_tcb[ch_idx].pNextTCB = ConvertAddr( iir_tcb[0].nIIRControl2); } } *pREG_IIR0_CHNPTR = (uint32_t)ConvertAddr( iir_tcb[0].nIIRControl2); *pREG_IIR0_CTL1 = IIR_DEF_IIRCTL1; *pREG_IIR0_CTL1 = (*pREG_IIR0_CTL1 ~BITM_IIR_CTL1_CCINTR) | BITM_IIR_CTL1_CCINTR; return 0; } int iir_calc(void) { *pREG_IIR0_CTL1 = IIR_DEF_IIRCTL1; // asm("nop;nop;nop;nop;"); #if defined(__ADSPSC573_FAMILY__) *pREG_IIR0_CTL1 = ((IIR_CH_NUM-1u) << BITP_IIR_CTL1_CH) | BITM_IIR_CTL1_EN | BITM_IIR_CTL1_DMAEN | BITM_IIR_CTL1_BURSTEN; #else *pREG_IIR0_CTL1 = ((IIR_CH_NUM-1u) << BITP_IIR_CTL1_CH) | BITM_IIR_CTL1_EN | BITM_IIR_CTL1_DMAEN; #endif return 0; } 先调用iir_init进行初始化,然后,中断中周期性调用iir_calc()进行计算,对1k sine信号进行滤波, 系数如下 1.00000000000000000000e+000, 0.666666666666666, -0.530581468189800, 1.00000000000000000000e+000, -0.725420951973028, 0.00000000000000000000e+000, 0.00000000000000000000e+000 |
|
相关推荐
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
RK3588 HDMI in 接入设备如何获取HDMI in 传入的音频?
366 浏览 0 评论
22832 浏览 1 评论
1228 浏览 0 评论
硬创大赛项目专访 | 田奕鑫:专注细分领域创新,我们和行业巨头“化敌为友”
94537 浏览 1 评论
硬创大赛项目专访 | 王猛:专研降噪技术,让中国的黑科技产品服务全球用户
24409 浏览 1 评论
浏览过的版块 |
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-4 00:57 , Processed in 0.500409 second(s), Total 69, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号