Experimental implementation of the adaptive filter of "Interface" magazine in 2016-2017
Dependencies: amakusa mbed-dsp mbed shimabara ukifune unzen_nucleo_f746
Fork of skeleton_unzen_nucleo_f746 by
ハードウェアおよびソフトウェアはskelton_unzen_nucleo_f746を基本にしています。
Diff: vfo.cpp
- Revision:
- 18:b9b1116f8768
- Parent:
- 17:728ffc633179
diff -r 728ffc633179 -r b9b1116f8768 vfo.cpp --- a/vfo.cpp Tue Jan 31 14:19:16 2017 +0000 +++ b/vfo.cpp Wed Feb 01 15:00:31 2017 +0000 @@ -1,19 +1,24 @@ #include "signal_processing.h" - // Modify this constructor to initialize your audio algorithm. + VFO::VFO( void ) { // initial parameter setting. - this->style = triangle; + this->form = triangle; this->Fs = 48000; this->frequency = 440; this->duty_cycle = 0.5; this->update_parameters(); } // End of constructor() + +VFO::~VFO( void ) +{ + // do nothing +} - // Modify this method to implement your audio algorithm. + void VFO::run( float out_buffer[], // vfo output buffer unsigned int block_size // block size [sample] @@ -23,14 +28,14 @@ for ( int i= 0; i< block_size; i++ ) { // 1 : if phase < half_way; 0 : others. - if ( this->style == square ) + if ( this->form == square ) { if ( this->current_phase < this->half_way ) out_buffer[i] = 1.0; else out_buffer[i] = 0.0; } - else // style == triangle + else // form == triangle { if ( this->current_phase < this->half_way ) out_buffer[i] = this->rising_rate * this->current_phase; @@ -77,9 +82,9 @@ this->update_parameters(); } -void VFO::set_wave_style( wave_style style ) +void VFO::set_wave_form( wave_form form ) { - this->style = style; + this->form = form; }