In file sineresponse.h:

namespace diag class sineresponse : public stdtest

Object for implementing a sine response test

Inheritance:


Public Methods

sineresponse ()
Default constructor.
virtual diagtest* self () const
Diagnostics test object creation function.
virtual bool end (std::ostringstream& errmsg)
Cleanup method.

Protected Classes

class tmpresult
temporary storage for intermediates results
typedef std::vector <string> chnnames
type desribin a list of channel names
explicit tmpresult (tainsec_t T0 = 0, int SizeA = 0, int SizeB = 0, int SizeF = 0)
Default constructor.
~tmpresult ()
Destructor.
tmpresult (const tmpresult& tmp)
Copy constructor.
tmpresult& operator= (const tmpresult& tmp)
Copy operator.
bool allocate (int SizeA = 0, int SizeB = 0, int SizeF = 0)
Allocate memory.
bool valid () const
Valid method.
int sizeA
number of A channels
int sizeB
number of B channels
int sizeF
number of frequencies
tainsec_t t0
start time: t = 0
double* f
frequencies
std::complex <float> * coeff
coefficents table: (sizeA + sizeB) * sizeA
std::complex <float> * cross
crosscorrelation
float* pwr
power coefficients
chnnames names
list of channel names

Protected Fields

double measTime [2]
measurement time
double settlingTime
settling time
int harmonicOrder
harmonic order
int window
window type
bool fftResult
fft result?
double fMin
smallest excitation frequency
double fMax
highest excitation frequency
double fMaxMeas
highest frequency of interest
double fMinSample
lowest sampling frequency
double fMaxSample
highest sampling frequency
double mTime
measuerment time in sec
double mTimeAdd
time to add to mTime to set it to the next time grid
double pTime
precursor time in sec
double sTime
settling time in sec
double rTime
ramp time in sec
int skipMeas
number of skipped measurement steps
tmpresult tmp
temporary storage

Protected Methods

virtual bool readParam (std::ostringstream& errmsg)
Read parameter method.
virtual bool calcTimes (std::ostringstream& errmsg, tainsec_t& t0)
Calculate measurement time method.
virtual bool newMeasPoint (int i, int measPoint = 0)
Calculate measurement point method.
virtual bool calcMeasurements (std::ostringstream& errmsg, tainsec_t t0 = 0, int measPoint = 0)
Add measurements method.
virtual bool analyze (const callbackarg& id, int measnum, bool& notify)
Analysis method.
bool sinedet (int resultnum, int measnum, string chnname, bool stim, const callbackarg& id)
Sine detection method

Inherited from stdtest:

Public Methods

virtual bool begin(std::ostringstream& errmsg)
virtual bool setup(std::ostringstream& errmsg, tainsec_t starttime, syncpointer& sync)

Protected Classes

class stimulus
typedef std::vector <AWG_Component> awglist
list of awg signals
typedef std::vector <float> pointlist
list of awg points
string name
channel name of excitation
bool isReadback
is read back?
string readback
channel name of readback
AWG_WaveType waveform
excitation waveform type
double freq
frequency
double ampl
amplitude
double offs
offset
double phas
phase
double ratio
square wave ratio
double frange
frequency range
double arange
amplitude range
pointlist points
list of points for arbitrary waveform
gdsChnInfo_t excInfo
channel info for exciation channel
gdsChnInfo_t readbackInfo
channel info for readback
awglist signals
excitation signal list
bool duplicate
true if readback channel is a duplicate
rtddChannel::partitionlist partitions
partition list
bool useActiveTime
use active time for preprocessing
stimulus()
Default constructor.
bool calcSignal(tainsec_t t0, tainsec_t duration)
Generates signal list.
bool calcSineSignal(tainsec_t t0, tainsec_t duration, tainsec_t ramp)
Generates sine signal.
enum stimulustype
stimNone
ignore stimulus channels
stimReadback
include stimulus channels which have a valid readback
stimAll
include all stimulus channels
class measurementchannel
string name
channel name of excitation
gdsChnInfo_t info
channel info for exciation channel
bool duplicate
true if channel is a duplicate
rtddChannel::partitionlist partitions
partition list
bool useActiveTime
use active time for preprocessing
measurementchannel()
Default constructor.
class interval
typedef std::pair <tainsec_t, tainsec_t> timeinterval
time interval
timeinterval ival
time interval
bool good
if false, this interval was not rejected by the analysis
interval(tainsec_t t, tainsec_t dt)
Constructor.
tainsec_t t0() const
Interval start.
tainsec_t dt() const
Interval duration.
struct callbackarg
typedef std::pair <tainsec_t, tainsec_t> timeinterval
time interval
timeinterval ival
time interval
int measPoint
measurement point
int measPeriod
measurement period

