In file sweptsine.h:

namespace diag class sweptsine : public stdtest

Object for implementing a swept sine test

Inheritance:


Public Classes

class sweeppoint
Sweep point type
explicit sweeppoint (double Freq = 0.0, double Ampl= 0.0, double Phase = 0.0)
Default constructor.
double freq
frequency of sine at sweep point
double ampl
amplitude of sine at sweep point
double phase
phase of sine at start of measurement (t0 + tp)

Public Fields

typedef std::vector <sweeppoint> sweeppoints
sweep point array type

Public Methods

sweptsine ()
Default constructor.
virtual ~sweptsine ()
Destructor.
virtual diagtest* self () const
Diagnostics test object creation function.
virtual bool setup (std::ostringstream& errmsg, tainsec_t starttime, syncpointer& sync)
Setup method.
virtual bool end (std::ostringstream& errmsg)
Cleanup method.

Protected Classes

class sstmpresult
temporary storage for intermediates results
explicit sstmpresult (const std::string& Name = "", int Averages = 0)
Default constructor.
~sstmpresult ()
Destructor.
sstmpresult (const sstmpresult& tmp)
Copy constructor.
sstmpresult& operator= (const sstmpresult& tmp)
Copy operator.
bool allocate (int Averages = 0)
Allocate memory.
bool valid () const
Valid method.
int averages
number of averages (coefficients) stored
string name
channel name
std::complex <double> * coeff
sine detection coeffcients

Protected Fields

double measTime [2]
measurement time
double settlingTime
settling time
int harmonicOrder
harmonic order
int window
window type
bool fftResult
fft result?
int sweepType
sweep type
int sweepDir
sweep direction
double fStart
start frequency
double fStop
stop frequency
int nSweep
number of points per sweep
int pAverages
number of averages per point
int AChannels
number of A channels
sweeppoints fPoints
frequency points used by sweep
sweeppoints fPointsFile
frequency points read from file
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
int numA
total number of A channels (including stimuli)
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
sstmpresult* sstmps
temporary storage for results
int sstmpsSize
temporary storage length

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
bool transfn (int resultnum, int measnum, string chnname, bool stim, const callbackarg& id)
Transfer function method
virtual bool syncPause (const callbackarg& id, syncpointer& sync)
Sync pause method.
virtual bool syncResume (const callbackarg& id, syncpointer& sync)
Sync abort method.

Inherited from stdtest:

Public Methods

virtual bool begin(std::ostringstream& errmsg)

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 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

Swept sine This object implements the swept sine test.

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

virtual ~sweptsine()
Destructs a test object for measuring the swept sine response.
Returns:
void

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

virtual bool setup(std::ostringstream& errmsg, tainsec_t starttime, syncpointer& sync)
Sets up the test. This function will activate the excitation and start the data flow from the rtdd interface - after calculating measurement times and setting up the excitations signals and the measurement partitions. This function also returns the first synchronization point.
Returns:
true if successful
Parameters:
errmsg - error message stream
starttime - start time of test
sync - synchronization point

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 sweeppoint
Sweep point type

explicit sweeppoint(double Freq = 0.0, double Ampl= 0.0, double Phase = 0.0)
Constructs a sweep point.
Returns:
void
Parameters:
Freq - frequency
Ampl - amplitude
Phas - phase at start of measurement

double freq
frequency of sine at sweep point

double ampl
amplitude of sine at sweep point

double phase
phase of sine at start of measurement (t0 + tp)

typedef std::vector <sweeppoint> sweeppoints
sweep point array type

class sstmpresult
temporary storage for intermediates results

explicit sstmpresult(const std::string& Name = "", int Averages = 0)
Constructs a temporaray object to store swept sine detection coefficients.
Returns:
void
Parameters:
Name - name of channel
Averages - number of averages (coefficients)

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

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

sstmpresult& operator= (const sstmpresult& 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 Averages = 0)
Allocates new storage. Deletes the old arrays first.
Returns:
true if successful
Parameters:
Averages - number of averages (coefficients)

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

int averages
number of averages (coefficients) stored

string name
channel name

std::complex <double> * coeff
sine detection coeffcients. coeff[0] - frequency, coeff[1] - averaged sine amplitude, coeff[2] ... coeff[1+pAverages] - individual sine amplitudes.

double measTime[2]
measurement time

double settlingTime
settling time

int harmonicOrder
harmonic order

int window
window type

bool fftResult
fft result?

int sweepType
sweep type

int sweepDir
sweep direction

double fStart
start frequency

double fStop
stop frequency

int nSweep
number of points per sweep

int pAverages
number of averages per point

int AChannels
number of A channels

sweeppoints fPoints
frequency points used by sweep

sweeppoints fPointsFile
frequency points read from file

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

int numA
total number of A channels (including stimuli)

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

sstmpresult* sstmps
temporary storage for results

int sstmpsSize
temporary storage length

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

bool transfn(int resultnum, int measnum, string chnname, bool stim, const callbackarg& id)
Calculates the transfer function and the coherence.
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

virtual bool syncPause(const callbackarg& id, syncpointer& sync)
Callback for pausing the test. This function is called when the user pauses the test.
Returns:
true if successful
Parameters:
id - callback argument describing the sync event
sync - next synchronization point, or 0 if continue

virtual bool syncResume(const callbackarg& id, syncpointer& sync)
Callback for resuming the test. This function is called when the user resumes the test.
Returns:
true if successful
Parameters:
id - callback argument describing the sync event
sync - next synchronization point, or 0 if continue


This class has no child classes.
Author:
Written June 1999 by Daniel Sigg
Version:
0.1

alphabetic index hierarchy of classes


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


generated by doc++