Relacs
0.9.8
|
#include <detector.h>
Public Member Functions | |
Detector (void) | |
Detector (int n) | |
~Detector (void) | |
void | init (DataIter first, DataIter last, TimeIter firsttime) |
template<class Check > | |
void | peakTrough (DataIter first, DataIter last, EventList &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | peakTroughHist (DataIter first, DataIter last, EventList &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | peak (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | peakHist (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | trough (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | troughHist (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | dynamicPeakTrough (DataIter first, DataIter last, EventList &outevents, double &threshold, double minthresh, double maxthresh, double delay, double decay, Check &check) |
template<class Check > | |
void | dynamicPeakTroughHist (DataIter first, DataIter last, EventList &outevents, double &threshold, double minthresh, double maxthresh, double delay, double decay, Check &check) |
template<class Check > | |
void | dynamicPeak (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, double delay, double decay, Check &check) |
template<class Check > | |
void | dynamicPeakHist (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, double delay, double decay, Check &check) |
template<class Check > | |
void | dynamicTrough (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, double delay, double decay, Check &check) |
template<class Check > | |
void | dynamicTroughHist (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, double delay, double decay, Check &check) |
template<class Check > | |
void | rising (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | falling (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | dynamicRising (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, double delay, double decay, Check &check) |
template<class Check > | |
void | dynamicFalling (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, double delay, double decay, Check &check) |
template<class Check > | |
void | thresholdPeakHist (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
template<class Check > | |
void | thresholdTroughHist (DataIter first, DataIter last, EventData &outevents, double &threshold, double minthresh, double maxthresh, Check &check) |
const EventData & | goodEvents (void) const |
const EventData & | badEvents (void) const |
void | setHistorySize (int n) |
int | historySize (void) const |
void | clearHistory (void) |
Some basic event detector algorithms.
Detector | ( | void | ) |
Constructor.
References EventData::setCyclic(), and EventData::setIdent().
Detector | ( | int | n | ) |
Constructs Detector with history size n.
References EventData::setCyclic().
~Detector | ( | void | ) |
Destructor.
void init | ( | DataIter | first, |
DataIter | last, | ||
TimeIter | firsttime | ||
) |
Init the detector.
[in] | first | iterator pointing to the first data element. |
[in] | last | iterator pointing behind the last data element, if there aren't any data yet, then last should equal first. |
[in] | firsttime | iterator pointing to the time of the first data element. |
Referenced by relacs::falling(), relacs::peaks(), relacs::peaksTroughs(), relacs::rising(), and relacs::troughs().
void peakTrough | ( | DataIter | first, |
DataIter | last, | ||
EventList & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
The peak and trough finding algorithm from B. Todd and D. Andrews ("The identification of peaks in physiological signals.", Computers and Biomedical Research, 32, 322-335, 1999). The peaks are stored in outevents[0], the troughs in outevents[1]. A peak is detected if it is higher than threshold relative to the following minimum. A trough is detected if it is lower than threshold relative to the following maximum. All thresholds (threshold minthresh, maxthresh) have to be positive numbers!
[in] | first | iterator pointing to the first accessible data element. |
[in] | last | iterator pointing behind the last data element. |
[out] | outevents | outevents[0] gets the peak times and outevents[1] the troughs. |
threshold | the current value of the threshold | |
[in] | minthresh | the minimum value for the threshold |
[in] | maxthresh | the maximum value for the threshold |
check | a clas that implements a checkPeak() and a checkTrough() function. For details see the AcceptEvent implementation. |
References EventList::push().
Referenced by relacs::peaksTroughs().
void peakTroughHist | ( | DataIter | first, |
DataIter | last, | ||
EventList & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
References EventList::push().
void peak | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
References EventData::push(), and EventData::updateMeanQuality().
Referenced by relacs::peaks().
void peakHist | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
References EventData::push(), and EventData::updateMeanQuality().
void trough | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
References EventData::push(), and EventData::updateMeanQuality().
Referenced by relacs::troughs().
void troughHist | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
References EventData::push(), and EventData::updateMeanQuality().
void dynamicPeakTrough | ( | DataIter | first, |
DataIter | last, | ||
EventList & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
double | delay, | ||
double | decay, | ||
Check & | check | ||
) |
References relacs::ceil(), and EventList::push().
void dynamicPeakTroughHist | ( | DataIter | first, |
DataIter | last, | ||
EventList & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
double | delay, | ||
double | decay, | ||
Check & | check | ||
) |
References relacs::ceil(), and EventList::push().
void dynamicPeak | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
double | delay, | ||
double | decay, | ||
Check & | check | ||
) |
References relacs::ceil(), EventData::push(), and EventData::updateMeanQuality().
void dynamicPeakHist | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
double | delay, | ||
double | decay, | ||
Check & | check | ||
) |
References relacs::ceil(), EventData::push(), and EventData::updateMeanQuality().
void dynamicTrough | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
double | delay, | ||
double | decay, | ||
Check & | check | ||
) |
References relacs::ceil(), EventData::push(), and EventData::updateMeanQuality().
void dynamicTroughHist | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
double | delay, | ||
double | decay, | ||
Check & | check | ||
) |
References relacs::ceil(), EventData::push(), and EventData::updateMeanQuality().
void rising | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
Detect events crossing the threshold with a positive slope in a single trace of the analog data refered to by events.
References EventData::push(), and EventData::updateMeanQuality().
Referenced by relacs::rising().
void falling | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
Detect events crossing the threshold with a negative slope in a single trace of the analog data refered to by events.
References EventData::push(), and EventData::updateMeanQuality().
Referenced by relacs::falling().
void dynamicRising | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
double | delay, | ||
double | decay, | ||
Check & | check | ||
) |
Detect events crossing the threshold with a positive slope in a single trace of the analog data refered to by events. The threshold is dynamic. If there are no events detected after a delay of delay seconds the threshold decays to minthresh with a decay time constant of decay seconds. minthresh can be greater than maxthresh.
References relacs::ceil(), EventData::push(), and EventData::updateMeanQuality().
void dynamicFalling | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
double | delay, | ||
double | decay, | ||
Check & | check | ||
) |
Detect events crossing the threshold with a negative slope in a single trace of the analog data refered to by events. The threshold is dynamic. If there are no events detected after a delay of delay seconds the threshold decays to minthresh with a decay time constant of decay seconds. minthresh can be greater than maxthresh.
References relacs::ceil(), EventData::push(), and EventData::updateMeanQuality().
void thresholdPeakHist | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
Detect the largest local maxima above succeding threshold crossings. All local maxima are stored in BadEvents.
References EventData::push(), and EventData::updateMeanQuality().
void thresholdTroughHist | ( | DataIter | first, |
DataIter | last, | ||
EventData & | outevents, | ||
double & | threshold, | ||
double | minthresh, | ||
double | maxthresh, | ||
Check & | check | ||
) |
Detect smallest local minima below succeding threshold crossings. All local minima are stored in BadEvents.
References EventData::push(), and EventData::updateMeanQuality().
|
inline |
|
inline |
|
inline |
References EventData::reserve().
|
inline |
References EventData::capacity().
|
inline |
References EventData::clear().