Protected Fields

friend class chnrec
typedef std::vector <stimulus> stimuluslist
typedef std::set <AWG_WaveType> waveformset
const static waveformset sinewaveOnly
const static waveformset periodicOnly
const static waveformset noiseOnly
const static waveformset allWaveforms
typedef std::vector <measurementchannel> measlist
typedef std::vector <interval> intervallist
typedef testsync <stdtest, callbackarg> stdtestsync
friend class testsync stdtest callbackarg
const diagTest* test
string testType
bool doAnalysis
tainsec_t T0
int averageType
int averages
int avrgsize
int avrgnum
double timeGrid
stimuluslist stimuli
measlist meas
intervallist intervals
std::deque <syncpointer> syncqueue
int dataerrors

Protected Methods

typedef bool (stdtest::*channelAnalysis)(int resultnum, int measnum, string chnname, bool stim, const callbackarg& id)
virtual bool readMeasParam(std::ostringstream& errmsg, int maxIndex = 100)
virtual bool readStimuliParam(std::ostringstream& errmsg, bool needReadback = false, waveformset allowedWaveforms = allWaveforms, int maxIndex = 100)
virtual bool subscribeChannels(std::ostringstream& errmsg)
void samplingFrequencies(double fMax, double& fSampleMin, double& fSampleMax)
virtual double calcTimeGrid(double fMax, tainsec_t* t0 = 0)
virtual bool addMeasPartitions(const interval& ival, int pIndex, double fSample, tainsec_t pt = 0, double fZoom = 0, double fZoomSample = 0, tainsec_t tZoom = 0)
virtual bool addSyncPoint(const interval& ival, int measPeriod, int measPoint = 0)
virtual bool delMeasurements(std::ostringstream& errmsg)
virtual bool addMeasurements(std::ostringstream& errmsg, tainsec_t t0 = 0, int measPoint = 0)
virtual bool startMeasurements(std::ostringstream& errmsg)
virtual bool stopMeasurements(int firstIndex = -1)
bool prepareNextPoint(const callbackarg& id)
virtual bool getNextSyncPoint(const callbackarg& id, syncpointer& sync)
virtual bool syncAction(const callbackarg& id, syncpointer& sync, bool& notify)
virtual bool syncAbort(const callbackarg& id)
virtual bool syncPause(const callbackarg& id, syncpointer& sync)
virtual bool syncResume(const callbackarg& id, syncpointer& sync)
virtual bool callChannelAnalysis(const callbackarg& id, int measnum, channelAnalysis method, int firstres = 0, stimulustype inclStim = stimReadback, bool async = true, bool skipDuplicates = true)

Inherited from diagtest:

Public Methods

static double measurementTime(double duration, double cycles, double f, bool roundup = true)
static double adjustForSampling(double t, double dt)
static tainsec_t fineAdjustForSampling(tainsec_t t, double dt)
virtual string name() const
virtual bool init(diagStorage& Storage, const cmdnotify& Notify, rtddManager& RTDDMgr, excitationManager& EnvExc, excitationManager& TestExc, int KeepTraces, bool rtMode = true)
virtual void setStep(int Step, int resindex)
virtual int getResultNumber()
virtual bool readEnvironment()

Protected Fields

mutable recursivemutex mux
string myname
cmdnotify notify
diagStorage* storage
rtddManager* rtddMgr
excitationManager* testExc
bool RTmode
int step
int rindex
int rnumber
int keepTraces

Inherited from testenvironment:

Public Classes

class environment
int num
array index of Env[]
bool active
active flag
string channel
channel name
string waveform
string describing waveform
std::vector <float> points
points of arbitrary waveform
double wait
settling time
environment()
Default constructor
environment(const environment& env)
Copy constructor

Public Fields

typedef std::vector <environment> environmentlist

Public Methods

virtual void setEnvironmentExcitationManager( excitationManager* excmgr)
virtual bool subscribeEnvironment(std::ostringstream& errmsg)
virtual double waitEnvironment() const
virtual bool startEnvrionment(tainsec_t starttime = 0, tainsec_t timeout = -1)
virtual bool stopEnvrionment(tainsec_t timeout = -1)
virtual bool clearEnvrionment(tainsec_t timeout = -1)

Protected Fields

mutable recursivemutex envmux
excitationManager* envexc
environmentlist envlist

Documentation

Sine Response This object implements the sine response test.

