Basic Audio Signal Processing Library

Dependents:   unzen_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller synthesizer_f746

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers limitterlinatan.cpp Source File

limitterlinatan.cpp

00001 #include <cmath>
00002 #include "amakusa.h"
00003 
00004 #ifndef M_PI
00005 #define M_PI 3.1415927F
00006 #endif 
00007 
00008     void amakusa::LimitterLinAtan::run( float32_t *pSrc, float32_t *pDst)
00009     {
00010         uint32_t count = this->block_size;
00011         
00012         for ( int i=0; i<count; i++ )
00013         {
00014             if ( pSrc[i] > 0.5F )
00015                 pDst[i] = std::atan((pSrc[i]-0.5F)*M_PI)/M_PI+0.5F;
00016             else if ( -0.5F > pSrc[i] )
00017                 pDst[i] = std::atan((pSrc[i]+0.5F)*M_PI)/M_PI-0.5F;
00018             else
00019                 pDst[i] = pSrc[i];
00020 
00021         }
00022     }