Acoustics Relacs Plugins  0.9.8
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
CalibSpeakers Class Reference

#include <calibspeakers.h>

Inheritance diagram for CalibSpeakers:
Inheritance graph
[legend]
Collaboration diagram for CalibSpeakers:
Collaboration graph
[legend]

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)
 
- 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 OptWidgetdialogOptions (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)
 
- Public Member Functions inherited from Traces
 Traces (void)
 
- Public Member Functions inherited from StandardTraces
 StandardTraces (void)
 

Protected Attributes

MultiPlot P
 
- Protected Attributes inherited from ConfigDialog
Options DialogOptions
 

Static Protected Attributes

static const int MaxGainTries = 6
 
static const int MaxNoSignalTries = 6
 
- Static Protected Attributes inherited from StandardTraces
static const int MaxTraces
 

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)
 
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 Public Attributes inherited from Traces
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 }
 
- 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)
 

Detailed Description

[RePro] Calibrating attenuation for loudspeakers.

Author
Jan Benda
Bug:
too many values pushed into Gains and Offsets?

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!

Options
  • 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)
Files
  • calibrate.dat : the calibration data (measured versus requested stimulus intensity).
Plots
The plot shows the measured versus the requested stimulus intensity (red circles). The yellow line is a fit of a straight line to the data. This line should for a successful calibration coincide with the blue 1:1 line.
Requirements
  • Transdermal EOD recording (EODTrace2) and events (EODEvents2).
Version
1.1 (Aug 12, 2008)

Constructor & Destructor Documentation

CalibSpeakers ( void  )
~CalibSpeakers ( void  )
virtual

Destructor.

Member Function Documentation

void preConfig ( void  )
virtual
int main ( void  )
virtual
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 
)

Member Data Documentation

const int MaxGainTries = 6
staticprotected

Referenced by CalibSpeakers::main().

const int MaxNoSignalTries = 6
staticprotected

Referenced by CalibSpeakers::main().

MultiPlot P
protected

The documentation for this class was generated from the following files: