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

Committer:
shorie
Date:
2017-01-02
Revision:
1:0a37bce4f985
Parent:
0:058daa59980d
Child:
5:3d6cf4dbf458

File content as of revision 1:0a37bce4f985:

#include <cmath>
#include "amakusa.h"

#ifndef M_PI
#define M_PI 3.1415927F
#endif 

    void amakusa::LimitterLinAtan::run( float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
    {
        uint32_t count = blockSize? blockSize : this->blockSize;
        
        for ( int i=0; i<count; i++ )
        {
            if ( pSrc[i] > 0.5F )
                pDst[i] = std::atan((pSrc[i]-0.5F)*M_PI)/M_PI+0.5F;
            else if ( -0.5F > pSrc[i] )
                pDst[i] = std::atan((pSrc[i]+0.5F)*M_PI)/M_PI-0.5F;
            else
                pDst[i] = pSrc[i];

        }
    }