- 打卡等级:以坛为家I
- 打卡总天数:365
- 最近打卡:2025-05-02 00:20:03
金牌会员
- 积分
- 2206
|
看了STC32F系列的单片机介绍,这款芯片主频高,
有32位硬件乘除单元和单精度浮点运算单元,看起来性能不错.
不知道跑高阶窄带数字滤波的话,中心频率最高能做到多少?
下面是用滤波器工具生成的一段滤波代码,
哪位大佬能不能测试下用STC32F测试下运行速度.
float DigFil(invar, setic)
float invar; int setic;
/******************************************************************************/
/* Filter Solutions Version 2015 Nuhertz Technologies, L.L.C. */
/* www.nuhertz.com */
/* +1 602-279-2448 */
/* 20th Order Band Pass Butterworth */
/* Matched Z Transformation */
/* Sample Frequency = 300.0 KHz */
/* Standard Form */
/* Arithmetic Precision = 4 Digits */
/* */
/* Center Frequency = 100.0 KHz */
/* Pass Band Width = 2.700 KHz */
/* Pass Band Attenuation = 1.2 dB */
/* */
/******************************************************************************/
/* */
/* Input Variable Definitions: */
/* Inputs: */
/* invar float The input to the filter */
/* setic int 1 to initialize the filter to zero */
/* */
/* Option Selections: */
/* Standard C; Initializable; Internal States; Optimized; */
/* */
/* There is no requirement to ever initialize the filter. */
/* The default initialization is zero when the filter is first called */
/* */
/******************************************************************************/
/* */
/* This software is automatically generated by Filter Solutions */
/* no restrictions from Nuhertz Technologies, L.L.C. regarding the use and */
/* distributions of this software. */
/* */
/******************************************************************************/
{
float sumnum=0.0, sumden=0.0; int i=0;
static float states[40] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
static float znum[21] = {
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.304e-31
};
static float zden[40] = {
.4763,
9.703,
103.8,
765.0,
4334.0,
2.e+04,
7.79e+04,
2.624e+05,
7.778e+05,
2.055e+06,
4.885e+06,
1.053e+07,
2.071e+07,
3.736e+07,
6.201e+07,
9.504e+07,
1.348e+08,
1.773e+08,
2.166e+08,
2.46e+08,
2.598e+08,
2.553e+08,
2.333e+08,
1.982e+08,
1.564e+08,
1.144e+08,
7.746e+07,
4.843e+07,
2.787e+07,
1.47e+07,
7.077e+06,
3.089e+06,
1.214e+06,
4.25e+05,
1.309e+05,
3.488e+04,
7845.0,
1437.0,
202.3,
19.63
};
if (setic==1){
for (i=0;i<40;i++) states = 4.156e-10*invar;
return 0.0;
}
else{
sumnum = sumden = 0.0;
for (i=0;i<40;i++){
sumden += states*zden;
sumnum += states*znum[i<21?i:40-i];
if (i<39) states = states[i+1];
}
states[39] = invar-sumden;
sumnum += states[39]*znum[0];
return sumnum;
}
}
|
|