![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
The experiment using this program is introduced on "Interface" No.12, CQ publishing Co.,Ltd, 2014. 本プログラムを使った実験は,CQ出版社のインターフェース 2014年12月号で紹介しています.
Dependencies: DSProcessingIO mbed
FIR_LPF_Symmetry.cpp
- Committer:
- CQpub0Mikami
- Date:
- 2014-07-29
- Revision:
- 1:bd300d649b1f
- Parent:
- 0:4498a5360dde
File content as of revision 1:bd300d649b1f:
//-------------------------------------------------------------- // FIR filter: Even order, Symmetric structure of direct form // // Copyright (c) 2014 MIKAMI, Naoki, 2014/06/20 //-------------------------------------------------------------- #include "mbed.h" #include "AdcInternal.hpp" #include "MCP4922Single.hpp" #include "coefficientsSym_200.hpp" #include "FIR_Symmetry.hpp" using namespace Mikami; // sampling frequency const float FS_ = 10.0e3f; Adc adc_(A0); Dac dacA_(Dac::DAC_A); Ticker timer_; // for timer interrupt FirSymmetry<ORDER_> lpf(hm_); void TimerIsr() { float xn = adc_.Read(); // input // Execute FIR filter float yn = lpf.Execute(xn); dacA_.Write(yn); // output } int main() { timer_.attach_us(&TimerIsr, 1.0e6f/FS_); while (true) {} // infinite loop }