Spike
Loading...
Searching...
No Matches
Spike::CosineSignal Class Reference

Implements a cosine signal, i.e. alpha*cos(2*pi*f*t) More...

#include <CosineSignal.h>

Public Member Functions

 CosineSignal (double alpha, double f, const TimeFrame &time_frame)
 Construct CosineSignal from parameters.
 
 CosineSignal (const std::string &input_file, const TimeFrame &time_frame)
 Construct CosineSignal from .ini file.
 
void calculate_signal ()
 Calculates the cosine signal, i.e. alpha*cos(2*pi*f*t).
 
double signal (double t) const
 Returns signal at time t, i.e. alpha*cos(2*pi*f*t)
 
double get_f () const
 Returns the frequency.
 
void print (std::ostream &out) const override
 Prints cosine signal to out stream.
 
- Public Member Functions inherited from Spike::Signal
 Signal (const TimeFrame &time_frame)
 Constructs signal from given time frame.
 
double get_value (size_t i) const
 Returns the signal value at index i.
 

Additional Inherited Members

- Protected Attributes inherited from Spike::Signal
const TimeFrametime_frame
 reference to time frame
 
std::vector< double > signal_values
 array containing the signal values
 

Detailed Description

Implements a cosine signal, i.e. alpha*cos(2*pi*f*t)

Constructor & Destructor Documentation

◆ CosineSignal() [1/2]

Spike::CosineSignal::CosineSignal ( double alpha,
double f,
const TimeFrame & time_frame )

Construct CosineSignal from parameters.

Parameters
alphaAmplitude
fFrequency
time_frameTimeFrame

◆ CosineSignal() [2/2]

Spike::CosineSignal::CosineSignal ( const std::string & input_file,
const TimeFrame & time_frame )

Construct CosineSignal from .ini file.

Parameters
input_filePath to .ini file
time_frameTimeFrame

Member Function Documentation

◆ get_f()

double Spike::CosineSignal::get_f ( ) const
inline

Returns the frequency.

Returns
frequency

◆ print()

void Spike::CosineSignal::print ( std::ostream & out) const
inlineoverridevirtual

Prints cosine signal to out stream.

Parameters
outout stream

Implements Spike::Signal.

◆ signal()

double Spike::CosineSignal::signal ( double t) const

Returns signal at time t, i.e. alpha*cos(2*pi*f*t)

Parameters
tTime
Returns
Signal value at t, i.e. alpha*cos(2*pi*f*t)

The documentation for this class was generated from the following files: