Auditory-Projects Relacs Plugins 0.9.8
|
[RePro] Measures f-I-curves for a superposition of two sine waves. More...
#include <isoresponse.h>
[RePro] Measures f-I-curves for a superposition of two sine waves.
IsoResponse extrapolates Iso-Response-Sets (IRSs) for two sine amplitudes A1 and A2, i.e. for several combinations of A1 and A2 f-I-curves are recorded and the intensities determined at which the firing rate of the cell reaches predefined values. The stimulus looks like this: s(t)=A1*sin(2pi*f1*t)+A2*sin(2pi*f2*t).
The frequencies can either be set manually (use_best_freq=0), or set at a fixed distance (dist_best_freq) from either side the best frequency (use_best_freq=1), or set at a fixed distance from each (dist_freq) other so that the pure tone stimuli have the same sensitivity according to the tuning curve (use_best_freq=2). !The last option is to be prefered; however, it does not work in all cases!
The stimulus length is defined by 'duration', the time in between stimuli by 'pause'. For each stimuli presentation we record the onset response in the time intervall 'onwidth', and the steady state response after time 'sswidth' has passed, except when 'short_stim' is true - then only the onset is recorded.
The intensity of the signal ranges from 'intmin' to 'intmax'. To find the relevant range in which the f-I-curve rises, the interval is tested with a resolution of 'estres' and each data point is measure 'estrepeats' times. When the relevant range is determined, the resolution is decreased to 'intres' and each point is repeated 'repeats' times. The order in which the intensities is measured is determined with the switch 'inshuffle' (see RangeLoop).
'setFRbounds' determines the limits of the firing rate in between which the f-I-curve is to be measured. If 'switch_high' ('switch_low') is true, the upper (lower) bound is set to 'fix_high' ('fix_low'). Otherwise, the bounds are set to the experimentally determined maximum firing rate fmax minus 'per_high' ('per_low') percent. 'setIBounds' determines then the intensity range by finding the intensities at which the upper and lower bound for the firing rate are reached.
The fraction of the amplitudes ('AmplFraction') determines the shape of the signal. In order to scan the amplitude space equidistantly, we use the tangent of 'AmplFraction' and a scaling factor 'Scaling'. 'Scaling' is estimated from the f-I-curves of the pure tones ('findScaling') to equalize the difference in sensitivity of the two stimulus frequencies. The relative amplitudes of the mixed stimuli are determined by 'AmplRatio'.
The IRSs are determined in 'plotIsoSets' for 'isonumber' firing rates 'FIso'. The extrapolation is only linear using two points. It is therefore strongly recommended to analyze the data offline.
use_best_freq=absolute
: Frequency reference (string
)dist_best_freq=1kHz*3/pi
: Distance of f1 and f2 from best Frequency (for 'best') (number
)dist_freq=2kHz*3/pi
: Distance between f1 and f2 (for 'isothresh') (number
)f1=4kHz
: 1st Frequency (number
)f2=10kHz*3/pi
: 2nd Frequency (number
)intmin=30dB
SPL: Minimum stimulus intensity (number
)intmax=100dB
SPL: Maximum stimulus intensity (number
)intres=1dB
SPL: Final intensity resolution (number
)estres=5dB
SPL: Resolution for estimation of FR-range (number
)intshuffle=Up
: Order of intensities (string
)short_stim=true
: Measure Onset Response only (boolean
)duration=200ms
: Stimulus duration (number
)pause=300ms
: Pause between stimuli (number
)onwidth=10ms
: Window length for onset firing rate (number
)sswidth=100ms
: Window length for steady-state firing rate (number
)repeats=12
: Number of repeats for each stimulus (integer
)estrepeats=3
: Repeats for stimulus while estimating f-I-curve (integer
)side=best
: Speaker (string
)intup=5dB
SPL: Increases upper intensity bound by: (number
)switch_high=false
: Higher bound FR fixed (boolean
)per_high=5%
: Percentage of max FR (number
)fix_high=500Hz
: Absolute value for bound of upper FR (number
)switch_low=false
: Lower bound FR fixed (boolean
)per_low=50%
: Percentage of max FR (number
)fix_low=150Hz
: Absolute value for lower bound of FR (number
)minfr=30Hz
: Minimum firing rater response (number
)isonumber=5
: Number of Iso-Response-Sets evaluated (integer
)isopoints=33
: Number of data points on each IRS (integer
)Space:
Pressing space twice aborts IsoResponse after finishing up measuring the curent f-I curve.isoresponsespikes.dat:
The spike trains...isoresponserates.dat:
Continuous recording of measured f-I-curves. Before each f-I-curve the header data is recorded. The 'run' number marks the experiment. In the table you find the intensity, the true intensity, first and second stimulus amplitude, onset firing rate and standard deviation, the steady state firing rate and standard deviation, the mean firing rate and standard deviation, and the number of repetitions:I(dB SPL) I_t(dB SPL) A1(mPa) A2(mPa) f_on(Hz) sd(Hz) f_s(Hz) sd(Hz) f_m(Hz) sd(Hz) trials
IsoResponse | ( | void | ) |
Constructor.
References IsoResponse::A0, Options::addBoolean(), Options::addInteger(), Options::addNumber(), Options::addText(), IsoResponse::AmplFraction, IsoResponse::AmplitudeRelation, IsoResponse::AmplRatio, atan(), IsoResponse::BestFreq, RangeLoop::clear(), IsoResponse::DistBestFrequency, IsoResponse::DistFrequencies, IsoResponse::Duration, IsoResponse::EstimResolution, IsoResponse::EstRepeats, IsoResponse::FinalResolution, IsoResponse::Flow, IsoResponse::Frequency1, IsoResponse::Frequency2, IsoResponse::FRhigh_fix, IsoResponse::FRhigh_per, IsoResponse::FRlow_fix, IsoResponse::FRlow_per, IsoResponse::Fup, IsoResponse::IntCorrection, IsoResponse::Intensity, IsoResponse::IntensityRange, IsoResponse::IntensityUp, IsoResponse::IrsNumber, IsoResponse::IrsPoints, IsoResponse::IsoResults, MultiPlot::lock(), IsoResponse::MaxIntensity, IsoResponse::MaxRate, IsoResponse::MaxRatePos, IsoResponse::MinFR, IsoResponse::MinIntensity, Options::newSection(), Options::newSubSection(), IsoResponse::OnWidth, IsoResponse::P, IsoResponse::Pause, IsoResponse::pi, IsoResponse::Repeats, MultiPlot::resize(), IsoResponse::Results, IsoResponse::Scaling, Parameter::setStyle(), RELACSPlugin::setWidget(), IsoResponse::ShortStim, IsoResponse::SSWidth, IsoResponse::State, IsoResponse::Switch_high, IsoResponse::Switch_low, MultiPlot::unlock(), and IsoResponse::UseBestFrequency.
~IsoResponse | ( | void | ) |
Destructor.
int main | ( | void | ) | [virtual] |
Read options, create stimulus and start output of stimuli.
Implements RePro.
References RePro::Aborted, Options::addInteger(), Options::addNumber(), RELACSPlugin::adjust(), RangeLoop::alternateInUp(), IsoResponse::AmplFraction, IsoResponse::AmplitudeRelation, IsoResponse::AmplRatio, IsoResponse::analyze(), IsoResponse::BestFreq, Options::boolean(), RangeLoop::clear(), MultiPlot::clear(), RePro::Completed, RangeLoop::count(), IsoResponse::createSignal(), RangeLoop::currentIncrement(), IsoResponse::DistBestFrequency, IsoResponse::DistFrequencies, IsoResponse::Duration, IsoResponse::EstimResolution, IsoResponse::EstRepeats, RELACSPlugin::events(), RePro::Failed, IsoResponse::FinalResolution, IsoResponse::findIsoFreq(), IsoResponse::findScaling(), RangeLoop::finishedBlock(), IsoResponse::FIso, IsoResponse::Flow, IsoResponse::Frequency1, IsoResponse::Frequency2, IsoResponse::FRhigh_fix, IsoResponse::FRhigh_per, IsoResponse::FRlow_fix, IsoResponse::FRlow_per, IsoResponse::Fup, Options::index(), RELACSPlugin::info(), IsoResponse::IntCorrection, Options::integer(), OutData::intensity(), IsoResponse::Intensity, IsoResponse::IntensityRange, IsoResponse::IntensityUp, RePro::interrupt(), IsoResponse::IntShuffle, IsoResponse::IrsNumber, IsoResponse::IrsPoints, IsoResponse::IsoResults, MultiPlot::lock(), RELACSPlugin::lockMetaData(), RELACSPlugin::lockStimulusData(), RangeLoop::loop(), IsoResponse::MaxIntensity, IsoResponse::MaxRate, IsoResponse::MaxRatePos, RePro::message(), RELACSPlugin::metaData(), IsoResponse::MinFR, IsoResponse::MinIntensity, Options::newSection(), Options::number(), IsoResponse::OnWidth, DaqError::overflow(), IsoResponse::P, IsoResponse::Pause, IsoResponse::pi, IsoResponse::plot(), IsoResponse::plotIsoSets(), RangeLoop::pos(), RELACSPlugin::printlog(), IsoResponse::Repeats, RangeLoop::reset(), IsoResponse::Results, IsoResponse::saveRates(), IsoResponse::saveSpikes(), IsoResponse::Scaling, RangeLoop::set(), RangeLoop::setBlockRepeat(), IsoResponse::setFRBounds(), IsoResponse::setIBounds(), OutData::setIntensity(), RangeLoop::setLargeIncrement(), RangeLoop::setSequence(), RangeLoop::setSkipAbove(), RangeLoop::setSkipBelow(), RELACSPlugin::settings(), IsoResponse::ShortStim, IsoResponse::Side, RELACSPlugin::signalTime(), RangeLoop::size(), RePro::sleep(), RePro::softStop(), Traces::Speaker, Traces::SpikeEvents, IsoResponse::SSWidth, IsoResponse::State, RELACSPlugin::stimulusData(), IsoResponse::Switch_high, IsoResponse::Switch_low, tan(), RePro::testWrite(), RePro::totalRuns(), RELACSPlugin::trace(), RePro::tracePlotSignal(), DaqError::underflow(), MultiPlot::unlock(), RELACSPlugin::unlockMetaData(), RELACSPlugin::unlockStimulusData(), IsoResponse::UseBestFrequency, Options::warning(), RePro::write(), and RePro::writeZero().
void saveSpikes | ( | const Options & | header | ) |
References TableKey::addNumber(), RePro::addPath(), IsoResponse::Results, Options::save(), and TableKey::saveKey().
Referenced by IsoResponse::main().
void saveRates | ( | const Options & | header | ) |
References TableKey::addNumber(), RePro::addPath(), IsoResponse::Intensity, IsoResponse::Results, TableKey::save(), Options::save(), and TableKey::saveKey().
Referenced by IsoResponse::main().
void plot | ( | void | ) |
Plot data.
References MultiPlot::clear(), MultiPlot::draw(), IsoResponse::Intensity, IsoResponse::IntensityRange, MultiPlot::lock(), IsoResponse::P, RangeLoop::pos(), Map< T >::push(), IsoResponse::Results, IsoResponse::ShortStim, MultiPlot::unlock(), and RangeLoop::value().
Referenced by IsoResponse::main().
void analyze | ( | const OutData & | signal | ) |
Analyze data.
References IsoResponse::A0, IsoResponse::FIData::A1, IsoResponse::FIData::A2, IsoResponse::AmplRatio, EventList::back(), IsoResponse::FIData::CurMeanRate, IsoResponse::FIData::CurOnRate, IsoResponse::FIData::CurSSRate, IsoResponse::Duration, RELACSPlugin::events(), EventData::frequency(), EventList::frequency(), IsoResponse::IntCorrection, OutData::intensity(), IsoResponse::FIData::Intensity, IsoResponse::IntensityRange, max(), IsoResponse::MaxRate, IsoResponse::MaxRatePos, IsoResponse::FIData::MeanRate, IsoResponse::FIData::MeanRateSD, IsoResponse::MinFR, RangeLoop::next(), IsoResponse::FIData::OnRate, IsoResponse::FIData::OnRateSD, IsoResponse::OnWidth, IsoResponse::Pause, RangeLoop::pos(), EventList::push(), IsoResponse::Results, RangeLoop::setSkip(), IsoResponse::ShortStim, RELACSPlugin::signalTime(), Traces::SpikeEvents, IsoResponse::FIData::Spikes, sqrt(), IsoResponse::FIData::SSRate, IsoResponse::FIData::SSRateSD, IsoResponse::SSWidth, IsoResponse::State, and IsoResponse::FIData::TrueIntensity.
Referenced by IsoResponse::main().
void setFRBounds | ( | double | max | ) | [protected] |
References IsoResponse::FIso, IsoResponse::Flow, IsoResponse::FRhigh_fix, IsoResponse::FRhigh_per, IsoResponse::FRlow_fix, IsoResponse::FRlow_per, IsoResponse::Fup, IsoResponse::IrsNumber, RELACSPlugin::printlog(), IsoResponse::State, IsoResponse::Switch_high, IsoResponse::Switch_low, and Options::warning().
Referenced by IsoResponse::main().
void setIBounds | ( | void | ) | [protected] |
References IsoResponse::FinalResolution, IsoResponse::Flow, IsoResponse::Fup, IsoResponse::IntensityRange, IsoResponse::IntensityUp, IsoResponse::MaxRate, RangeLoop::next(), RELACSPlugin::printlog(), IsoResponse::Repeats, IsoResponse::Results, RangeLoop::setBlockRepeat(), RangeLoop::setIncrement(), RangeLoop::setSkipAbove(), RangeLoop::setSkipBelow(), IsoResponse::ShortStim, RangeLoop::size(), and RangeLoop::update().
Referenced by IsoResponse::main().
void createSignal | ( | OutData & | signal, |
double | a1, | ||
double | a2 | ||
) | [protected] |
References IsoResponse::AmplitudeRelation, IsoResponse::Duration, IsoResponse::Frequency1, IsoResponse::Frequency2, IsoResponse::IntCorrection, IsoResponse::IsoResults, log10(), RangeLoop::pos(), SampleData< T >::ramp(), OutData::setCarrierFreq(), OutData::setIdent(), OutData::setTrace(), IsoResponse::Side, OutData::sineWave(), and Traces::Speaker.
Referenced by IsoResponse::main().
int findIsoFreq | ( | void | ) | [protected] |
References RePro::Continue, RELACSPlugin::control(), IsoResponse::DistFrequencies, RePro::Failed, IsoResponse::Frequency1, IsoResponse::Frequency2, minIndex(), RELACSPlugin::printlog(), Map< T >::size(), Session::threshCurve(), Options::warning(), Map< T >::x(), and Map< T >::y().
Referenced by IsoResponse::main().
void findScaling | ( | void | ) | [protected] |
References IsoResponse::IsoResults, IsoResponse::MaxRate, RELACSPlugin::printlog(), IsoResponse::Scaling, and IsoResponse::ShortStim.
Referenced by IsoResponse::main().
void plotIsoSets | ( | void | ) | [protected] |
References IsoResponse::A0, IsoResponse::AmplitudeRelation, IsoResponse::AmplRatio, MultiPlot::draw(), IsoResponse::FIso, IsoResponse::IrsNumber, IsoResponse::IsoResults, MultiPlot::lock(), IsoResponse::P, RangeLoop::pos(), Map< T >::push(), IsoResponse::Results, IsoResponse::ShortStim, sqrt(), IsoResponse::State, and MultiPlot::unlock().
Referenced by IsoResponse::main().
double Flow [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), IsoResponse::setFRBounds(), and IsoResponse::setIBounds().
double Fup [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), IsoResponse::setFRBounds(), and IsoResponse::setIBounds().
vector< double > FIso [protected] |
Referenced by IsoResponse::main(), IsoResponse::plotIsoSets(), and IsoResponse::setFRBounds().
double IntCorrection [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::createSignal(), IsoResponse::IsoResponse(), and IsoResponse::main().
double Scaling [protected] |
Referenced by IsoResponse::findScaling(), IsoResponse::IsoResponse(), and IsoResponse::main().
double pi [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
double A0 [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::IsoResponse(), and IsoResponse::plotIsoSets().
int UseBestFrequency [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
double BestFreq [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
double DistBestFrequency [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
double DistFrequencies [protected] |
Referenced by IsoResponse::findIsoFreq(), IsoResponse::IsoResponse(), and IsoResponse::main().
double Frequency1 [protected] |
Referenced by IsoResponse::createSignal(), IsoResponse::findIsoFreq(), IsoResponse::IsoResponse(), and IsoResponse::main().
double Frequency2 [protected] |
Referenced by IsoResponse::createSignal(), IsoResponse::findIsoFreq(), IsoResponse::IsoResponse(), and IsoResponse::main().
double MinIntensity [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
double MaxIntensity [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
double FinalResolution [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setIBounds().
double EstimResolution [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
RangeLoop::Sequence IntShuffle [protected] |
Referenced by IsoResponse::main().
bool ShortStim [protected] |
double Duration [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::createSignal(), IsoResponse::IsoResponse(), and IsoResponse::main().
double Pause [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::IsoResponse(), and IsoResponse::main().
double OnWidth [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::IsoResponse(), and IsoResponse::main().
double SSWidth [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::IsoResponse(), and IsoResponse::main().
bool FITest [protected] |
int Repeats [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setIBounds().
int EstRepeats [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
int Side [protected] |
Referenced by IsoResponse::createSignal(), and IsoResponse::main().
double IntensityUp [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setIBounds().
bool Switch_high [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setFRBounds().
double FRhigh_per [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setFRBounds().
double FRhigh_fix [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setFRBounds().
bool Switch_low [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setFRBounds().
double FRlow_per [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setFRBounds().
double FRlow_fix [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::setFRBounds().
double MinFR [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::IsoResponse(), and IsoResponse::main().
int IrsNumber [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), IsoResponse::plotIsoSets(), and IsoResponse::setFRBounds().
int IrsPoints [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
int State [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), IsoResponse::plot(), and IsoResponse::plotIsoSets().
RangeLoop IntensityRange [protected] |
double Intensity [protected] |
Referenced by IsoResponse::IsoResponse(), IsoResponse::main(), IsoResponse::plot(), and IsoResponse::saveRates().
RangeLoop AmplitudeRelation [protected] |
Referenced by IsoResponse::createSignal(), IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::plotIsoSets().
double AmplFraction [protected] |
Referenced by IsoResponse::IsoResponse(), and IsoResponse::main().
double AmplRatio [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::IsoResponse(), IsoResponse::main(), and IsoResponse::plotIsoSets().
int MaxRatePos [protected] |
Referenced by IsoResponse::analyze(), IsoResponse::IsoResponse(), and IsoResponse::main().
double MaxRate [protected] |
vector< IsoData > IsoResults [protected] |