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

Implements a signal consisting of two cosine, i.e. alpha*cos(2*pi*f1*t) More...

#include <TwoCosineSignal.h>

Public Member Functions

 TwoCosineSignal (double alpha, double f1, double beta, double f2, double phi, const TimeFrame &time_frame)
 Construct TwoCosineSignal from parameters.
 
 TwoCosineSignal (const std::string &input_file, const TimeFrame &time_frame)
 Construct TwoCosineSignal from input file.
 
void calculate_signal ()
 Calculates the cosine signal.
 
double signal (double t) const
 Returns signal, i.e. alpha*cos(2*pi*f1*t) + beta*cos(2*pi*f2*t + phi)
 
void print (std::ostream &out) const override
 Prints the 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 signal consisting of two cosine, i.e. alpha*cos(2*pi*f1*t)

  • beta*cos(2*pi*f2*t + phi)

Constructor & Destructor Documentation

◆ TwoCosineSignal() [1/2]

Spike::TwoCosineSignal::TwoCosineSignal ( double alpha,
double f1,
double beta,
double f2,
double phi,
const TimeFrame & time_frame )

Construct TwoCosineSignal from parameters.

Parameters
alphaAmplitude first signal
f1Frequency first signal
betaamplitude second signal
f2Frequency second signal
phiPhase shift
time_frameTimeFrame

◆ TwoCosineSignal() [2/2]

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

Construct TwoCosineSignal from input file.

Parameters
input_fileInput file in .ini format
time_frametime frame

Member Function Documentation

◆ print()

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

Prints the signal to out stream.

Parameters
outout stream

Implements Spike::Signal.

◆ signal()

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

Returns signal, i.e. alpha*cos(2*pi*f1*t) + beta*cos(2*pi*f2*t + phi)

Parameters
tTime
Returns
Signal, i.e. alpha*cos(2*pi*f1*t) + beta*cos(2*pi*f2*t + phi)

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