#include <S1S2Stimulus.hpp>
Public Member Functions | |
S1S2Stimulus (double magnitude, double stimulusDuration, double s1Duration, double s1Period, double startTime, std::vector< double > s2Periods) | |
double | GetStimulus (double time) |
void | SetS2ExperimentPeriodIndex (unsigned index) |
unsigned | GetNumS2FrequencyValues () |
Private Member Functions | |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
S1S2Stimulus () | |
Private Attributes | |
unsigned | mS2Index |
unsigned | mNumS2FrequencyValues |
Friends | |
class | boost::serialization::access |
Run a RegularStimulus at a certain (S1) frequency Then run two pulses of a second RegularStimulus at another (S2) frequency. These are combined into a MultiStimulus.
We have a number of these MultiStimulus objects, created for a given vector s2Periods in the constructor. As a user you set which of these S2 frequencies to run with the method SetS2ExperimentPeriodIndex().
Definition at line 53 of file S1S2Stimulus.hpp.
S1S2Stimulus::S1S2Stimulus | ( | ) | [inline, private] |
Private constructor - for archiving's eyes only.
Definition at line 85 of file S1S2Stimulus.hpp.
S1S2Stimulus::S1S2Stimulus | ( | double | magnitude, | |
double | stimulusDuration, | |||
double | s1Duration, | |||
double | s1Period, | |||
double | startTime, | |||
std::vector< double > | s2Periods | |||
) |
Constructor
magnitude | The magnitude of the stimulus 'square wave'. | |
stimulusDuration | The duration of the stimulus 'square wave'. | |
s1Duration | The duration of the S1 phase of the experiment, should be a multiple of the s1Period. | |
s1Period | The period of the S1 phase (typically ~1000ms for example). | |
startTime | The time at which to begin the S1 stimulus (this delay is automatically added to give smooth transition to S2). | |
s2Periods | A std::vector of the different S2 frequencies that should be run (for example {1000, 900, 800} (ms)). |
Definition at line 30 of file S1S2Stimulus.cpp.
References MultiStimulus::AddStimulus(), mNumS2FrequencyValues, and mS2Index.
void S1S2Stimulus::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archive the simple stimulus, never used directly - boost uses this.
archive | ||
version |
Reimplemented from MultiStimulus.
Definition at line 65 of file S1S2Stimulus.hpp.
References mNumS2FrequencyValues, and mS2Index.
double S1S2Stimulus::GetStimulus | ( | double | time | ) | [virtual] |
Get the magnitude of the multiple stimuli at time 'time'
time | time at which to return the stimulus |
Reimplemented from MultiStimulus.
Definition at line 51 of file S1S2Stimulus.cpp.
References mS2Index, and MultiStimulus::mStimuli.
void S1S2Stimulus::SetS2ExperimentPeriodIndex | ( | unsigned | index | ) |
Allows us to move to the 'next' S2 frequency.
index | Which S2 frequency to use next. |
Definition at line 56 of file S1S2Stimulus.cpp.
References EXCEPTION, mNumS2FrequencyValues, and mS2Index.
unsigned S1S2Stimulus::GetNumS2FrequencyValues | ( | ) |
Definition at line 68 of file S1S2Stimulus.cpp.
References mNumS2FrequencyValues.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from MultiStimulus.
Definition at line 57 of file S1S2Stimulus.hpp.
unsigned S1S2Stimulus::mS2Index [private] |
The Index of the S2 Frequency that we wish to run (as specified in the vector in the constructor).
Definition at line 76 of file S1S2Stimulus.hpp.
Referenced by GetStimulus(), S1S2Stimulus(), serialize(), and SetS2ExperimentPeriodIndex().
unsigned S1S2Stimulus::mNumS2FrequencyValues [private] |
The Number of S2 Frequencies that have been set up
Definition at line 80 of file S1S2Stimulus.hpp.
Referenced by GetNumS2FrequencyValues(), S1S2Stimulus(), serialize(), and SetS2ExperimentPeriodIndex().