Acoustics Relacs Plugins
0.9.8
|
#include <calibspeakers.h>
Public Member Functions | |
CalibSpeakers (void) | |
virtual | ~CalibSpeakers (void) |
virtual void | preConfig (void) |
virtual int | main (void) |
void | saveIntensities (double frequency, const MapD &intensities, double fitgain, double fitoffset) |
void | saveOffsets (const MapD &offsets, const ArrayD &gains) |
void | plot (double minintensity, double intensityrange, const MapD &intensities, double fitgain, double fitoffset, const MapD &oldoffsets, const MapD &offsets) |
void | analyze (int intrace, double duration, double skip, double frequency, double soundpressurescale, double intensity, MapD &intensities, double &fitgain, double &fitoffset) |
![]() | |
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) |
![]() | |
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) |
![]() | |
Traces (void) | |
![]() | |
StandardTraces (void) | |
Protected Attributes | |
MultiPlot | P |
![]() | |
Options | DialogOptions |
Static Protected Attributes | |
static const int | MaxGainTries = 6 |
static const int | MaxNoSignalTries = 6 |
![]() | |
static const int | MaxTraces |
Additional Inherited Members | |
![]() | |
enum | Action |
![]() | |
virtual void | dialog (void) |
virtual void | help (void) |
virtual void | notifyDialog (const Options &opt) |
![]() | |
void | dialogAccepted (void) |
void | dialogAction (int r) |
void | dialogClosed (int r) |
![]() | |
static void | setConfigureClasses (ConfigureClasses *cfg) |
![]() | |
static void | initialize (const RELACSPlugin *rp, const InList &data, const EventList &events) |
static string | loudspeakerTraceNames (void) |
static string | leftLoudspeakerTraceNames (void) |
static string | rightLoudspeakerTraceNames (void) |
static string | soundTraceNames (void) |
static string | leftSoundTraceNames (void) |
static string | rightSoundTraceNames (void) |
![]() | |
static int | Loudspeakers = 0 |
static int | Loudspeaker [MaxTraces] = { -1, -1, -1, -1 } |
static int | LeftSpeakers = 0 |
static int | LeftSpeaker [MaxTraces] = { -1, -1, -1, -1 } |
static int | RightSpeakers = 0 |
static int | RightSpeaker [MaxTraces] = { -1, -1, -1, -1 } |
static int | Speaker [2] = { -1, -1 } |
static int | SoundTraces = 0 |
static int | SoundTrace [MaxTraces] = { -1, -1, -1, -1 } |
static int | LeftSoundTraces = 0 |
static int | LeftSoundTrace [MaxTraces] = { -1, -1, -1, -1 } |
static int | RightSoundTraces = 0 |
static int | RightSoundTrace [MaxTraces] = { -1, -1, -1, -1 } |
![]() | |
void | notificationFromDialog (const Parameter &p) |
virtual void | dClosed (int r) |
virtual void | hClosed (int r) |
![]() | |
void | setDialogOpen (bool open=true) |
void | setHelpOpen (bool open=true) |
![]() | |
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) |
[RePro] Calibrating attenuation for loudspeakers.
Calibrates attenuators such that a full amplitude sine wave is put out at an sound pressure level as requested by setIntensity(). The sound pressure level is base on the root mean square of the sound waveform!
frequencyrange=2000
..40000..1000: Frequency range (Hz) (string
)intmin=60dB
SPL: Minimum sound intensity (number
)intrange=40dB
SPL: Sound intensity range (number
)intstep=5dB
SPL: Sound intensity step (number
)outtrace=Speaker-1
: Output trace (string
)intrace=Sound-1
: Input trace (string
)reset=false:
Reset calibration for each frequency? (boolean
)clear=true:
Clear calibration table? (boolean
)duration=400ms
: Duration of stimulus (number
)skip=10ms
: Skip initial stimulus (number
)pause=0ms
: Pause (number
)scale=1
: Scale for V/Pa (number
)EODTrace2
) and events (EODEvents2
).CalibSpeakers | ( | void | ) |
Constructor.
References MultiPlot::lock(), CalibSpeakers::P, MultiPlot::resize(), and MultiPlot::unlock().
|
virtual |
Destructor.
|
virtual |
Reimplemented from ConfigClass.
References Traces::loudspeakerTraceNames(), and Traces::soundTraceNames().
|
virtual |
Implements RePro.
References CalibSpeakers::analyze(), TraceSpec::channel(), MultiPlot::clear(), Map< T >::clear(), LoudSpeaker::clear(), DaqError::clearError(), TraceSpec::device(), MultiPlot::draw(), OutData::free(), gain(), LoudSpeaker::gain(), OutData::intensity(), MultiPlot::lock(), max(), CalibSpeakers::MaxGainTries, CalibSpeakers::MaxNoSignalTries, RangeLoop::maxValue(), RangeLoop::minValue(), DaqError::overflow(), CalibSpeakers::P, CalibSpeakers::plot(), Map< T >::push(), Array< T >::push(), OutData::ramp(), Array< T >::reserve(), Map< T >::reserve(), RangeLoop::reset(), LoudSpeaker::reset(), LoudSpeaker::save(), CalibSpeakers::saveIntensities(), CalibSpeakers::saveOffsets(), OutData::setDelay(), DaqError::setError(), LoudSpeaker::setGain(), OutData::setIntensity(), LoudSpeaker::setSamplingRate(), OutData::setTraceName(), OutData::sineWave(), RangeLoop::size(), Map< T >::size(), DaqError::success(), TraceSpec::traceName(), DaqError::underflow(), MultiPlot::unlock(), and Map< T >::y().
void saveIntensities | ( | double | frequency, |
const MapD & | intensities, | ||
double | fitgain, | ||
double | fitoffset | ||
) |
Save data.
References TableKey::addNumber(), ConfigDialog::date(), Str::format(), TableKey::save(), TableKey::saveKey(), Map< T >::size(), Map< T >::x(), and Map< T >::y().
Referenced by CalibSpeakers::main().
References TableKey::addNumber(), ConfigDialog::date(), Map< T >::empty(), Str::format(), TableKey::save(), TableKey::saveKey(), Map< T >::size(), Map< T >::x(), and Map< T >::y().
Referenced by CalibSpeakers::main().
void plot | ( | double | minintensity, |
double | intensityrange, | ||
const MapD & | intensities, | ||
double | fitgain, | ||
double | fitoffset, | ||
const MapD & | oldoffsets, | ||
const MapD & | offsets | ||
) |
Plot data.
References MultiPlot::clear(), MultiPlot::draw(), SampleData< T >::line(), MultiPlot::lock(), max(), min(), CalibSpeakers::P, and MultiPlot::unlock().
Referenced by CalibSpeakers::main().
void analyze | ( | int | intrace, |
double | duration, | ||
double | skip, | ||
double | frequency, | ||
double | soundpressurescale, | ||
double | intensity, | ||
MapD & | intensities, | ||
double & | fitgain, | ||
double & | fitoffset | ||
) |
Analyze data.
References chisq(), floor(), gain(), Map< T >::lineFit(), log10(), Map< T >::push(), and Map< T >::size().
Referenced by CalibSpeakers::main().
|
staticprotected |
Referenced by CalibSpeakers::main().
|
staticprotected |
Referenced by CalibSpeakers::main().
|
protected |
Referenced by CalibSpeakers::CalibSpeakers(), CalibSpeakers::main(), and CalibSpeakers::plot().