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
Biquad_FrqResp.hpp
00001 //----------------------------------------------------------- 00002 // Frequency response for biquad LPF 00003 // 00004 // 2016/04/19, Copyright (c) 2016 MIKAMI, Naoki 00005 //----------------------------------------------------------- 00006 00007 #ifndef BIQUAD_FREQUENCY_RESPONSE_HPP 00008 #define BIQUAD_FREQUENCY_RESPONSE_HPP 00009 00010 #include "FrequancyResponseBase.hpp" 00011 00012 namespace Mikami 00013 { 00014 class Biquad_FrqResp : public FrequencyResponse 00015 { 00016 public: 00017 Biquad_FrqResp(float a1, float a2, float b0, float b1, float b2) 00018 : a1_(a1), a2_(a2), b0_(b0), b1_(b1), b2_(b2) {} 00019 00020 // 周波数応答の絶対値を返す関数, 引数: z^(-1) 00021 virtual float AbsH_z(Complex u) 00022 { 00023 Complex h = b0_ + (b1_ + b2_*u)*u ; 00024 h = h/(1.0f - (a1_ + a2_*u)*u); 00025 return abs(h); 00026 } 00027 00028 private: 00029 const float a1_, a2_, b0_, b1_, b2_; 00030 }; 00031 } 00032 #endif // BIQUAD_FREQUENCY_RESPONSE_HPP 00033
Generated on Sun Jul 17 2022 20:32:22 by
1.7.2