不韋 呂
/
SDR_AM_Rx_CIC
AM中波放送用SDR.CICフィルタのみを使用.CQ出版社「トランジスタ技術」誌,2021年4月号に掲載
SDR_Library/IirDcCut.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2019-09-23
- Revision:
- 1:30d9fb51dec1
- Child:
- 2:4bec6b2be809
File content as of revision 1:30d9fb51dec1:
//----------------------------------------------------------------- // 直流分除去用 IIR フィルタ // u[n] = a1*u[n-1] + x[n] // y[n] = g0*(u[n] - u[n-1]) // // 2019/09/21, Copyright (c) 2019 MIKAMI, Naoki //----------------------------------------------------------------- #include "mbed.h" #ifndef IIR_DC_CUT_HPP #define IIR_DC_CUT_HPP namespace Mikami { class IirDcCut { public: // コンストラクタ // a1 フィルタの係数 // g0 利得定数 IirDcCut(float a1, float g0) : A1_(a1), G0_(g0) { un1_ = 0; } // フィルタの実行 float Execute(float xn) { float un = A1_*un1_ + xn; float yn = (un - un1_)*G0_; un1_ = un; return yn; } private: const float A1_; // フィルタ係数 const float G0_; // 利得定数 float un1_; // 中間の値 // コピー・コンストラクタ禁止のため IirDcCut(const IirDcCut&); // 代入演算子禁止のため IirDcCut& operator=(const IirDcCut&); }; } #endif // IIR_DC_CUT_HPP