sineresponse()
Constructs a test object for measuring the sine response.
Returns:
void

virtual diagtest* self() const
Returns a new diagnostics test object describing a sine response measurement.
Returns:
new diagnotsics test object

virtual bool end(std::ostringstream& errmsg)
End of test. This function cleans up temporary storage.
Returns:
true if successful
Parameters:
errmsg - error message stream

class tmpresult
temporary storage for intermediates results

typedef std::vector <string> chnnames
type desribin a list of channel names

explicit tmpresult(tainsec_t T0 = 0, int SizeA = 0, int SizeB = 0, int SizeF = 0)
Constructs a temporaray object to store sine detection coefficients.
Returns:
void
Parameters:
T0 - start time
SizeA - number of A channels
SizeB - number of B channels
SizeF - number of frequencies

~tmpresult()
Destructs the temporaray object.
Returns:
void

tmpresult(const tmpresult& tmp)
Constructs a temporaray object from an other one.
Returns:
void
Parameters:
tmp - temporary object

tmpresult& operator= (const tmpresult& tmp)
Copies a temporaray object from an other one. Moves the pointers rather than copy. It will set the pointers in the original object to zero.
Returns:
reference to object
Parameters:
tmp - temporary object

bool allocate(int SizeA = 0, int SizeB = 0, int SizeF = 0)
Allocates new storage. Deletes the old arrays first.
Returns:
true if successful
Parameters:
SizeA - number of A channels
SizeB - number of B channels
SizeF - number of frequencies

bool valid() const
Returns true if object memory is allocated.
Returns:
true if memory is allocated

int sizeA
number of A channels

int sizeB
number of B channels

int sizeF
number of frequencies

tainsec_t t0
start time: t = 0

double* f
frequencies

std::complex <float> * coeff
coefficents table: (sizeA + sizeB) * sizeA

std::complex <float> * cross
crosscorrelation

float* pwr
power coefficients

chnnames names
list of channel names

double measTime[2]
measurement time

double settlingTime
settling time

int harmonicOrder
harmonic order

int window
window type

bool fftResult
fft result?

double fMin
smallest excitation frequency

double fMax
highest excitation frequency

double fMaxMeas
highest frequency of interest

double fMinSample
lowest sampling frequency

double fMaxSample
highest sampling frequency

double mTime
measuerment time in sec

double mTimeAdd
time to add to mTime to set it to the next time grid

double pTime
precursor time in sec

double sTime
settling time in sec

double rTime
ramp time in sec

int skipMeas
number of skipped measurement steps

tmpresult tmp
temporary storage

virtual bool readParam(std::ostringstream& errmsg)
Read parameters. This function reads the parameters from the storage object.
Returns:
true if successful
Parameters:
errmsg - error message stream

virtual bool calcTimes(std::ostringstream& errmsg, tainsec_t& t0)
Calcluate measurement time. This function clalculates start time and duration of each measuremenmt period.
Returns:
true if successful
Parameters:
errmsg - error message stream
t0 - start time

virtual bool newMeasPoint(int i, int measPoint = 0)
Calcluate a new measurement point. This function calculates a new measurement interval, synchronization point and measurement partitions.
Returns:
true if successful
Parameters:
t0 - start time (t = 0)
t1 - earliest time measurement can start
i - measurement point index
measPoint - measurement index

virtual bool calcMeasurements(std::ostringstream& errmsg, tainsec_t t0 = 0, int measPoint = 0)
Calculates measurement parameters. This function determines excitation signals, partitions for the rtdd and synchronization points.
Returns:
true if successful
Parameters:
errmsg - error message stream
t0 - start time
measPoint - measurement point number

virtual bool analyze(const callbackarg& id, int measnum, bool& notify)
Analysis routine which performs the analysis. This function must be overwritten by descendents.
Returns:
true if successful
Parameters:
id - callback argument describing the sync event
measnum - measurement number
notify - if true upon return sends a notfication message

bool sinedet(int resultnum, int measnum, string chnname, bool stim, const callbackarg& id)
Calculates sine amplitude and phase coefficients.
Returns:
true if successful
Parameters:
resultnum - number of result record
measnum - measurement number
chnname - channel name (including array indices)
stim - true if stimulus readback channel
id - callback argument describing the sync event


This class has no child classes.
Author:
Written November 1998 by Daniel Sigg
Version:
0.1
See Also:
Diagnostics test manual for used algorithms

alphabetic index hierarchy of classes


Please send questions and comments to sigg_d@ligo-wa.caltech.edu


generated by doc++