From 8e3188419569f56dc0a0903921ca4222a43669c2 Mon Sep 17 00:00:00 2001 From: IC2D user Date: Fri, 21 Jul 2023 11:26:03 -0300 Subject: [PATCH] Using sinusoidal signal with amplitude offset --- .../src/reference_generators/Sinusoid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/forecastnucleoframework/src/reference_generators/Sinusoid.cpp b/lib/forecastnucleoframework/src/reference_generators/Sinusoid.cpp index 28d964b..e6f8d10 100644 --- a/lib/forecastnucleoframework/src/reference_generators/Sinusoid.cpp +++ b/lib/forecastnucleoframework/src/reference_generators/Sinusoid.cpp @@ -5,6 +5,6 @@ forecast::SinusoidRefGen::SinusoidRefGen(float frequency, float amplitude) : fre } std::vector forecast::SinusoidRefGen::process(const IHardware* hw) { - float output = amplitude * sin(2 * M_PI * frequency * hw->get_current_time()); + float output = (amplitude * (-1)* cos(2 * M_PI * frequency * hw->get_current_time() )) + amplitude; return {output}; }