Basic Audio Signal Processing Library

Dependents:   unzen_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller synthesizer_f746

オーディオ信号処理用のライブラリです。

mbed-dspのフィルタ群向けに作ったクラス・ラッパーのほか、以下のクラスを用意しています。

  • ヒステリシス
  • sin/cosオシレータ
  • リミッター

クラスは全て名前空間amakusaに含まれます。

Committer:
shorie
Date:
Sat Feb 18 01:05:19 2017 +0000
Revision:
8:1fa224c83cfa
Parent:
5:3d6cf4dbf458
Fixed mistake of visibility in the limitterlinatan.h

Who changed what in which revision?

UserRevisionLine numberNew 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 5:3d6cf4dbf458 8 void amakusa::LimitterLinAtan::run( float32_t *pSrc, float32_t *pDst)
shorie 0:058daa59980d 9 {
shorie 5:3d6cf4dbf458 10 uint32_t count = this->block_size;
shorie 1:0a37bce4f985 11
shorie 0:058daa59980d 12 for ( int i=0; i<count; i++ )
shorie 0:058daa59980d 13 {
shorie 1:0a37bce4f985 14 if ( pSrc[i] > 0.5F )
shorie 1:0a37bce4f985 15 pDst[i] = std::atan((pSrc[i]-0.5F)*M_PI)/M_PI+0.5F;
shorie 1:0a37bce4f985 16 else if ( -0.5F > pSrc[i] )
shorie 1:0a37bce4f985 17 pDst[i] = std::atan((pSrc[i]+0.5F)*M_PI)/M_PI-0.5F;
shorie 0:058daa59980d 18 else
shorie 1:0a37bce4f985 19 pDst[i] = pSrc[i];
shorie 0:058daa59980d 20
shorie 0:058daa59980d 21 }
shorie 0:058daa59980d 22 }