/*
*
文件名:
ArithmeticFilter.c
*
功能描述:算术平均滤波,一个周期内采样
N
次数据,
*
取
N
次采样值的算术平均值做为这个周期的采样值
*/
#include
#define
uchar
unsigned char
#define
uint
unsigned int
//
采样次数
#define
N
4
//4
次采样值
float code sample[N] = {0x150, 0x210, 0x310, 0x110};
//
函数原型申明
float ArithmeticFilter();
/*
*
函数名:
main
*
功能描述:
main
主程序
*
输入参数:无
*
返回值:无
*/
void main(void)
{
float result;
result = ArithmeticFilter();
while (1);
}
/*
*
函数名:
ArithmeticFilter
*
功能键描述:算术平均滤波
*
输入参数:无
*
返回值:
N
次采样的平均值
*/