Spike
Loading...
Searching...
No Matches
StepSignal.h
1#ifndef SPIKE_STEPSIGNAL_H
2#define SPIKE_STEPSIGNAL_H
3
4#include <string>
5
7
8namespace Spike {
9
14class StepSignal : public Signal {
15private:
16 double alpha;
17 double t_0;
18
19public:
26 StepSignal(double alpha, double t_0, const TimeFrame &time_frame);
27
33 StepSignal(const std::string &input_file, const TimeFrame &time_frame);
34
38 void calculate_signal();
39
45 [[nodiscard]] double signal(double t) const;
46
47 void print(std::ostream &out) const override {
48 out << "StepSignal(alpha: " << alpha << ", t_0: " << t_0 << ")";
49 }
50};
51
52} // namespace Spike
53
54#endif // SPIKE_STEPSIGNAL_H
An abstract base class for signals.
Definition Signal.h:20
const TimeFrame & time_frame
reference to time frame
Definition Signal.h:22
Implement a step get_value, i.e. alpha*Theta(t - t_0)
Definition StepSignal.h:14
double signal(double t) const
Returns get_value, i.e. alpha*Theta(t - t_0)
Definition StepSignal.cpp:48
StepSignal(double alpha, double t_0, const TimeFrame &time_frame)
Construct StepSignal from parameters.
Definition StepSignal.cpp:13
void print(std::ostream &out) const override
Prints the signal to out stream.
Definition StepSignal.h:47
void calculate_signal()
Calculates the step get_value.
Definition StepSignal.cpp:37
A time frame with discrete time steps.
Definition TimeFrame.h:13