Electric Field Measurement Relacs Plugins
0.9.8
|
#include <beats.h>
Public Member Functions | |
Beats (void) | |
virtual int | main (void) |
virtual void | sessionStarted (void) |
void | analyze (double signaltime, double before, double fishrate, bool initeoditer[], EventIterator eoditer[], MapD eodfrequencies[], MapD eodamplitudes[], int eodinx[], MapD &eodfrequency, bool &initstimiter, EventFrequencyIterator &stimiter, MapD &stimfrequency) |
void | initPlot (double deltaf, double amplitude, double duration, double eodf, const MapD &eodfrequency, const EventData &fishchirps, bool showstimulus, const MapD &stimfrequency, const EventData &chirptimes) |
void | save (double deltaf, double amplitude, double duration, double pause, int amtype, const vector< double > &amampls, const vector< double > &amfreqs, double fishrate, double stimulusrate, int nfft, double eodfreqprec, const MapD eodfrequencies[], const MapD eodamplitudes[], const MapD &eodfrequency, const EventData &fishchirps, const EventData &playedchirpevents, const MapD &stimfrequency, const Options &chirpheader, bool split, int count) |
void | saveEODFreq (int trace, const string &es, const Options &header, const MapD &eodfrequency, const MapD &eodamplitude, bool split, int count) |
void | saveMergedEODFreq (const Options &header, const MapD &eodfrequency, bool split, int count) |
void | saveChirps (const Options &header, const EventData &chirps, bool split, int count) |
void | savePlayedChirps (const Options &header, const EventData &chirps, bool split, int count) |
Public Member Functions inherited from ConfigDialog | |
ConfigDialog (const string &configident="", int configgroup=0, const string &name="", const string &author="", const string &version="", const string &date=__DATE__) | |
virtual | ~ConfigDialog (void) |
string | name (void) const |
virtual void | setName (const string &name) |
string | author (void) const |
virtual void | setAuthor (const string &author) |
string | version (void) const |
virtual void | setVersion (const string &version) |
string | date (void) const |
virtual void | setDate (const string &date) |
virtual OptWidget * | dialogOptions (OptDialog *od, string *tabhotkeys=0) |
virtual void | dialogButtons (OptDialog *od) |
virtual void | dialogEmptyMessage (OptDialog *od) |
int | dialogSelectMask (void) const |
void | setDialogSelectMask (int mask) |
void | addDialogSelectMask (int mask) |
int | dialogReadOnlyMask (void) const |
void | setDialogReadOnlyMask (int mask) |
void | addDialogReadOnlyMask (int mask) |
int | dialogStyle (void) const |
void | setDialogStyle (int style) |
void | addDialogStyle (int style) |
string | dialogCaption (void) const |
void | setDialogCaption (const string &caption) |
bool | dialogHeader (void) const |
void | setDialogHeader (bool d) |
string | headerBackgroundColor (void) const |
void | setHeaderBackgroundColor (const string &color) |
string | headerForegroundColor (void) const |
void | setHeaderForegroundColor (const string &color) |
string | headerImageFile (void) const |
void | setHeaderImageFile (const string &file) |
virtual void | dialogHeaderWidget (OptDialog *od) |
bool | dialogHelp (void) const |
void | setDialogHelp (bool d) |
string | helpCaption (void) const |
void | setHelpCaption (const string &caption) |
string | helpPath (int inx=0) const |
int | helpPathes (void) const |
void | clearHelpPathes (void) |
void | setHelpPath (const string &path) |
void | addHelpPath (const string &path) |
virtual string | helpFileName (void) const |
bool | dialogOpen (void) const |
bool | helpOpen (void) const |
QWidget * | mainWidget (void) |
virtual void | setMainWidget (QWidget *widget) |
void | lock () const |
void | unlock () const |
bool | tryLock (int timeout=1) |
QMutex * | mutex (void) |
Public Member Functions inherited from ConfigClass | |
ConfigClass (const string &ident, int group=0, int mode=0xffff, int selectmask=0) | |
ConfigClass (const ConfigClass &C) | |
virtual | ~ConfigClass (void) |
const string & | configIdent (void) const |
void | setConfigIdent (const string &ident) |
int | configGroup (void) const |
void | setConfigGroup (int group) |
int | configMode (void) const |
void | setConfigMode (int mode) |
void | addConfigMode (int mode) |
void | delConfigMode (int mode) |
int | configSelectMask (void) const |
void | setConfigSelectMask (int mask) |
void | addConfig (void) |
void | readConfig (void) |
virtual void | readConfig (StrQueue &sq) |
virtual void | saveConfig (ofstream &str) |
virtual int | configSize (void) const |
virtual void | config (void) |
virtual void | preConfig (void) |
Public Member Functions inherited from Traces | |
Traces (void) | |
Public Member Functions inherited from StandardTraces | |
StandardTraces (void) | |
Public Member Functions inherited from EODTools | |
EODTools (void) | |
double | eodThreshold (const InData &data, double tbegin, double tend, double contrast=0.2) |
void | eodPeaks (const InData &data, double tbegin, double tend, double threshold, EventData &peaks) |
void | eodTroughs (const InData &data, double tbegin, double tend, double threshold, EventData &troughs) |
void | eodPeaksTroughs (const InData &data, double tbegin, double tend, double threshold, EventData &peaks, EventData &troughs) |
double | meanPeaks (const InData &data, double tbegin, double tend, double threshold) |
double | meanTroughs (const InData &data, double tbegin, double tend, double threshold) |
double | eodAmplitude (const InData &data, double tbegin, double tend) |
void | beatAmplitudes (const InData &eodd, double tbegin, double tend, double period, double contrast, double &uppermean, double &upperampl, double &lowermean, double &lowerampl) |
double | beatAmplitude (const InData &eodd, double tbegin, double tend, double period, double contrast=0.2) |
double | beatContrast (const InData &eodd, double tbegin, double tend, double period, double contrast=0.2) |
Protected Attributes | |
Plot | P |
bool | Start |
int | FileCount |
Protected Attributes inherited from ConfigDialog | |
Options | DialogOptions |
Additional Inherited Members | |
Public Types inherited from ConfigClass | |
enum | Action |
Public Slots inherited from ConfigDialog | |
virtual void | dialog (void) |
virtual void | help (void) |
virtual void | notifyDialog (const Options &opt) |
Signals inherited from ConfigDialog | |
void | dialogAccepted (void) |
void | dialogAction (int r) |
void | dialogClosed (int r) |
Static Public Member Functions inherited from ConfigClass | |
static void | setConfigureClasses (ConfigureClasses *cfg) |
Static Public Member Functions inherited from Traces | |
static void | initialize (const RELACSPlugin *rp, const InList &data, const EventList &events) |
Protected Slots inherited from ConfigDialog | |
void | notificationFromDialog (const Parameter &p) |
virtual void | dClosed (int r) |
virtual void | hClosed (int r) |
Protected Member Functions inherited from ConfigDialog | |
void | setDialogOpen (bool open=true) |
void | setHelpOpen (bool open=true) |
Static Protected Member Functions inherited from StandardTraces | |
static void | clearIndices (int *traceindices, int n=-1) |
static void | initStandardTraces (const InList &data, int *ntraces, int *traceindices, const string *names, string &namelist, bool alpha=false) |
static void | initStandardEventTraces (const InList &data, const EventList &events, int *ntraces, int *traceindices, int *eventindices, const string *tracenames, const string *eventnames, string &tracenamelist, string &eventnamelist, bool alpha=false) |
static void | initStandardOutputs (const RELACSPlugin *rp, int *ntraces, int *traceindices, const string *names, string &namelist, bool alpha=false) |
Static Protected Attributes inherited from Traces | |
static int | EODTrace = -1 |
static int | EODEvents = -1 |
static int | ChirpEvents = -1 |
static int | LocalEODTraces = 0 |
static int | LocalEODTrace [MaxTraces] = { -1, -1, -1, -1 } |
static int | LocalEODEvents [MaxTraces] = { -1, -1, -1, -1 } |
static int | LocalChirpEvents [MaxTraces] = { -1, -1, -1, -1 } |
static int | LocalBeatPeakEvents [MaxTraces] = { -1, -1, -1, -1 } |
static int | LocalBeatTroughEvents [MaxTraces] = { -1, -1, -1, -1 } |
static int | FishEODTanks = 0 |
static int | FishEODTraces [MaxTraces] = { 0, 0, 0, 0 } |
static int | FishEODTrace [MaxTraces][MaxTraces] = { { -1, -1, -1, -1 }, { -1, -1, -1, -1 } } |
static int | FishEODEvents [MaxTraces][MaxTraces] = { { -1, -1, -1, -1 }, { -1, -1, -1, -1 } } |
static int | FishChirpEvents [MaxTraces][MaxTraces] = { { -1, -1, -1, -1 }, { -1, -1, -1, -1 } } |
static int | GlobalEField = -1 |
static int | GlobalAMEField = -1 |
static int | LocalEFields = 0 |
static int | LocalEField [MaxTraces] = { -1, -1, -1, -1 } |
static int | LocalAMEFields = 0 |
static int | LocalAMEField [MaxTraces] = { -1, -1, -1, -1 } |
static int | FishEFields = 0 |
static int | FishEField [MaxTraces] = { -1, -1, -1, -1 } |
static int | EFields = 0 |
static int | EField [2 *MaxTraces] = { -1, -1, -1, -1 } |
static int | GlobalEFieldTrace = -1 |
static int | GlobalEFieldEvents = -1 |
static int | LocalEFieldTraces = 0 |
static int | LocalEFieldTrace [MaxTraces] = { -1, -1, -1, -1 } |
static int | LocalEFieldEvents [MaxTraces] = { -1, -1, -1, -1 } |
static int | FishEFieldTraces = 0 |
static int | FishEFieldTrace [MaxTraces] = { -1, -1, -1, -1 } |
static int | FishEFieldEvents [MaxTraces] = { -1, -1, -1, -1 } |
Static Protected Attributes inherited from StandardTraces | |
static const int | MaxTraces |
[RePro] Play EOD mimicks with optional chirps from a range of automatically set difference frequencies and amplitudes.
Stimulation
duration=10seconds
: Signal duration (number
)pause=20seconds
: Pause between signals (number
)ramp=0.5seconds
: Duration of linear ramp (number
)deltafrange=10
: Range of delta f's (string
)deltafshuffle=Up:
Order of delta f's (string
)fixeddf=false:
Keep delta f fixed (boolean
)amplitude=1mV/cm
: Amplitude (number
)amtype=none:
Amplitude modulation of signal (string
)amfreq=1
: Frequencies of amplitude modulation (list
of numbers)amamplitude=100
: Corresponding amplitudes (list
of numbers)repeats=10
: Repeats (integer
)fakefish=0Hz
: Assume a fish with frequency (number
)Chirps
generatechirps=false:
Generate chirps (boolean
)chirpsize=100Hz
: Size of chirp (number
)chirpwidth=100ms
: Width of chirp (number
)chirpampl=0%
: Amplitude reduction during chirp (number
)chirpkurtosis=1
: Kurtosis of Gaussian chirp (number
)chirpfrequencies=
: Chirp frequencies for each delta f (string
)chirptimesfile=
: File with chirp times (string
)chirptimeshuffle=Up:
Order of chirp-time sequences (string
)Analysis
before=1seconds
: Time before stimulation to be analyzed (number
)after=1seconds
: Time after stimulation to be analyzed (number
)averagetime=1seconds
: Time for computing EOD frequency (number
)usepsd=true:
Use power spectrum to measure EOD frequency (boolean
)mineodfreq=100Hz
: Minimum expected EOD frequency (number
)maxeodfreq=2000Hz
: Maximum expected EOD frequency (number
)eodfreqprec=1Hz
: Precision of EOD frequency measurement (number
)neod=2
: Number of attempts for measuring EOD frequency (integer
)showstimulus=false:
Plot frequency of stimulus (boolean
)split=false:
Save each run into a separate file (boolean
)savetraces=false:
Save traces during pause (boolean
)Chirps are generated whenever at least one frequency of chirps (chirpfrequency) or a file containing the timepoints of chirps is specified. If only a chirp frequency is specified, then series of evenly spaced chirps with that frequency are produced. If only a file containing times is specified (no chirpfrequency) then the chirps are positioned as specified in the file. If in addition a chirp frequency is specified, the timepoints in the file are scaled with the inverse frequency. By specifying as many chirp frequencies as there are delta f's the chirp frequency can be made dependent on delta f.
The chirptimesfile may contain several blocks of chirp time sequences. These are then used one after the other as specified by chirptimeshuffle.
In case an "LED-1" output channel is defined, a 5 V signal is put out during stimulation. During generated chirps this signal is set to -5 V.
Beats | ( | void | ) |
|
virtual |
Implements RePro.
References Beats::analyze(), EventData::assign(), EventList::back(), OutData::back(), OutData::bestSampleInterval(), ceil(), Plot::clear(), Map< T >::clear(), EventData::clear(), OutData::clear(), DataFile::col(), OutData::constWave(), DataFile::data(), OutData::description(), Plot::draw(), EventList::empty(), Traces::EODEvents, DaqError::errorText(), OutList::errorText(), EventData::eventSize(), exp(), DaqError::failed(), OutList::failed(), Beats::FileCount, OutData::fill(), Traces::FishChirpEvents, Traces::FishEField, Traces::FishEODEvents, Traces::FishEODTanks, Traces::FishEODTrace, Traces::FishEODTraces, OutData::fixedSampleRate(), floor(), Traces::GlobalEField, OutData::index(), OutData::indices(), Beats::initPlot(), OutData::length(), Plot::lock(), log(), SampleData< T >::max(), max(), RangeLoop::maxCount(), EventData::meanSize(), OutData::minSampleInterval(), nextPowerOfTwo(), Beats::P, peaks(), Plot::plotVLine(), RangeLoop::pos(), OutData::pos(), pow(), power(), OutData::pulseWave(), OutList::push(), EventData::push(), EventList::push(), OutData::ramp(), OutData::rampWave(), Str::range(), DataFile::read(), OutData::rectangleWave(), RangeLoop::remainingCount(), Map< T >::reserve(), EventData::reserve(), RangeLoop::reset(), EventData::resize(), OutData::resize(), TableData::rows(), rPSD(), Beats::save(), OutData::setDelay(), OutList::setDelay(), OutData::setIdent(), OutData::setIntensity(), OutData::setSampleInterval(), RangeLoop::setSequence(), OutData::setTrace(), OutData::setTraceName(), OutData::setUnit(), Plot::setXRange(), OutData::sineWave(), RangeLoop::size(), EventData::size(), OutData::size(), EventList::size(), OutData::stepsize(), and Plot::unlock().
|
virtual |
References Beats::FileCount.
void analyze | ( | double | signaltime, |
double | before, | ||
double | fishrate, | ||
bool | initeoditer[], | ||
EventIterator | eoditer[], | ||
MapD | eodfrequencies[], | ||
MapD | eodamplitudes[], | ||
int | eodinx[], | ||
MapD & | eodfrequency, | ||
bool & | initstimiter, | ||
EventFrequencyIterator & | stimiter, | ||
MapD & | stimfrequency | ||
) |
References EventData::begin(), EventData::end(), Traces::FishEFieldEvents, Traces::FishEODEvents, Traces::FishEODTraces, Map< T >::push(), EventIterator::time(), Map< T >::x(), and Map< T >::y().
Referenced by Beats::main().
void initPlot | ( | double | deltaf, |
double | amplitude, | ||
double | duration, | ||
double | eodf, | ||
const MapD & | eodfrequency, | ||
const EventData & | fishchirps, | ||
bool | showstimulus, | ||
const MapD & | stimfrequency, | ||
const EventData & | chirptimes | ||
) |
References Plot::clear(), Plot::draw(), Plot::keepPointer(), Plot::lock(), ConfigDialog::mutex(), Beats::P, Plot::plot(), Plot::plotVLine(), Plot::setDataMutex(), Plot::setTitle(), Plot::setYFallBackRange(), Plot::setYRange(), and Plot::unlock().
Referenced by Beats::main().
void save | ( | double | deltaf, |
double | amplitude, | ||
double | duration, | ||
double | pause, | ||
int | amtype, | ||
const vector< double > & | amampls, | ||
const vector< double > & | amfreqs, | ||
double | fishrate, | ||
double | stimulusrate, | ||
int | nfft, | ||
double | eodfreqprec, | ||
const MapD | eodfrequencies[], | ||
const MapD | eodamplitudes[], | ||
const MapD & | eodfrequency, | ||
const EventData & | fishchirps, | ||
const EventData & | playedchirpevents, | ||
const MapD & | stimfrequency, | ||
const Options & | chirpheader, | ||
bool | split, | ||
int | count | ||
) |
References Traces::FishEODTraces, Beats::saveChirps(), Beats::saveEODFreq(), Beats::saveMergedEODFreq(), and Beats::savePlayedChirps().
Referenced by Beats::main().
void saveEODFreq | ( | int | trace, |
const string & | es, | ||
const Options & | header, | ||
const MapD & | eodfrequency, | ||
const MapD & | eodamplitude, | ||
bool | split, | ||
int | count | ||
) |
References TableKey::addNumber(), Traces::FishEODEvents, TableKey::save(), TableKey::saveKey(), Map< T >::size(), EventData::sizeFormat(), EventData::sizeScale(), EventData::sizeUnit(), Map< T >::x(), and Map< T >::y().
Referenced by Beats::save().
References TableKey::addNumber(), TableKey::save(), TableKey::saveKey(), Map< T >::size(), Map< T >::x(), and Map< T >::y().
Referenced by Beats::save().
References TableKey::addNumber(), Traces::ChirpEvents, EventData::eventSize(), EventData::eventWidth(), TableKey::save(), TableKey::saveKey(), EventData::size(), EventData::sizeFormat(), EventData::sizeScale(), EventData::sizeUnit(), EventData::widthFormat(), EventData::widthScale(), and EventData::widthUnit().
Referenced by Beats::save().
References TableKey::addNumber(), TableKey::save(), TableKey::saveKey(), and EventData::size().
Referenced by Beats::save().
|
protected |
Referenced by Beats::Beats(), Beats::initPlot(), and Beats::main().
|
protected |
|
protected |
Referenced by Beats::Beats(), Beats::main(), and Beats::sessionStarted().