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を基本にしています。
monophonic.cpp@19:f5e785fe50b1, 2017-02-03 (annotated)
- Committer:
- shorie
- Date:
- Fri Feb 03 14:35:46 2017 +0000
- Revision:
- 19:f5e785fe50b1
- Parent:
- 18:b9b1116f8768
Total structure is refactored to use the Monophonic.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shorie | 18:b9b1116f8768 | 1 | #include "signal_processing.h" |
shorie | 18:b9b1116f8768 | 2 | |
shorie | 18:b9b1116f8768 | 3 | |
shorie | 18:b9b1116f8768 | 4 | // constructor. |
shorie | 18:b9b1116f8768 | 5 | Monophonic::Monophonic( unsigned int block_size ) |
shorie | 18:b9b1116f8768 | 6 | { |
shorie | 18:b9b1116f8768 | 7 | // initializing the subm-odules. |
shorie | 18:b9b1116f8768 | 8 | this->vfo = new VFO(); // allocate VFO |
shorie | 18:b9b1116f8768 | 9 | } // End of constructor() |
shorie | 18:b9b1116f8768 | 10 | |
shorie | 18:b9b1116f8768 | 11 | Monophonic::~Monophonic( void ) |
shorie | 18:b9b1116f8768 | 12 | { |
shorie | 18:b9b1116f8768 | 13 | // initializing the subm-odules. |
shorie | 18:b9b1116f8768 | 14 | delete this->vfo; |
shorie | 18:b9b1116f8768 | 15 | } // End of constructor() |
shorie | 18:b9b1116f8768 | 16 | |
shorie | 18:b9b1116f8768 | 17 | |
shorie | 18:b9b1116f8768 | 18 | |
shorie | 18:b9b1116f8768 | 19 | // Run all signal processing. |
shorie | 18:b9b1116f8768 | 20 | void Monophonic::run( |
shorie | 18:b9b1116f8768 | 21 | float out_buffer[], // place to write the right output samples |
shorie | 18:b9b1116f8768 | 22 | unsigned int block_size // block size [sample] |
shorie | 18:b9b1116f8768 | 23 | ) |
shorie | 18:b9b1116f8768 | 24 | { |
shorie | 18:b9b1116f8768 | 25 | // place the signal processing coce here |
shorie | 18:b9b1116f8768 | 26 | |
shorie | 18:b9b1116f8768 | 27 | // VFO |
shorie | 18:b9b1116f8768 | 28 | this->vfo->run( out_buffer, block_size); |
shorie | 18:b9b1116f8768 | 29 | |
shorie | 18:b9b1116f8768 | 30 | } // End of run() |
shorie | 18:b9b1116f8768 | 31 | |
shorie | 18:b9b1116f8768 | 32 | |
shorie | 18:b9b1116f8768 | 33 | // Sampling Frequency |
shorie | 18:b9b1116f8768 | 34 | void Monophonic::set_Fs( int Fs ) |
shorie | 18:b9b1116f8768 | 35 | { |
shorie | 18:b9b1116f8768 | 36 | this->vfo->set_Fs( Fs ); |
shorie | 18:b9b1116f8768 | 37 | } |
shorie | 18:b9b1116f8768 | 38 | |
shorie | 18:b9b1116f8768 | 39 | // Oscillation Frequency |
shorie | 18:b9b1116f8768 | 40 | void Monophonic::set_vfo_frequency( int freq ) |
shorie | 18:b9b1116f8768 | 41 | { |
shorie | 18:b9b1116f8768 | 42 | this->vfo->set_frequency( freq ); |
shorie | 18:b9b1116f8768 | 43 | } |
shorie | 18:b9b1116f8768 | 44 | |
shorie | 18:b9b1116f8768 | 45 | // Duty Cycle of VFO |
shorie | 18:b9b1116f8768 | 46 | void Monophonic::set_vfo_duty_cycle( float duty ) |
shorie | 18:b9b1116f8768 | 47 | { |
shorie | 18:b9b1116f8768 | 48 | this->vfo->set_duty_cycle( duty ); |
shorie | 18:b9b1116f8768 | 49 | } |
shorie | 18:b9b1116f8768 | 50 | |
shorie | 18:b9b1116f8768 | 51 | // VFO wave form |
shorie | 18:b9b1116f8768 | 52 | void Monophonic::set_vfo_wave_form( wave_form form ) |
shorie | 18:b9b1116f8768 | 53 | { |
shorie | 18:b9b1116f8768 | 54 | this->vfo->set_wave_form( form ); |
shorie | 18:b9b1116f8768 | 55 | } |