c语言信号处理算法开发_工具库建立

工具库的意义:

  1. 多个算法可使用同一工具库, 不用重复造轮子
  2. 将所用到的函数定义为结构体成员 方便使用及访问
typedef struct
{
    void(*find_maxinfloatotfloat)                   (float*, int32_t, int32_t, float*, int32_t*);         
}basic_mathfunc_t;

void    Find_MaxInFloatOtFloat(float * datain, int32_t st_pos, int32_t ed_pos, float * res, int32_t *pos)
{
    float resss = -2000000000.0f;
    int32_t pos_1 = 0;
    for (int32_t i = st_pos; i <= ed_pos; i++)
    {
        if (resss < datain[i])
        {
            resss = datain[i];
            pos_1 = i;
        }
    }
    if (res != NULL)
    {
        *res = resss;
    }
    if (pos != NULL)
    {
        *pos = pos_1;
    }
}
void    Basic_MathFuncReg(basic_mathfunc_t  *basic_mathfunc_s)
{
    basic_mathfunc_s->find_maxinfloatotfloat        = Find_MaxInFloatOtFloat;
}

使用:

static basic_mathfunc_t basic_mathfunc_s;
Basic_MathFuncReg(basic_mathfunc_s);
basic_mathfunc_s->find_maxinfloatotfloat(datain, 0, 10, &max_val, &max_pos);

拓展:
在信号处理中, 常用的工具有:

  1. 最大值查找
  2. 最小值查找
  3. 均值查找
  4. std计算
  5. 求和
  6. fir滤波器
  7. 中值滤波
  8. 一维均值滤波
  9. iir陷波器
  10. 小波分解 与重构
  11. 形态学滤波
  12. 线性拟合
  13. 误差计算
  14. fft
  15. RMS
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值