我想实现一个1阶高通滤波器,在matlab中通过FDATool工具,导出了相关的数据,如下:
/*
* Filter Coefficients (C Source) generated by the Filter Design and Analysis Tool
*
* Generated by MATLAB(R) 7.2 and the Signal Processing Toolbox 6.5.
*
* Generated on: 16-Aug-2013 09:03:09
*
*/
/*
* Discrete-Time IIR Filter (real)
* -------------------------------
* Filter Structure : Direct-Form I
* Numerator Length : 2
* Denominator Length : 2
* Stable : Yes
* Linear Phase : No
*
* Implementation Cost
* Number of Multipliers : 3
* Number of Adders : 2
* Number of States : 2
* MultPerInputSample : 3
* AddPerInputSample : 2
*/
/* General type conversion for MATLAB generated C-code */
#include "tmwtypes.h"
/*
* Expected path to tmwtypes.h
* C:\Program Files\MATLAB\R2006a\extern\include\tmwtypes.h
*/
/*
* Warning - Filter coefficients were truncated to fit specified data type.
* The resulting response may not match generated theoretical response.
* Use the Filter Design & Analysis Tool to design accurate
* single-precision filter coefficients.
*/
const int NL = 2;
const real32_T NUM[2] = {
1.000200033, -1.000200033
};
const int DL = 2;
const real32_T DEN[2] = {
1, -0.9991999865
};
现在的问题是,通过这个东西,怎么样在2812中编出IIR滤波器来?或者说,知道了滤波器Z域传递函数,怎么编出IIR滤波器来? 本人对这些东西不太懂,求指点,如果有相关例程更好了,谢谢大家了