Basic Audio Signal Processing Library
Dependents: unzen_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller synthesizer_f746
オーディオ信号処理用のライブラリです。
mbed-dspのフィルタ群向けに作ったクラス・ラッパーのほか、以下のクラスを用意しています。
- ヒステリシス
- sin/cosオシレータ
- リミッター
クラスは全て名前空間amakusaに含まれます。
Diff: hysteresis.h
- Revision:
- 2:fbdf03b330ae
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hysteresis.h Sat Jan 21 07:16:37 2017 +0000 @@ -0,0 +1,35 @@ +#ifndef _HYSTERESIS_H_ +#define _HYSTERESIS_H_ + +#include <stdint.h> + +namespace amakusa +{ +/** +* @brief Hysteresis algorithm to the descrete input value. +* @details +* To use this class, include amakusa.h +*/ + class Hysteresis + { + public: + /** + * @brief Constructor + * @param[in] min_input the Minumum input value for run() method. Must be smaller than INT32_MAX. + * @param[in] max_input the Maximum input value for run() method. Must be bigger than INT32_MIN. + */ + Hysteresis( int32_t min_input, int32_t max_input ); + /** + * @brief Run the Hysteresis algorithm + * @param[in] in_data A data to be applied hysteresis + * @returns data with hysteresis. The value range is [min_input, max_input ] of the constructor. + */ + virtual int32_t run( int32_t in_data ); + private: + int32_t last_value, min, max; + }; + +} + + +#endif \ No newline at end of file