请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320C6748 大家好、
我使用 LCDK6748实现了 IIR 滤波器程序。 我使用 了程序中需要的 TI 库、并且生成了.out 文件。我给滤波器提供了一个正弦波作为 I/p、但在 o/p 中只观察到噪声。您能建议我如何检查 LCDKC6748中 IIR 滤波器的 o/p?
我将代码和 MATLAB 生成的系数文件附在下:-
// L138_irsos_intr
//
使用次级订购段实现的//IIR 滤波器
//floatingpointcoefficientsreadfromfile
//
#include"L138_LCDK_aic3106_init.h"
#include"bs1800int.cov"
float w[NUM_SECTIONS ][2]={0};
中断 void interrupt4 (void)//interruptserviceeroutine
{
int 段;//indexforsectionnumber
浮点输入;//inputtoeachsection
悬空 wn、yn;//中间值和输出值
input=((float) input_left_sample());//inputfromADC
for (section=0;<NUM_SECTIONS;section++))
{
wn=input-a[部分][1]*w[部分][0]
-a[section][2]*w[section][1];
YN=b[部分][0]*Wn+b[部分][1]*w[部分][0]
+b[section][2]*w[section][1];
w[段][1]=w[段][0];
w[部分][0]=wn;
input=yn;//outputofcurrentsectionisinputttonext
}
output_left_sample ((int16_t)(yn));//outputtoLDAC
返回;
}
int main (空)
{
L138_initialize_intr (FS_8000_Hz、ADC_GAIN_0dB、DAC_ATTEEN_0dB、LCDK_LINE_INPUT);
while (1);
}
系数文件
// bs1800int.cof
带通纹波为2dB 的//二阶1型切比雪夫 LPF
//和截止频率1500Hz
#define NUM_SECTIONS 1.
float b[NUM_SECTIONS ][3]={{0.0、0.48255、0.0}};
float A[NUM_SECTIONS ][3]={{1.0、-0.71624、0.387913}};