CQエレクトロニクス・セミナ「実習・マイコンを動かしながら学ぶディジタル・フィルタ」で使うプログラム.雛形として使う. http://seminar.cqpub.co.jp/ccm/ES18-0020
Dependencies: F746_GUI F746_SAI_IO mbed
MyFiles/Trigger.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2018-03-20
- Revision:
- 5:976ef47a7f25
- Parent:
- 0:b6d17af0f47a
File content as of revision 5:976ef47a7f25:
//--------------------------------------------------------------- // トリガの条件を満足する点を探す // // 2017/07/24, Copyright (c) 2017 MIKAMI, Naoki //--------------------------------------------------------------- #ifndef F746_TRIGGER_HPP #define F746_TRIGGER_HPP #include "mbed.h" #include "Array.hpp" namespace Mikami { int Trigger(const Array<int16_t>& xn, // 対象とするデータ int th) // トリガの基準値 { int n; for (n=1; n<xn.Length()/2; n++) if ((xn[n-1] < -th) && (xn[n] > th)) return n; return 0; } } #endif // F746_TRIGGER_HPP