diff --git a/software/signal_processing/sine.c b/software/signal_processing/sine.c index 01e74af..7e7cdbd 100644 --- a/software/signal_processing/sine.c +++ b/software/signal_processing/sine.c @@ -9,18 +9,27 @@ #include #include -#ifndef M_PI -#define M_PI 3.14159265358979323846f -#endif int task_sine_run( void * data ) { + sine_config * task = ( sine_config * ) data; uint32_t data_channel_base = task->base.sink; data_channel_clear( data_channel_base ); for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i ) { float_word res; - res.value = task->amplitude * sinf( ( 2.0f * M_PI * i ) / task->samples_per_periode + task->phase ); + +// + res.value = task->amplitude * // AMPLITUDE DER WELLE FESTLEGEN + sinf( + ( 2.0f * M_PI * i ) // 1. UMRECHNUNG IN BOGENMAß + / ( float )task->samples_per_periode // 2. ANZAHL DER SAMPLES PRO PERIODE + + + task->phase // PHASENVERSCHIEBUNG ADDIEREN + ); +// + + data_channel_write( data_channel_base, res.word ); }