Synthesizer based on the Unzen / Nucleo F746ZG
Dependencies: amakusa mbed-dsp mbed shimabara ukifune unzen_nucleo_f746
Fork of skeleton_unzen_nucleo_f746 by
雲仙フレームワークのテストとして作っているプロジェクトです。中身はどんどん変っていきます。 説明はDSP空挺団の「シンセサイザー」カテゴリーを参照してください。初回は「ドッグフードを食べる」です。
dcblocker.cpp
- Committer:
- shorie
- Date:
- 2017-02-18
- Revision:
- 29:8ee84bda128c
- Parent:
- 25:d15dd7b9101c
File content as of revision 29:8ee84bda128c:
#include "signal_processing.h" /* * Related Link * https://www.dsprelated.com/freebooks/filters/DC_Blocker.html * https://ccrma.stanford.edu/~jos/fp/DC_Blocker.html */ DCBlocker::DCBlocker( uint32_t blockSize ) : amakusa::AbstractFilter ( blockSize ) { this->x_last = 0; this->y_last = 0; } void DCBlocker::run( float32_t *pSrc, float32_t *pDst ) { // if the parameter is non-zero, take it. If the parameter is zero, use default. for ( int i = 0; i < this->block_size; i++ ) { // y = x - x * z^-1 + 0.995 * y * z^-1 pDst[ i ] = pSrc[ i ] - this->x_last + 0.995f * this->y_last; this->x_last = pSrc[ i ]; this->y_last = pDst[ i ]; } }