Skip to content

Commit

Permalink
Using sinusoidal signal with amplitude offset
Browse files Browse the repository at this point in the history
  • Loading branch information
IC2D user committed Jul 27, 2023
1 parent 0fb01b1 commit 8e31884
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ forecast::SinusoidRefGen::SinusoidRefGen(float frequency, float amplitude) : fre
}

std::vector<float> 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};
}

0 comments on commit 8e31884

Please sign in to comment.