Basic Audio Signal Processing Library
Dependents: unzen_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller synthesizer_f746
オーディオ信号処理用のライブラリです。
mbed-dspのフィルタ群向けに作ったクラス・ラッパーのほか、以下のクラスを用意しています。
- ヒステリシス
- sin/cosオシレータ
- リミッター
クラスは全て名前空間amakusaに含まれます。
limitterlinatan.cpp@0:058daa59980d, 2016-12-11 (annotated)
- Committer:
- shorie
- Date:
- Sun Dec 11 21:04:06 2016 +0000
- Revision:
- 0:058daa59980d
- Child:
- 1:0a37bce4f985
Publish
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shorie | 0:058daa59980d | 1 | #include <cmath> |
shorie | 0:058daa59980d | 2 | #include "amakusa.h" |
shorie | 0:058daa59980d | 3 | |
shorie | 0:058daa59980d | 4 | #ifndef M_PI |
shorie | 0:058daa59980d | 5 | #define M_PI 3.1415927F |
shorie | 0:058daa59980d | 6 | #endif |
shorie | 0:058daa59980d | 7 | |
shorie | 0:058daa59980d | 8 | void amakusa::LimitterLinAtan::run( float src[], float dst[], int count ) |
shorie | 0:058daa59980d | 9 | { |
shorie | 0:058daa59980d | 10 | for ( int i=0; i<count; i++ ) |
shorie | 0:058daa59980d | 11 | { |
shorie | 0:058daa59980d | 12 | if ( src[i] > 0.5F ) |
shorie | 0:058daa59980d | 13 | dst[i] = std::atan((src[i]-0.5F)*M_PI)/M_PI+0.5F; |
shorie | 0:058daa59980d | 14 | else if ( -0.5F > src[i] ) |
shorie | 0:058daa59980d | 15 | dst[i] = std::atan((src[i]+0.5F)*M_PI)/M_PI-0.5F; |
shorie | 0:058daa59980d | 16 | else |
shorie | 0:058daa59980d | 17 | dst[i] = src[i]; |
shorie | 0:058daa59980d | 18 | |
shorie | 0:058daa59980d | 19 | } |
shorie | 0:058daa59980d | 20 | } |