1 Star 0 Fork 0

tectim/engine-sim

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
preemphasis_filter.h 611 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ange Yaghi 提交于 2022-08-27 06:39 +08:00 . Many things...
#ifndef ATG_ENGINE_SIM_PREEMPHASIS_FILTER_H
#define ATG_ENGINE_SIM_PREEMPHASIS_FILTER_H
#include "filter.h"
#include "low_pass_filter.h"
#include <random>
class PreemphasisFilter : public Filter {
public:
PreemphasisFilter() { m_lastSample = 0; }
virtual ~PreemphasisFilter() {}
virtual float f(float sample) override { return fast_f(sample); }
__forceinline float fast_f(float sample) {
const float s = -0.95f * sample + m_lastSample;
m_lastSample = sample;
return s;
}
protected:
float m_lastSample;
};
#endif /* ATG_ENGINE_SIM_PREEMPHASIS_FILTER_H */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tectim/engine-sim.git
git@gitee.com:tectim/engine-sim.git
tectim
engine-sim
engine-sim
master

搜索帮助