Commit 77bbd937 authored by Erik von Reis's avatar Erik von Reis
Browse files

doesn't quite work. Analysis assumes size of measurements arrays.

parent 64d8f174
......@@ -677,6 +677,9 @@ namespace diag {
const char stStimulusAmplitudeRange[] = "StimulusAmplitudeRange";
const char stStimulusFilterCmd[] = "StimulusFilter";
const char stStimulusPoints[] = "StimulusPoints";
const char stUseStrictFrequencyConstraints[] = "UseStrictFrequencyConstraints";
const bool stUseStrictFrequencyConstraintsDef = true;
/* Sine Response */
......
......@@ -339,7 +339,7 @@ namespace diag {
frexp (BW / sqrt(2.0), &exp);
BW = ldexp (1.0, exp);
measTime = 1.0 / BW;
if (BW >= fSpan/16 - 1E-12) {
if (useStrictFrequencyConstraints && BW >= fSpan/16 - 1E-12) {
errmsg << "Bandwidth must be smaller than 1/16th of the " <<
"frequency span" << endl;
if (my_debug) cerr << "ffttest::calcTimes() return false line " << __LINE__ << endl ;
......@@ -373,7 +373,7 @@ namespace diag {
}
if (fZoom == 0) {
// normal data
if (fMinSample < fSample - 1E-12) {
if (useStrictFrequencyConstraints && fMinSample < fSample - 1E-12) {
errmsg << "Sampling rate of at least one channel is too small" <<
" (required " << fSample << ")" << endl;
err = true;
......@@ -389,7 +389,7 @@ namespace diag {
"frequency (" << fZoom << ")" << endl;
err = true;
}
if (fMinSample < fSpan - 1E-12) {
if (useStrictFrequencyConstraints && fMinSample < fSpan - 1E-12) {
errmsg << "Sampling rate of at least one channel is too small" <<
" (required " << fSample << ")" << endl;
err = true;
......
......@@ -401,6 +401,15 @@ namespace diag {
stAverages, averages)) {
averages = 1;
}
// read strict settings
if(!test->getParam( *storage->Test,
stUseStrictFrequencyConstraints, useStrictFrequencyConstraints))
{
useStrictFrequencyConstraints = stUseStrictFrequencyConstraintsDef;
}
if (my_debug) cerr << "stdtest::readParam() return " << (err ? "false" : "true") << endl ;
return !err;
}
......
......@@ -188,6 +188,8 @@ namespace diag {
dataChannel::partitionlist partitions;
/// use active time for preprocessing
bool useActiveTime;
//perform strict Frequency checks. Don't allow any frequencies within 10% of nyquist of
/** Constructs a stimulus object.
@memo Default constructor.
......@@ -363,6 +365,8 @@ namespace diag {
std::deque<syncpointer> syncqueue;
/// number of data errors
int dataerrors;
//slowest measurement channel.
bool useStrictFrequencyConstraints;
/** Read parameters. This function checks the storage, rttd and
......
......@@ -457,7 +457,7 @@ namespace diag {
}
// determine sampling rates
samplingFrequencies (fMaxMeas, fMinSample, fMaxSample);
if (fMinSample < 2 * fMax) {
if (useStrictFrequencyConstraints && fMinSample < 2 * fMax) {
errmsg << "Frequency too high for at least one sample rate" << endl;
return false;
}
......
......@@ -462,6 +462,8 @@ namespace diag {
Int_t fAverages;
/// Average type
Int_t fAverageType;
//whether to constrain output to below nyquist frequencies etc.
Bool_t fUseStrictFrequencyConstraints;
/// Number of points
Int_t fPoints;
/// Measurement time
......
......@@ -1432,12 +1432,13 @@ namespace diag {
fParam->fSync.fStart[1]);
fCmdLine->getVar (varname (stSync, stSyncWait), fParam->fSync.fWait);
fCmdLine->getVar (varname (stSync, stSyncSlowDown), fParam->fSync.fSlowDown);
// get test parameters
switch (fParam->fMeas.fMeasType) {
// FFT
case 0:
{
fCmdLine->getVar (testvar (stUseStrictFrequencyConstraints), fParam->fMeas.fUseStrictFrequencyConstraints);
fCmdLine->getVar (testvar (fftStartFrequency), fParam->fMeas.fStart);
fCmdLine->getVar (testvar (fftStopFrequency), fParam->fMeas.fStop);
fCmdLine->getVar (testvar (fftBW), fParam->fMeas.fResolutionBW);
......@@ -1450,12 +1451,14 @@ namespace diag {
fCmdLine->getVar (testvar (fftRampDown), fParam->fMeas.fRampDownTime) ;
fCmdLine->getVar (testvar (fftRampUp), fParam->fMeas.fRampUpTime) ;
fCmdLine->getVar (testvar (fftAverages), fParam->fMeas.fAverages);
fCmdLine->getVar (testvar (fftAverageType), fParam->fMeas.fAverageType);
break;
}
// swept sine
case 1:
{
fCmdLine->getVar (testvar (stUseStrictFrequencyConstraints), fParam->fMeas.fUseStrictFrequencyConstraints);
fCmdLine->getVar (testvar (ssStartFrequency), fParam->fMeas.fStart);
fCmdLine->getVar (testvar (ssStopFrequency), fParam->fMeas.fStop);
fCmdLine->getVar (testvar (ssNumberOfPoints), fParam->fMeas.fPoints);
......@@ -1506,6 +1509,7 @@ namespace diag {
// sine response
case 2:
{
fCmdLine->getVar (testvar (stUseStrictFrequencyConstraints), fParam->fMeas.fUseStrictFrequencyConstraints);
fCmdLine->getVar (testvar (srMeasurementTime), fParam->fMeas.fTimeMeas[0], 2);
fCmdLine->getVar (testvar (srSettlingTime), fParam->fMeas.fTimeSettling);
fCmdLine->getVar (testvar (srRampDown), fParam->fMeas.fRampDownTime) ;
......@@ -1521,6 +1525,7 @@ namespace diag {
// triggered time series
case 3:
{
fCmdLine->getVar (testvar (stUseStrictFrequencyConstraints), fParam->fMeas.fUseStrictFrequencyConstraints);
fCmdLine->getVar (testvar (tsMeasurementTime), fParam->fMeas.fTimeMeas[0]);
fCmdLine->getVar (testvar (tsPreTriggerTime), fParam->fMeas.fTimePreTrig);
fCmdLine->getVar (testvar (tsSettlingTime), fParam->fMeas.fTimeSettling);
......
......@@ -1953,6 +1953,8 @@ namespace diag {
{
dParams.push_back (diagParam (stTestParameterSubtype, 0, 0,
gds_string, stSineResponse, 1, "", false));
dParams.push_back (diagParam (stUseStrictFrequencyConstraints, 0, 0, gds_bool,
&stUseStrictFrequencyConstraintsDef, 1));
dParams.push_back (diagParam (srMeasurementTime, 0, 0, gds_float64,
srMeasurementTimeDef, 2, "s"));
dParams.push_back (diagParam (srSettlingTime, 0, 0, gds_float64,
......@@ -2005,6 +2007,8 @@ namespace diag {
{
dParams.push_back (diagParam (stTestParameterSubtype, 0, 0,
gds_string, stSweptSine, 1, "", false));
dParams.push_back (diagParam (stUseStrictFrequencyConstraints, 0, 0, gds_bool,
&stUseStrictFrequencyConstraintsDef, 1));
dParams.push_back (diagParam (ssSweepType, 0, 0, gds_int32,
&ssSweepTypeDef, 1));
dParams.push_back (diagParam (ssSweepDirection, 0, 0, gds_int32,
......@@ -2057,6 +2061,8 @@ namespace diag {
{
dParams.push_back (diagParam (stTestParameterSubtype, 0, 0,
gds_string, stFFT, 1, "", false));
dParams.push_back (diagParam (stUseStrictFrequencyConstraints, 0, 0, gds_bool,
&stUseStrictFrequencyConstraintsDef, 1));
dParams.push_back (diagParam (fftStartFrequency, 0, 0, gds_float64,
&fftStartFrequencyDef, 1, "Hz"));
dParams.push_back (diagParam (fftStopFrequency, 0, 0, gds_float64,
......@@ -2128,6 +2134,8 @@ namespace diag {
{
dParams.push_back (diagParam (stTestParameterSubtype, 0, 0,
gds_string, stTimeSeries, 1, "", false));
dParams.push_back (diagParam (stUseStrictFrequencyConstraints, 0, 0, gds_bool,
&stUseStrictFrequencyConstraintsDef, 1));
dParams.push_back (diagParam (tsMeasurementTime, 0, 0, gds_float64,
&tsMeasurementTimeDef, 1, "s"));
dParams.push_back (diagParam (tsPreTriggerTime, 0, 0, gds_float64,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment