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空挺団の「シンセサイザー」カテゴリーを参照してください。初回は「ドッグフードを食べる」です。
monophonic.cpp
- Committer:
- shorie
- Date:
- 2017-02-04
- Revision:
- 20:53021b2c424d
- Parent:
- 18:b9b1116f8768
- Child:
- 22:dc2cbe8db9d9
File content as of revision 20:53021b2c424d:
#include "signal_processing.h" // constructor. Monophonic::Monophonic( unsigned int block_size ) { // initializing the subm-odules. this->vfo = new VFO(); // allocate VFO this->dc_blocker = new DCBlocker( block_size ); this->sv_filter = new SVFilter( block_size ); work_buf_a = new float32_t[block_size]; work_buf_b = new float32_t[block_size]; } // End of constructor() Monophonic::~Monophonic( void ) { // initializing the subm-odules. delete this->vfo; delete this->dc_blocker; delete this->sv_filter; delete[] work_buf_a; delete[] work_buf_b; } // End of constructor() // Run all signal processing. void Monophonic::run( float out_buffer[], // place to write the right output samples unsigned int block_size // block size [sample] ) { // place the signal processing coce here // VFO this->vfo->run( work_buf_a ); this->dc_blocker->run( work_buf_a, out_buffer ); } // End of run() // Sampling Frequency void Monophonic::set_Fs( int Fs ) { this->vfo->set_Fs( Fs ); } // Oscillation Frequency void Monophonic::set_vfo_frequency( int freq ) { this->vfo->set_frequency( freq ); } // Duty Cycle of VFO void Monophonic::set_vfo_duty_cycle( float duty ) { this->vfo->set_duty_cycle( duty ); } // VFO wave form void Monophonic::set_vfo_wave_form( wave_form form ) { this->vfo->set_wave_form( form ); }