Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG F746_GUI FrequencyResponseDrawer LCD_DISCO_F746NG TS_DISCO_F746NG mbed
FIR_FrqResp.hpp
00001 //----------------------------------------------------------- 00002 // Frequency response for FIR filter of direct form 00003 // 00004 // 2016/04/17, Copyright (c) 2016 MIKAMI, Naoki 00005 //----------------------------------------------------------- 00006 00007 #ifndef FIR_DIRECT_FREQUENCY_RESPONSE_HPP 00008 #define FIR_DIRECT_FREQUENCY_RESPONSE_HPP 00009 00010 #include "FrequancyResponseBase.hpp" 00011 00012 namespace Mikami 00013 { 00014 class FIR_FrqResp : public FrequencyResponse 00015 { 00016 public: 00017 FIR_FrqResp() : ORDER_(10) 00018 { 00019 float hk[] = 00020 { 00021 -3.391730E-02f, 1.206756E-03f, 5.917430E-02f, 1.457397E-01f, 00022 2.247430E-01f, 2.567399E-01f, 2.247430E-01f, 1.457397E-01f, 00023 5.917430E-02f, 1.206756E-03f, -3.391730E-02f 00024 }; 00025 h_ = new float[ORDER_+1]; 00026 for (int k=0; k<=ORDER_; k++) h_[k] = hk[k]; 00027 } 00028 00029 // 周波数応答の絶対値を返す関数, 引数: z^(-1) 00030 virtual float AbsH_z(Complex u) 00031 { 00032 Complex h = 0; 00033 for (int k=ORDER_; k>=0; k--) 00034 h = h*u + h_[k]; 00035 return abs(h); 00036 } 00037 00038 private: 00039 const int ORDER_; 00040 float *h_; 00041 }; 00042 } 00043 #endif // FIR_DIRECT_FREQUENCY_RESPONSE_HPP 00044
Generated on Sun Jul 17 2022 20:32:22 by
1.7.2