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.
ExpAvr.cpp
00001 #include "ExpAvr.h" 00002 00003 /// 指数平均を行い最新の値を返す 00004 /// @param double val 入力値 00005 /// @return double 移動平均後の値 00006 double ExpAvr::getOutput(double val) 00007 { 00008 int a; 00009 // 入力値で初期化 00010 if(first){ 00011 first = false; 00012 for(a = 0; a < order; a++){ 00013 acc[a] = val; 00014 } 00015 return val; 00016 } 00017 // 各段の値を計算 00018 for(a = 0; a < order; a++){ 00019 acc[a] = tc * acc[a] + (1.0 - tc) * val; 00020 val = acc[a]; 00021 } 00022 return val; 00023 }
Generated on Tue Jul 12 2022 19:08:10 by
1.7.2