//
//
//   File: MeasureLibrary.h    Created 12-MAY-2007   Richard B. Johnson
//                                                   RichardBJohnson@comcast.net
//
//   The data, text, and source-code within these files are presumed to
//   be accurate and free of encumbrances. Use at your own risk.
//

#ifndef MEASURE_LIBRARY_H
#define MEASURE_LIBRARY_H 1

#include "IScope_Common.h"

class MSL {
public:

//
//  Methods
//
    void AddWaveforms(double * pdData1, double * pdData2, long nLength);
    void SubtractWaveforms(double * pdData1, double * pdData2, long nLength);
    void MultiplyWaveforms(double * pdData1, double * pdData2, long nLength);
	void SqrtSumSqr(double *pdData0, double *pdData1, double *pdData2, long nLength);
	void FiltBySum(double *pdData0, double *pdData1, double *pdData2, double coef, long nLength);
    void InvertWaveform(double * pdData, long nLength );
    double MeasureRiseTime(double * pdData, long nLength, double dRate,double dLoRefVolt, double dHiRefVolt);
    double MeasureFallTime(double * pdData, long nLength, double dRate, double dLoRefVolt, double dHiRefVolt);
    double MeasureFrequency(double * pdData, long nLength, double dRate, long nBurst, double dRefVolt);
    double MeasurePeriod(double * pdData, long nLength, double dRate, long nBurst, double dRefVolt);
    double MeasureRMSVolt(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType);
    double MeasurePeakToPeak(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType);
    double MeasurePosPeak(double * pdData, long nLength);
    double MeasureNegPeak(double * pdData, long nLength);
    double MeasurePulseHiVoltage(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType);
    double MeasurePulseLoVoltage(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType);
    double MeasureDCVolt(double * pdData, long nLength);
    double MeasurePulsePosWidth(double * pdData, long nLength, double dRate, double dRefVolt);
    double MeasurePulseNegWidth(double * pdData, long nLength, double dRate, double dRefVolt);
    double MeasureDutyCyclePos(double * pdData, long nLength, double dRefVolt);
    double MeasureDutyCycleNeg(double * pdData, long nLength, double dRefVolt);
    double MeasurePulseAmplitude(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType );
    double MeasureCycleACVolt(double * pdData,long nLength, double dRefVolt);
    double MeasureCycleDCVolt(double * pdData, long nLength, double dRefVolt);
    double MeasureDCOffset(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType);
    double MeasureOverShoot(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType);
    double MeasureUnderShoot(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType);
    double MeasurePreShoot(double * pdData, long nLength, enum ATE_SIGNAL_TYPE eSignalType);
    double MeasurePhase( double * pdData1, double * pdData2, long nLength, double dRefVolt);
    double MeasureTHD( double * pdData, double dFreq, double dRate, long nLength);
protected:
	static const double pcent;
    static const double hcent;
	static const double turn;

};

#endif






