Вы находитесь на странице: 1из 84

DEWESoft

Training Manual Mathematics


Version 2.1x

Tableofcontents

MATHOVERVIEW..........................................................................................................................6
Formula...............................................................................................................................................6
BasicOperators...............................................................................................................................6
DIVDivision(Integer)................................................................................................................6
MODModulusfunction............................................................................................................6
Functions.........................................................................................................................................7
SQRSquare.................................................................................................................................7
SQRTSquareroot......................................................................................................................7
ABSAbsolutevalue...................................................................................................................7
SGNSign...................................................................................................................................7
TRUNCTruncatefunction.........................................................................................................8
ROUNDRoundfunction............................................................................................................8
RNDRandom............................................................................................................................8
LOG2Logarithmbase2............................................................................................................8
LOG10Logarithmbase10........................................................................................................8
LNNaturallogarithmbasee.....................................................................................................8
EXPExpotentialfunctionofe...................................................................................................9
IFConditionaloutput................................................................................................................9
NANnotanumberfunction.....................................................................................................9
MAX/MINMaximum/Minimumfunctionofmorechannels..............................................10
Trigonometry.................................................................................................................................10
Logic...............................................................................................................................................11
Signals............................................................................................................................................12
SCNTSamplecounter.............................................................................................................12
SRSamplerate........................................................................................................................12
TimeTimefunction.................................................................................................................12
SineSinewave........................................................................................................................13
SquareSquarewave...............................................................................................................13
TrianTriangularwave.............................................................................................................13
NoiseNoisesignal...................................................................................................................13

Version2.1

Page2

Measure.........................................................................................................................................14
Pulsewidth.................................................................................................................................14
StopwatchStopwatchfunction..............................................................................................14
Measdiffmeasuredifference.................................................................................................15
Edge.detectsignaledge..........................................................................................................15
EcntEdgecounter...................................................................................................................15
IcntCounthighvalues............................................................................................................15
HoldHoldfunction.................................................................................................................15
Trig.............................................................................................................................................16
Events............................................................................................................................................17
KeypressedKeypressedfunction............................................................................................17
MajorKeycodes........................................................................................................................18
Filters.................................................................................................................................................19
FIRandIIRfilters............................................................................................................................19
ComparisonbetweenIIRandFIRfilter......................................................................................19
Phaseresponse..........................................................................................................................19
IIRFiltertypesoverview.........................................................................................................21
IIRfilterDerivationanddYderivationofasignal....................................................................21
FFTfilter.........................................................................................................................................23
Statistics............................................................................................................................................24
Basicstatistics................................................................................................................................24
Blockbasedaverage..................................................................................................................24
Runningaverage........................................................................................................................25
Singlevalue................................................................................................................................25
Triggeredblocks........................................................................................................................25
StartStopblocks.....................................................................................................................26
Arraystatistics...............................................................................................................................26
Classification..................................................................................................................................27
Counting........................................................................................................................................29
Correlation.....................................................................................................................................30
Referencecurves...............................................................................................................................31
Referencecurve.............................................................................................................................31
XYreferencecurve........................................................................................................................32
FFTreferencecurve.......................................................................................................................32

Version2.1

Page3

Constant........................................................................................................................................32
FREQOther........................................................................................................................................32
Exactfrequency.............................................................................................................................32
CAnoise.........................................................................................................................................33
Envelope........................................................................................................................................33
Delaychannel................................................................................................................................33
Triggering...........................................................................................................................................34
Latchmath.....................................................................................................................................34
Anglesensor..................................................................................................................................35
Scopetrigger.................................................................................................................................35
Spectralanalysis................................................................................................................................36
FFTFastFourierTransformation................................................................................................36
STFTShortTimeFourierTransformation...................................................................................37
CPBConstantPercentageBandwidth.........................................................................................38
Rosettes.............................................................................................................................................38
DEWESoft7.1newfunctions..........................................................................................................39
Complex.........................................................................................................................................39
Arrays.............................................................................................................................................39
Matricestwodimensionalarray................................................................................................40
MATHEXAMPLES........................................................................................................................41
Formula.............................................................................................................................................41
Function:MOD/TRUNCExample:SeparateCANGPSSignaltoDEG:MIN,xxx..........................41
Function:MOD/TIMEExample:Showactualvalueaveragedevery10sinalistandexportitto
Excel...............................................................................................................................................41
Function:SCNTSampleCounterExample:CreateAngleSignal.................................................42
Function:StopwatchExample:Velocitywithtwolightbarriers................................................43
Function:HOLDExample:RemoveoffsetfromaChannel.........................................................44
Function:KEYPRESSED/LATCHExample:LatchValueintoList.................................................45
Triggereventishighforspecifiedduration..................................................................................46
Decodelogicalsignalforpositiveandnegativesigninmathematics...........................................46
Dutycyclecalculationslowsignals(pulsewidth,stopwatchfunction)......................................47
Dutycyclesignalgenerator(mod,scnt)........................................................................................48
Stopwatchtriggeredbyevent(keypressed).................................................................................48
Countpulsesthatarelongerthanaspecifiedduration................................................................49
Measurement(tn)Measurement(tn1)prevfunction.................................................................50
Logicaleventcounterwithtworesetconditionslogical,keypressed,storingfunction............51
Filters.................................................................................................................................................52
Function:Acceleration velocity displacement.....................................................................52

Version2.1

Page4

Statistics............................................................................................................................................54
Function:AverageExample:RemoveoffsetfromchannelPOSTProcessing............................54
RMSandaveragevalueforspecificpartsofasignalchosenbycursor........................................55
Peakholdfunction.........................................................................................................................57
Peakholdfunctionatexactpeakposition.................................................................................58
HowtostartAverageblockexactlyfromtriggerevent................................................................59
ReferenceCurve................................................................................................................................60
Function:Createareferencecurve,withrestartpossibility.........................................................60
HowtodisplayFFTreferencecurveinFFTdisplay.......................................................................61
Other.................................................................................................................................................62
Soundcarddemodetectpeakfrequencywithexactfrequency...............................................62
Triggering...........................................................................................................................................63
Multiplescopetriggers..................................................................................................................63
ScopeTrigger,Arraystatistics.......................................................................................................64
Phaseanglefiringsimulation........................................................................................................64
Countergametime,hold,keypressed,latchmath,if,round,mod,basicstatistics..................66
Dutycyclecalculationfastsignals(withanglesensor)..............................................................68
Spectralanalysis................................................................................................................................69
Findharmoniccomponentsofperiodicsignal..............................................................................69
CopyFFTspectrumtomatharrayconstant..................................................................................69
Findharmoniccomponentsofnoisesignal(ifpresent)................................................................70
FFTaverageinmathprevfunction..............................................................................................71
ComplexFFTextractrealandimaginarypart............................................................................72
DEWESoftGeneralhints.................................................................................................................73
Hint:HowtoaddanaverageFFTtoadatafile..............................................................................73
Hint:Nonlinearscalingofsensors................................................................................................74
Hint:Addnotesduringmeasurement...........................................................................................75
Hint:DownsizeDEWESoftdatafiles...............................................................................................76
Hint:PortingDEWESoft6setupfiles(*.dss)toDEWESoft7(*.d7s)...............................................77
Hint:Triggeronanoisysignal(filterededge)...............................................................................78
Hint:Keypressedeventasmanualstoringtrigger........................................................................79
Controlchannelvariableforcontrolbutton,sliderinput,.....................................................80
DEWESoft7.1arraymath...............................................................................................................82
DEWESoft7.1arraycalculationusedforFLIRinfraredcamera.................................................82
DEWESoft7.1derivationandintegrationofanarray(vector)..................................................84

Version2.1

Page5

MATHOVERVIEW
Formula
Mostofthefunctionsbelowaredescribedwithdiscretenumbersinsteadofchannelnamesforeasier
understanding.
BasicOperators

General mathematics
Function

Syntax

Description

expression1 + expression2

expression1 plus expression2

expression1 - expression2

expression1 minus expression2

expression1 * expression2

multiplies expression1 by expression2

expression1 / expression2

divides expression1 by expression2

()

(expression)

brackets expression

expression1 ^ expression2

raises expression1 to the power of expression2

DIVDivision(Integer)
div:integerdivisionoperation
105.3DIV10=10

integervalueof10.53is10

MODModulusfunction
mod:deliverstheintegerremainderofamathematicalintegerdivisionoperation
420MOD720=420 420cannotbedividedby720,andwewillgetthe

remainderofthedivisionwhichis420.
740MOD720=20
740canbedividedby720onetime,witharemainderof20.
105.3MOD10=5
105canbedividedby1010times,witharemainderof5.3.
Theintegervaluereturnedis5.

Version2.1

Page6

Functions

SQRSquare
sqr:Thesquareofanumberisthenumbermultipliedwithitself.Nomatterifthenumberispositive
ornegativetheresultwillalwaysbepositive.
sqr(4)=16
sqr(3)=9
SQRTSquareroot
sqrt:ThesquarerootofnumberBisthenumberA.SoitistheinversefunctionofSQR.
sqrt(16)=4

sqrt(9)=3

Info:SQRTofanegativenumbersqrt(9)willdeliveralways0insteadofacomplexnumberin
DEWESoft.

ABSAbsolutevalue
abs:Calculatestheabsolutevalueofnumberorachannel.

ABS(45.34)=45.34

ABS(33.12)=33.12

ABS(0)=0

SGNSign
sgn:Extractsthesignofachanneloranumber.
Signfunctiondelivers0ifinputchannelornumberis0.

sgn(8.124)=1

sgn(19.345)=1

sgn(0)=0

Version2.1

Page7

TRUNCTruncatefunction
trunc:Convertsanumberintointeger,everynumberorchannelwhichisconvertedwiththetrunc
functionwilllosethepartafterthecomma.

trunc(1452.457)=1452

trunc(1452.457)=1452
Itisnotroundedupordown,soboth:
trunc(86.248)=86andalso
trunc(86.848)willgive86.

ROUNDRoundfunction
round:roundsanumberorchanneldependingonthedigitsafterthecommatoanintegervalue.

3.xxxifxxxisbiggerorequal0.5itwillberoundeduptothenextintegervalue.

round(14.43)=14

round(14.501)=15

round(14.492)=14

round(14.51)=15

Hint: if you want to round 136.3724 to 140 simply divide the value or channel by 10, round it and
multiplytheresultby10.

round(136.3724/10)*10=140
RNDRandom
rnd:createsrandomnumberswiththeselectedsamplingratebetween0and1.Soifasamplerateof
1000Hzisselected,1000valuespersecondarecreated.

LOG2Logarithmbase2
log2:calculatesthelogarithm(base2)ofanumberoraninputchannel.

Log2(8)=3

Log2(a)=b

thelogarithmextractsbfromanequation 2

= a .

LOG10Logarithmbase10
log10:calculatesthelogarithm(base10)ofanumberoraninputchannel.

Log10(100)=2

Log2(a)=b

thelogarithmextractsbfromanequation 10

= a .

LNNaturallogarithmbasee
ln:calculatesthenaturallogarithm(basee=2.71828)ofanumberoraninputchannel.

LN(100)=2

LN(a)=b

thelogarithmextractsbfromanequation 2.71828 ..

= a .

Version2.1

Page8

EXPExpotentialfunctionofe
exp:calculatestheexponentialfunctionofefromanumberoraninputchannel.

EXP(1)=2.71828

EXP(b)=a

thelogarithmextractsbfromanequation 2.71828 ..

= a .

IFConditionaloutput
if(condition,result1,result2)
Outputseithertheresult1orresult2dependingoncondition.Ifconditionistrue,result1isoutput,
elseresult2isoutput;conditionmustbealogicaloperation,whichgivestrueorfalse.

Example:IF(ID>=1,velocity,displacement)

ID,velocity,anddisplacementareanaloginputchannels.

IftheIDchannelisequaltoorgreaterthan1,thestatementistrueandthevelocity
channelwillbechosenas output, otherwise displacement. So either velocity or
displacementareusedforoutputdependingonthecondition,bothatthesametimearenot
possible.
NANnotanumberfunction
nan(notanumber)
if('STWH_ANGLE'>=90,'velocity',NAN)

'STWH_ANGLE=CANChannel(asynchronous)

Velocity=analoginputchannel(synchronous)
ThechannelwilloutputNANonlyifSTWH_Angleissmallerthan90deg;thetimebaseofthemath
channelwillbeforcedtoasynchronousoutput.Otherwisebecauseasynchronouschannelisusedin
theformula(velocity)theformulawilloutputasynchronouschannelandNANwillbecomezero.

Thepictureaboveisshowingthetimebasesettingofthemathchannel.
Theasynchronouschannelhastobeusedintheformulaotherwiseitisnotpossibleto
selectitinthechannelselector.Theinterpolationhastobesettonever.

Version2.1

Page9

MAX/MINMaximum/Minimumfunctionofmorechannels
max/min: max(Channel1,Channel2) checks both channels and outputs the maximum /minimum
valueofoneofthechannels.

Example:max(pressure1,pressure2)pressure1andpressure2aretwoanaloginputchannels.

pressure13468

pressure22 547

output 3 568

Thehighervalueifbothchannelswillbeoutput.

INFO:Alsomultiplemaxcouldbeusedinoneformula.

Max(max(pressure1,pressure2),pressure3)

Trigonometry

Trigonometric functions
Function

Syntax

Description

SIN

SIN(expression )

sine of expression

COS

COS(expression )

cosine of expression

TAN

TAN(expression )

tangent of expression

PI

PI

constant pi

ASIN

ASIN(expression)

arcsine of expression

ACOS

ACOS(expression)

arccosine of expression

ATAN

ATAN(expression) or ATAN(x,y)

arctangent of expression or arctangent of x/y

Version2.1

Page10

Logic

Logic functions
Function

Syntax

Description

<
=
>
<=
<>
>=
NOT

expression1 < expression2


expression1 = expression2
expression1 > expression2
expression1 <= expression2
expression1 <> expression2
expression1 >= expression2
NOT expression

AND

expression1 AND expression2

OR

XOR

expression1 OR expression2

expression1 XOR expression2

if expression1 is less than expression2 then output is 1, else 0


if expression1 is equal to expression2 then output is 1, else 0
if expression1 is greater than expression2 then output is 1, else 0
if expression1 is less than or equal to expression2 then output is 1, else 0
if expression1 is less or greater than expression2 then output is 1, else 0
if expression1 is greater than or equal to expression2 then output is 1, else 0
negation; expression = 0: 1; expression = 1: 0;
logic and
1 AND 1 = 1
1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0
logic or
1 OR 1 = 1
1 OR 0 = 1
0 OR 1 = 1
0 OR 0 = 0
logic exclusive or
1 XOR 1 = 0
1 XOR 0 = 1
0 XOR 1 = 1
0 XOR 0 = 0

Version2.1

Page11

Signals

SCNTSamplecounter
scnt:deliversthesamplesacquiredfromstartofthemeasurement.Thecounterwillberesetatthe
startofstoring.

Theleftpictureisshowingtheresult,whileattherightpicturetheresetafterstartstoringcouldbe
seen.

SRSamplerate
sr:samplerateofdataacquisition

TimeTimefunction
time:isprovidingtheelapsedtimeofthemeasurementinseconds.

ThisisafunctionsimilartoSCNT.Theonlydifferenceis,insteadofsamples

Itoutputsthetimeinseconds,regardlesswhichsamplingrateisused.

Note:theTIMEfunctionisresetatthestartofstoring.
Theresolutionislinkedwiththesamplingrate.

Thescreenshotbelowshowsthetimefunctioninarecorder,
Wecanseethattheresolutionis0.01sandalsodt=10mswhichresultsinasamplingrateof100Hz.

Version2.1

Page12

Sothetimewillcountup0.01saftereverysample@samplingrateof100Hzor0.001s@sampling
rate1kHz

SineSinewave
sine:createssinewavesignalwithamplitudex,frequencyfandoptionalphaseshiftinradian

x*sine(100,pi)

givesasinewavewith100Hzandshiftedby180
SquareSquarewave
square:createssquarewavesignalwithfrequencyfandoptionalphaseshiftinradian

TrianTriangularwave
trian:createstriangularwavesignalwithfrequencyfandoptionalphaseshiftinradian

NoiseNoisesignal
noise:createsrandomwhitenoisesignalwithamplitudefrom1to+1

Version2.1

Page13

Measure

Pulsewidth
pulsewidth(cond[,rearm])
Measures the time in seconds between two condition edges (where cond changes from 0 to 1),
rearmedgeoptional.
StopwatchStopwatchfunction
stopwatch: stopwatch(Condition1,Condition2) measures the time in [s] between condition1 and
condition2.Conditionisalogicvaluethatjumpsfrom0to1(edgesensitive).

Example: stopwatch('Start'>0.5,'Stop'>0.5) Start and Stop could be analog or


digital signal. The logic comparison > turns the condition into a logic
valueanyway.

Version2.1

Page14

Measdiffmeasuredifference
measdiff(value,cond1,cond2)
Measuresvaluedifferencebetweencond1andcond2edges(wherecondjumpsfrom0to1).
Edge.detectsignaledge
edge(cond[,rearm])
Returns1whenthecondchangesfrom0to1,withoptionalrearmcondition
EcntEdgecounter
ecnt(cond)
Countsnumberofedgesforcond(wherecondjumpsfrom0to1).
IcntCounthighvalues
icnt(cond)
Countsallthesampleswheretheconditionhaslogicalvalue1.
HoldHoldfunction
hold(value,latchcondition,[rearmcondition])

Theholdfunctionisusedtolatchorholdasinglevalueifaconditionismet.

Example1:Hold(pressure,Temperature>30)

Hold(value,latchcondition)

Intheexampleabovethefunctionwillholdtheactualpressureifthetemperatureishigher

orequalto45degrees.

Thepictureaboveisshowingthefunctioninarecorder.Allthetimewhenthetemperatureexceeds
30deg(greenarrows),theactualpressurechannelislatched.

Version2.1

Page15

Example2:Hold(pressure,Temperature>30,Temperature<28)

Hold(value,latchcondition,[rearmcondition])optional.

The function can be extended with a rearm condition. After a latch condition occurs, the
reamconditionhastobemetfirstbeforeanewlatch conditionandthereforeanewlatch
canoccur.
This is used to filer the latch condition a little bit. Imagine the latch condition channel has
noise on it, or is fluctuating around the level (30 deg +0.2 deg) which would cause a
unintentionalLATCH.

Thepictureaboveillustratesthisfunction:

1.)Temperaturerisesabove30deg LATCH1greenarrow
2.) Temperature goes below 30 deg and back above 30 deg no LATCH because
temperaturedidnogounder28degthereforetheLATCHdidnotoccur.Redarrow.
3.)Temperaturegoesbelow28deg rearmconditioniscomplied
4.)Temperatureexceedsagain30deg LATCHisperformedagain

Trig
trig:hasvalueof1whenastoreconditionappears(1pulse)

Version2.1

Page16

Events

KeypressedKeypressedfunction

Almostanykeycanbeusedinthekeypressedfunction.
Thevalueinthebracketsisreflectingthevirtualkeycodeindecimal.
Belowyouwillfindalistofthemostpopularkeys.Youhavetoconvertthemfrom
Hextodecimal.So[Key1] 31hex 49dec..Thedecimalvaluehastobeentered
Intothekeypressedfunction.keypressed(49).

Version2.1

Page17

MajorKeycodes

INFO:DonotuseF2becauseitisusedasshortcuttoenterSetup.
If you need any other key which is not present in the upper list, search for key codes or ASCII
tableintheinternet.

Displayscreenselection
<F2>SwitchtoSetupscreen
<F3>or<SHIFT>+<F1>SwitchtoOverviewscreen
<SHIFT>+<F2>SwitchtoScopescreen
<SHIFT>+<F3>SwitchtoRecorderscreen
<SHIFT>+<F4>SwitchtoVerticalrecorderscreen
<SHIFT>+<F5>SwitchtoFFTscreen
<SHIFT>+<F6>SwitchtoPowerscreen
<SHIFT>+<F10>SwitchtoVideoscreen
<SHIFT>+<F11>SwitchtoGPSscreen

Version2.1

Page18

Filters
FIRandIIRfilters
Afiniteimpulseresponse(FIR)filterisatypeofasignalprocessingfilterwhoseimpulseresponse(or
responsetoanyfinitelengthinput)isoffiniteduration,becauseitsettlestozeroinfinitetime.This
isincontrasttoinfiniteimpulseresponse(IIR)filters,whichhaveinternalfeedbackandmaycontinue
torespondindefinitely(usuallydecaying).
ComparisonbetweenIIRandFIRfilter

fast(lesscomputationalcost)
alwaysstable
linear phase in transmission
band
high stopband attenuation
withloworder
lessrippleinpassband
canbeusedforintegrationand
derivation

IIRfilter

FIRfilter

Phaseresponse
Inthefiltersetupscreen,anamplitudeandphasediagramisshown,wherethefiltercharacteristics
fortheactualfilterparameterscanbepreviewed.
IIR
Belowabutterworthlowpassfilterisshownwithupperfrequencyof2100Hz,10thorder.Thephase
diagramshows180for1kHz,whichcanalsobeverifiedinasimplemeasurement.

Version2.1

Page19


greencurve:originalsignal,sinewave1kHz
bluecurve:IIRlowpassfilteredsignal,phaseresponseof180at1kHz(inpassband)
red curve: FIR lowpass filtered signal, linear phase response in passband (amplitude scaled differently for
presentation)

FIR
Although the phase is linear in transmission band, the amplitude is already 4dB lower at cutoff
frequency(atorder60,seebelow).

Hint:
If signal timing is critical and filtered and unfiltered channels are compared, use FIR filters. The
overallfilterdelayiscompensatedinsideDEWESoftandbecauseoflinearphaseintransmissionband
nofrequencydependantadditionaldelayiscreated.Ifeachtimingcriticalchannelisfilteredwiththe
samefilterandthencompared,alsoIIRfilterscanbeused,sinceeachchannelhastheexactsame
totalphaseshift(stillfrequencydependant,butthesameforallchannels).

Version2.1

Page20

IIRFiltertypesoverview
Butterworth:
Thefrequencyresponseismaximallyflat(hasnoripples)inthepassbandandrollsofftowardszero
inthestopband;20dBperdecadeperorder.
It has a slower rolloff, and thus will require a higher order to implement a particular stopband
specificationcomparedwithaChebyshevfilter,butithasamorelinearphaseresponseinthepass
band.

Chebyshev:
ChebyshevfiltershaveasteeperrolloffbutmorepassbandripplethanButterworthfilters.

Bessel:
Thisfilterisatypeoflinearfilterwithamaximallylinearphaseresponseacrosstheentirepassband,
thuspreservingthewaveshapeoffilteredsignalsinthepassband.

IIRfilterDerivationanddYderivationofasignal

Derivationdescribesthemaximumvoltagechangeofasignal.

Ifwehaveafunction:
s(t)=3*t+1thisfunctionwillcreateasignalshowninpicturebelow.

Sothesignalwillstart@1andwillcountup3unitsafter1second.

Version2.1

Page21

Thederivationofthissignalwillbe3V/s.

Thenextexampleshowsthederivationofasinesignal.
Asinesignalwhichisdescribedas5*sine(10)willcreateasinewavewith5Vamplitudeand10Hz.
Derivationwillyield:5*2*pi*10*cos(10)thereforeacosinewithanamplitudeof314.15V/s.

ThefilterscanbealsousedtocalculatethedYofasignal.

Example:asignalwithvoltage3,5,7,8,12,15,.willresultin(53)=2,(75)=2,(87)=1,4,3dY

Version2.1

Page22

For this we have to manually enter coefficients into a filter, like shown in the upper picture. In
comparison to Derivation, here only dY is calculated where at derivation dY/dt is calculated. So in
simplyword,dYisdividedwithdt=samplerate.

FFTfilter
FFTfilterisquitedifferentfromothertypesoffilters.WhileIIRandFIRfiltersaretimedomainfilters,
FFTfiltercalculatesthespectrumofthesignalwithaspecificnumberoflinesandoverlapandthen
extractstheRMSvalueofcertainrangeofthissignal.Thereforetheresultisnotthefullcurve,but
onlyonevalueperfrequencyspectrum.
The usage of this filter is to extract low peaks of signals where there are big harmonics nearby. It
wouldn'tbepossibletouseIIRfiltertoextractamplitudesthislow.
Theexamplebelowshowstheelectromotorwindingfailurewhichcanbeseenaslowvaluesatthe
rotationfrequencywherethelinefrequencyisveryhigh:

If we choose Tracking Frequency source, we need to enter the Frequency channel and Number of
harmonicsinsteadofcenterfrequency.

Version2.1

Page23

Statistics
Basicstatistics
There are several modes how the statistic values (RMS, average, quadratic RMS, minimum,
maximum,crestfactor,peak,peakpeak,variance,standarddeviation,covariance)canbecalculated.
Blockbasedaverage
Blocks of defined size (block size in seconds) with defined overlap are used to calculate average
values.Here,onesecondblocksizewith50%overlapgivesonestatisticvalueevery0.5s,asseenin
thescreenshotbelow.

Version2.1

Page24

Runningaverage
HereinthisexampletheRUNNINGmodeoverablocksizeof1sischosen.

Youcanvisualizethecalculationlikethis:

Awindowwithalengthof1sismovedoverthechanneltoaverage.Allthedatainthiswindowwill
beaveragedandasingleaveragevaluewillbetheresult(indicatedbythered,blue,green,andgray
boxesinthepicturebelow).Afterthat,thewindowwillbemovedforonesampletotherightandthe
average will be calculated again. So the output will be a synchronous channel with the full sample
rate.Thepicturebelowwillillustratethefunctioninmoredetail.

Singlevalue

This setting gives one overall statistical value for all channel data. If the target channel is
asynchronous, and only existing values (without interpolation) should be used for statistics, then
makesuretochecktheuseonlyexistingsettingscheckbox.
Triggeredblocks
Triggeredblocksoptioncalculatesthestatisticalvaluebasedonspecifictriggerevent.Wheneventis
recognized, statistics calculation is started. When a second event is recognized, the calculation is
stoppedandthestatisticalvalueiswrittenwithitstimestamp.Afterthatthenextvalueiscalculated.

Version2.1

Page25

StartStopblocks
This feature works the same as triggered blocks, except a different channel is specified as stop
trigger.

Arraystatistics
Thearraystatisticscancalculatethestatisticalvaluefromanarray.
Thereareseveraloptionswhichcanbechosen:
minimumfindsminimumvaluefromthearray.
Therearetwooutputchannelscreated:classandvalue.Classwilldescribewhichindexofthearray
holdstheparameterandthevaluewillbetheminimumvalueitself.
maximumfindsmaximumvaluefromthearray.
Therearetwooutputchannelscreated:classandvalue.Classwilldescribewhichindexofthearray
holdstheparameterandthevaluewillbethemaximumvalueitself.
averagecalculatesaveragevalueofallelementsfromthearray.
sumcalculatessumofallelementsfromthearray.
variancecalculatesthevarianceofallelementsfromthearray.

Version2.1

Page26

Classification
Classification is a procedure to count the values from the channel and assign them to classes. A
classicalclassificationfromtheprimaryschoolistocreatetheclassesandcountnumberofstudent
withspecificweightorheight.
Classification in measurement field is used for various applications, for example to find the
distributionofpowergridfrequencieswithtimeortofindthedistributionofsoundlevelstowhich
certainareaorworkingplaceisexposedto.
Firstofallweneedtodefinewhatwillbetheresultofclassification.Therearetwooptions:
singlevaluebased:theresultwillbeonearrayholdingtheresultoftheentirerun;
blockbased:theresultwillbesetofarrayeachoneaddedattheendofdefinedblocksize.Ifwe
have for example 2 seconds block size and acquire data for 10 seconds, we will get 5 arrays of
classificationvalues,eachvalidfor2secondsofdata.

Show class as a separate channel option will create single value channels for each of the class
element.Thisisaniceoptiontodisplaythevaluesinthemultimeter.

Forclassdefinitionweneedtosetthe:
lowerlimit:thiswillsetthelowerlimitforstartcountingallvaluesbelowthislevelwillbecounted
inthefirstclass;
upper limit: this will set the upper limit for end of counting all values above this level will be
countedinthelastclass;
class count: defines the number of classes. In the example above the width of each class will be
5/20=0,25.Firstandlastclasswillhavehalfwidth,soitwillgofromfrom0to0.125.Secondclasshas
amiddlevalueof0.25anditgoesfrom0.125to0.375andsoon.

Histogramtypedefineswhatwillbetheoutputofthedata(amplitude):
absolute count: each class value has the number of samples within the class (value will always
countup);
relativecount:eachclassvaluehasthevalueofsampleswiththeclassnormalizedtototalnumber
ofcountedsamples(sumofallclasseswillbealways1);
relative count [%]: same as relative count, but expressed in percent (sum of all classes will be
always100);
density: provides empirical probability density each class value has the number of samples
normalized to total number of samples and divided by class width. In this case the value is not
dependingonnumberofclasseswithinarange;
density[%]:sameasdensity,butmultipliedwith100;

Version2.1

Page27

distribution: provides empirical probability distribution, each class value has the sum of all lower
classesandthenumberofcurrentsamples,normalizedtototalnumberofsamples.Thehighestclass
hasthevalueof1.
distribution[%]:sameasdistribution,butexpressedinpercentage.Thehighestclasshasthevalue
of100.

Therearealsoseveralspecialoutputchannelsavailable.Twoofthemareskewness(asymmetryof
probabilitydistribution)andkurtosis(measureof"peakedness"ofdistribution).Additionallywecan
outputalistofdistributionpointvalues.Distributionpointsaretheclassvaluesatwhichdistribution
reachesenteredvalue.
Forthemomentthedistributionpointsworksonlyifdistributionischosenasthehistogramtype.
Histogramscanbeseeninthe2Dgraphduringmeasurementandanalysis.Ifwechooseblockbased
calculation,wecanusealso3Dgraphtodisplaythehistoryofclassifications.

Version2.1

Page28

Counting
NewCountingmodulecanbeaddedontheDEWESoftMathsetupscreenbyselectingaddCounting
mathbuttonfromStatisticgroup:
Countingisthestandardproceduretoreduceamountofdataforanalysis.Itisforexampleusedin
applicationofroadloaddatacollectionwherewehavesomestaticloadandontopdynamicload.
Theonlyinterestingvaluesaretheheightofloadcyclesandtheaveragestaticloadofthatcycle.For
thatpurposetherainflowanalysisismade.

The counting procedures counts the peaks and valley of the signal. The Hysteresis is defined in
percentageofclasswidth.Thispreventstoomuchfalsecountsifthesignalisnoisy.

Therearethreepossibleoutputvalues(normalization:
absolute:itoutputsnumberofcyclesasavaluevalueswillincreasewithtime;
relative:itoutputsthenumberofcyclesnormalizedtoabsolutenumberofcyclessumofallvalues
willbealways1;
relative [%]: it outputs the number of cycles normalized to absolute number of cycles multiplied
with100sumofallvalueswillbealways100;

Thereareseveralcountingmethodstochoosefrom:
peakcounting:countsthenumberofpeaksinthesignalincertainclasses(forthisoptionwecan
definetocountpeaks,valleysorboth);
range counting: counts the range between successive peaks and valley pairs. Ranges are positive
whenslopebetweenpeaksandvalleysispositive.Wecanchooseeithertocountpositive,negative
directionsorboth).
levelcrossing:countsnumberoftimeswhenthatsignalcrossesvariouslevels.
rainflow 1D: counts range pairs. Rather than counting the peaks it splits the signal variations to
smallerandlargerpairsofvaluesandcountsallofthemindependently.
rainflow2D:sameprocedureasabove,butitalsocalculatestheaverageofeachcycleandcreates
matrixofaveragevs.peakpeakvaluevs.numberofcycles.

Firstfouroptionsoutputs2Dmatrixwhilethelastoneoutputs3Dmatrix.

Version2.1

Page29

For all options we have to define the number of classes for average value, minimum and the
maximumorwechoosetodefinetheminandmaxvaluefromtherangeofinputparameters.
For2Drainflowwehavetodefinetheseparametersalsoforthethirdaxiswhichcountspeakpeak
value.
Thepeak,range,leveland1Drainflowcanbebestseenin2Dgraphwhileweneedtouse3Dgraph
forrainflow.

Correlation
Correlation is used to calculate autocorrelation function, crosscorrelation function and also the
cepstrumofasignal.Asthecalculationisdoneinfrequencydomain,alsoFFTparametersmustbe
setup.

Version2.1

Page30

Referencecurves
Referencecurve
Thiscurvecansimplybesetupbyenteringvaluesintothetableshown,thetimeinsecondsintothe
firstcolumn,thecorrespondingvalueintothesecond.

Theresultingdatacanthenbeusedforcalculationordisplay(seescreenshotbelow).

Hint: These values can also be entered by copy and paste, but the header row (first row) must be
identicaltotheoriginalversion.Rightclickontothetitleroworanywhereinthewhitefieldandcopy
the value table, then paste it into Excel, for example, add or edit the values, copy to clipboard and
now paste into the reference curve table (be sure to leave the header row untouched and also to
includeitintheselectiontobecopied).
t[s]

Value
1

Version2.1

Page31

XYreferencecurve
For this curve x and corresponding Y values are entered into the table (or pasted of course), but
additionally XandYchannelsmustbedefined tocomparethereferencecurvewith.Asoutputwe
getvalue0,dependingifthereferencelimitisexceededbytheinputchannelornot.

Hint:
Thereisanotheradvantageofthereferencecurve.Theoutputchannelgivesthevalueof1whenthe
xy curve crosses the reference curve. This can be used for trigger criteria or for counting of events
(withECNTfunctioninformulaeditor).

FFTreferencecurve
This is very similar to the above function, but here the frequency value and the corresponding
amplitudeareenteredforreference.Again,theoutputdelivers0and1,dependingonthechannel
value exceeding the reference limit or not. Additionally FFT parameters must be entered, as the
calculationisdoneinfrequencydomain.
Constant
Alsohereavaluetableisentered,whichcanbeusedforcalculationordisplay.

FREQOther
Exactfrequency
As the name suggests, this function is used to calculate the exact frequency of a signal. Even with
lowersamplingrateswhich doesn'tallowmethods likeperiod measurement andevenwithsignals
withnotthatclearlevelcrossingthismethodwillworkverynicely.
The method is based on finding best fit to the theoretical sine wave. It can measure millihertz
accurate with sampling rates only few kHz and a low block size. The method works best on the
signalsclosetothepuresinewave.Itwillsearchandlocktothehighestharmoniccomponentinthe
signal.

Version2.1

Page32

CAnoise
CAnoiseisaspecialcalculationwhichcanjudgethenoiseresultingfromtheengine,basedonthe
measurementofthecylinderpressure.

Envelope
Envelope detection is a procedure for early detecting of faults on ball bearings (but of course any
signalcanbeinputforenvelopedetectionfordifferentuse).
Delaychannel
With this function, a signal channel can be delayed by a specified number of samples or time in
milliseconds.

Version2.1

Page33

Triggering
Latchmath

Thelatchfunctioncanholdavalueifatriggerconditionismet.
Soifthecriteriachannelexceedsthesetcriterialimittheinputchannelswillbelatched.
Herethelatchcanbedoneinvariousmodes.

Actual:
IfcriteriaismettheACTUALvalueatthattimeistaken.
Average:
IfcriteriaismettheAVERAGEvalueistaken.Thecalc.timecanbeset(TimeBase)in
sec.
RMS:
IfcriteriaismettheRMSvalueistaken.Thecalctimecanbeset(TimeBase)insec.
ACRMS:
IfcriteriaismettheACRMSvalueistaken.Thecalc.timecanbeset(TimeBase)in
sec.

ACRMSwillcalculatetheRMSonlyontheACpartofthesignal.DCcomponentsare
not

takeninaccount.
Maximum:
If criteria is met the Maximum value is taken. The average time can be set (Time
Base)insec.
Minimum:
IfcriteriaismettheMinimumvalueistaken.Theaveragetimecanbeset(TimeBase)
insec.

Info:Theaverageistakenalwaystheaveragetimespanbeforetheevent.

Version2.1

Page34

Anglesensor
The input for the angle sensor math can be any analog trigger signal (like tacho 1 time per
revolution or automotive 602 sensor). In both cases we need some mathematic to calculate the
currentangleandthefrequencyofincomingsignal.Inbothcasesthesignalneedstobeconnectedto
analoginputoftheinstrument.Thenweneedtoselectthissignal,selectthesensortypefromthelist
ofavailablesensororbydefininganewsensortypeinthecountersensorform.Nextwecansimply
pressFindfunctiontodeterminethetriggerlevels.Inmostcasesthisfunctionworksalready,butin
some cases we need to define the trigger levels manually by settings the Trigger level and
Retrigger level input field. Next we can define the Retrigger time. This is a hold off in which the
signalisnotcheckedfortriggers.Thisisusefultopreventtriggerglitches.
Thegraphbelowshowsa602signalandcorrectlydetectedangleandtrigger.

Scopetrigger
Scope math is intended to extract matrix channel from the scope trigger shots on which the math
functionscanbeperformed.Wewillgeteitheralastshotorthehistoryofscopetriggeredshots.

ForthatweneedtodefinethetriggerTypewhichhasthesamemeaningasonthescopeinstrument:

normalonlyoutputascopeshotwhenarealtriggeroccurs,
autoiftriggerisnotfound,outputcurrentvalues;
freerunoutputsscopepicturesregardlessofthetrigger;
singleshotoutputsonlyatfirsttrigger

Unitdefinesthexscaleunitseitherinmilisecondsorsamples.

Version2.1

Page35

Triggerchanneldefinesthechannelfortriggeringtheshots.Wecanoutputmanydifferentchannels
(definedontheleftupperside,buttriggerchannelcanbeonlyoneforall).
Show history defines if the output is single channel (always overwritten with latest data) or if the
entirehistoryisputintothechannels.
Skiptrig.inposttimedefinesifthetriggersaresearchedalsowhenposttimeisrunning.Ifyes,data
couldoverlap.
Then we define pre and post time in the chosen units to cut out a time window from the original
signal.
Triggersettingsarethesameasinnormalscope,alarmsorstoringtriggers.

Spectralanalysis
FFTFastFourierTransformation
WhenyoupresstheSetupbuttononFFTanalysismathitem,thefollowingsetupwindowwillopen:

Output of the FFT analysis could be complex (real, imaginary), amplitude or phase or any
combinationofthat.
Calculation type can be overall (averaged), where the result is one spectrum for entire record.
Secondoptionisblockhistory,wheretheFFTsareacquiredshotbyshotandputintothebuffer.In
thiscasetheycanbeobservedon3Dgraph.Numberofaveragescanbealsoset.Whenweentera
valueofn,thenitwillcalculateaverageofnspectrumandputresultinthechannel.
Manual history count can override the normal settings for the number of shots to be kept in the
memoryduringmeasurement.
Severalcalculationparameterscanbealsoset.Oneofthemiswindowtype,whichdescribestheFFT
window.Thereisagooddescriptionofusageofdifferentwindowfunctionsinthetutorial.Bydefault
we use Blackman, because it is a good compromise between amplitude error and width of side
bands.

Version2.1

Page36

NumberoflinesdefinesthesizeoftheFFT.Morelineswechoose,moreaccuratethefrequencywill
be,butalsolongertimeisneededforcalculation.Numberofsamplesneededisalwaystwiceofthe
sizeofresultingFFT(numberwhichisset).

Importantnote:ANYnumberoflinescanbeentered,notonly2^n.Wecanmanuallyenter2000or
10000 FFT lines. The only drawback is that the calculation will get slower if we choose strange
numbers(like12431).

Amplitudetypedefineswhatkindofamplitudeisputinthechannel.Wehaveseveraloptions:
Amplitudetype

Units

Description

Amplitude(Auto)

isthepuresignalamplitude

RMS

Vrms

istheRMSamplitude,calculatedasAmplitude/sqrt(2)

Power

V*V

calculatedasRMSvaluesquared

PSD

V*V/Hz

calculated as RMS squared, divided by the line resolution


andsqrt(2)usedforcheckingthenoise
RMSSD
V/sqrt(Hz)
calculatedasRMSvalue,dividedbythesquarerootofline
resolutionalsousedforcheckingthenoise
DCcutoffoptionwillremovethestaticoffsetfromtheFFT.Ifitissettonone,itwilloutputFFTas
calculated,ifnot,itwillcutthenumberoflinesuntilfrequencywhichisdefinedisreached.
OverlapdefineshowmuchtwoFFTshotswilloverlapbetweeneachother.50%isenoughthatallthe
sampleswillhavesameweightontheresultindependantofthewindowwhichisused.
WeightingdefineswhichsoundweightingshouldbeusedontheresultingFFT.

Hint:
AsallmatrixchannelsalsoFFTcanbebestseenon2Dgraph.BlockbasedFFTcanbealsoputinthe
3Dgraphforviewingthehistory.

STFTShortTimeFourierTransformation
ShorttimeFouriertransformationistheprocedurewhichcalculatesmorelinesthanthenormalFFT.
ThisisachievedbyhavingsmallerrealblocksizeofdataandlargerFFTsize.Realdataiswindowed
andzeropaddedandthenFFTiscalculated.WiththisprocedurewecancalculatemoreFFTsforthe
sametimebase.Itisnicetobeusedwithfasttransients.

Version2.1

Page37

CPBConstantPercentageBandwidth
Abandpassfilter,whosebandwidthisaconstantpercentageofcenterfrequency.1/3octavefilters,
includingthosesynthesizedinDSAs,areconstantpercentagebandwidth.
Herewecanselecttwooptions:

Synthesized
Here the filters are calculated in frequency domain, which gives very exact filters, but at the same
timepoorupdaterates,duetowindowingandthebigcalculationcostbehind.

TrueOctave(ANSI,IEC)
Thisisatimedomainmultibandfilter,asisdemandedbythestandards,whichisveryfast,butnotas
exactastheabovefrequencydomainfilter.

Rosettes
Thisfunctionalityisusedforstraingaugesinspecialgeometricarrangement.

Theoutputchannelsrepresentthefollowingmeasurementdata:

Diam:averagestress
Rayon:maxshearstress
EpsMax:maxstress(angledirection)
EpsMin:minstress(angle+90direction)
Angle:angleofmaxstress

Version2.1

Page38

DEWESoft7.1newfunctions
Complex

Value.rerealpartofcomplexdataset
Value.imimaginarypartofcomplexdataset

Arrays

[]:'Data'[Idx]returnsonevaluefromarraychannelDataatindexpositionIdx
{}:'Data'[Pos]returnsonevaluefromarraychannelDataatpositionPosinaxisunits
[0:1]: 'Data'[N:M] returns a cutout array of array channel Data, from index position N to index
positionM,where0isthefirstvalueandlen1isthelastpossiblevalue.
{N:M}: 'Data'[N:M] returns a cutout array of array channel Data, from position N to position M,
accordingtoaxisunits.
min:min('Data')returnsminimumvalueofarrayData
max:max('Data')returnsmaximumvalueofarrayData
avg:avg('Data')returnsaveragevalueofarrayData
sum:sum('Data')returnsthesumofallvaluesofarrayData
integrate:integrate('Data')returnsintegratedarrayofarrayData
minind:minind('Data')returnsindexofminimumvalueofarrayData
maxind:maxind('Data')returnsindexofmaximumvalueofarrayData
minpos:minpos('Data')returnthepositioninaxisunitsofminimumvalueofarrayData
maxpos:maxpos('Data')returnthepositioninaxisunitsofmaximumvalueofarrayData

Tocutoutanarrayfromthefirstvaluetoindex100ortocutoutfromindex150totheendusethe
followingsyntax:
'Data'[:100]
'Data'[150:]

Version2.1

Page39

Matricestwodimensionalarray
The same operators as for arrays can be used, but must be used twice here, one time for each
dimension.Topickthewholedimensionanotheroperatorisintroduced,seeexample:

Topickthe10thlineofamatrixusethefollowingcommand:
LineX10:
'Matrix'[10][:]

Tochooseanareafromamatrixandcalculatetheaveragevalue:
Area:
'Matrix'[10:20][40:60]
Average:
avg('Area')

Also here shorthand notation can be used. To pick an area from index zero to 100 in the first
dimensionandfromindex200toendinthesecondusethefollowingcommand:
'Matrix'[:100][200:]

Version2.1

Page40

MATHEXAMPLES
Formula
Function:MOD/TRUNCExample:SeparateCANGPSSignaltoDEG:MIN,xxx
TRUNC:
convertsanumberintointeger

Trunc(1452.457)=1452

Example:TheVGPSLongitudeandLatitudesignalsreceivedovertheCANBus should be separated


intoDEG:MIN,xxx.TheCANdataisreceivedinMINlikeitisshownbelow.Withmathfunctionsthe
regularGPSdisplayshouldbeproduced.Belowtheresultisshown.

MATH: trunc('Latitude'/60) dividing by 60 will convert it from minutes to deg, where the trunc
functionwilleliminatethedigitsafterthecomma. result[]

(('Latitude'*100000)mod6000000)/100000willprovidetheminutesandtheremainder.

Because the MOD function only delivers the remainder as an integer, we have to multiply the
latitudewith100000anduseMODwith60*100000=6000000,thendividetheresultagainwith
100,000togettheresult.

Function: MOD / TIME Example: Show actual value averaged every 10s in a list and
exportittoExcel.
isprovidingtheelapsedtimeofthemeasurement.
TIME:

MATH:
(TimeMOD60)

Thiswillcreateasawtoothwithaperiodtimeof60s.Looktothepicturebelow.Thisischannelwill
beusedaseventchannelintheLATCHmathtoaveragetheactualchannelandshowitinalist.The

Version2.1

Page41

averaged values could be exported to Excel or TXT asynchronously. To export it asynchronously @


Exportonlytheasynchronychannelshavetobeselected.

Function:SCNTSampleCounterExample:CreateAngleSignal
SCNT: deliversthesamplesacquiredfromstartofthemeasurement.

Thecounterwillberesetatthestartofstoring.
MOD: deliverstheremainderofadivision
420MOD720=420
740MOD720=20
Example:
IfexternalclockingisusedandthesignalwillbeshowninananglebasedXYdiagram,
withtheMODfunctionwecancreateananglesignal.

Letsassumeweareusinganencoderwith720pulses/rev.

MATH:
SCNTMOD720willdeliverasawtoothwhichrunsfrom0to720.
Togettheanglewehavetomultiplyitby0.5deg,soattheendwegetthisformula:
SCNT MOD 720 *0.5 this channel can be used in a XY diagram to show the result
anglebased.

The only disadvantage will be, if we get wrong pulses from the encoder (i.e., noise or spikes), the
anglesignalwillshift.

Version2.1

Page42


IfaTRGpulseisalsoavailable,CLKandTRG,thissignalscouldbealsoroutedtoanOrionCounter,
where this is eliminated. Because the TRG PULSE will reset the counter every revolution. So a
hardwarecounteronanORIONA/Dcardwilltypicallyyieldbetterresultsthansoftwarefunctions.

Function:StopwatchExample:Velocitywithtwolightbarriers
STOPWATCH:
STOPWATCH(Condition1,Condition2)measuresthetimein[s]betweencondition1
andcondition2.Conditionisalogicvaluethatjumpsfrom0to1(edgesensitive)

Example:IfthedistancebetweenthetwolightbarriersisknownasDistancetheaveragespeedof
anobjectpassingthelightbarrierscouldbecalculated.

MATH: Distance/stopwatch('Start'>0.5,'Stop'>0.5)
StartandStopcouldbeanalogordigitalsignal.Thelogiccomparison>turnstheconditionintoa
logicvalueanyway.Insteadof0.5therecouldbeusedanylogicaltriggerlevel.Alsofordigitalsignals
thecomparisonisrecommended.

Version2.1

Page43

Function:HOLDExample:RemoveoffsetfromaChannel

HOLD:
HOLD(channel,condition)Willlatchtheactualvalueofthechannelifcondition

becometrue.

MATH:
'pressure'hold('pressure',keypressed(49)>0.5)

Theactualpressurechannelissubtractedwiththevaluelatchedintheholdfunction.
The hold function will latch the actual pressure if the second statement
(keypressed(49)>0.5)becometrue.

Soevenduringthemeasurementaoffsetcompensationcouldbedonebypressingaspecific
key.Thepicturebelowisshowinganexample.Thekeypressed(49)channelisindicatingthe
pressedkey inanadditionalmathchanneltomakeitmoreabvious.

Version2.1

Page44

Function:KEYPRESSED/LATCHExample:LatchValueintoList

MATH: keypressed(49) produces signal from 0 to 1 with a duration of 1 sample if [1] Button is
pressed.ThiscouldbeusedinthelatchMathtolatchtheactualoraveragevalueofanother
channel(s)inalist.

Version2.1

Page45

Triggereventishighforspecifiedduration
Ifwehaveatriggerpulseofanykindwithashortduration,wecancreateasignaloutofitthatis
highforaspecifiedduration(here1s)withthefollowingformula:
edge(Trigger,timehold(time,Trigger)>=1)

Decodelogicalsignalforpositiveandnegativesigninmathematics
Alogicalsignal(0or1)isusedtocodethepositiveornegativesignofameasurementchannel.

SigSignLogical=0

negativenumber

SigSignLogical=1

positivenumber

Torecreatethesignaltogetherwiththecorrectsignusethefollowingformula:

SigSign=2*SigSignLogical1

SigSignLogical=0

SigSign=1

SigSignLogical=1

SigSign=+1

Thisnewsignalcannowbeusedasafactorforcalculationtogetthecorrectsignedchannelvalues.

Version2.1

Page46

Dutycyclecalculationslowsignals(pulsewidth,stopwatchfunction)
Iftheanalogsignalcycledurationisverylong,theabovecalculationwillnotworkanymore.Sohere
isanotherpossibilitytocalculatedutycyclepercentage.

Firstwedefineatriggervalueforthestartofaperiodandcreateapulseoutofit.
(trigcycle)
edge('AI0'>12)

Wealsoneedatriggerforthestartofthenegativehalfcycle.
edge('AI0'<12)
(trignegativehalfwave)

Nextwemeasurethetimeofthelastwholecycle(betweenstartofperiodtriggers).
pulsewidth('trigcycle')
(timewholeperiod)

Anothertimeismeasured,hereitisfromstartofperiodtobeginningofnegativehalfwave,which
givesthetimeofthepositivehalfwave..
stopwatch('trigcycle','trignegativehalfwave')
(timepositivehalfwave)

Finally,theratiobetweenthepositivehalfcycleandthewholecycleiscalculatedandmultipliedby
100 to get percentage, also the hold function is used for the value to only be updated after each
wholeperiod.
hold('timepositivehalfwave'/'timewholeperiod'*100,'trigcycle')

Version2.1

Page47

Dutycyclesignalgenerator(mod,scnt)
Fortestinglotsoftimesweneedasquaresignalwithadutycycle,whichcanbesetup.
Webeginbyenteringparameters(ofcoursethiscanalsobeassignedtovisualcontrols):
frequency,dutycycle percentageofthefirsthalfperiod,amplitudeandaswitch(0or1)todefine
signaltogroundorpeakpeakamplitude.
Thefirstcalculationgivessamplesper1rotation.

sr/'input_freq'
(samplesper1rotation)

Nowweneedananglesignal,whichisresetafteronefullperiod.
scntmod'samplesper1rotation'
(angle)

Nextwecalculatetheanglevaluelimit,wherethenegativehalfcyclestartsoutofgivendutycycle
percentage.
'input_firstdutycyclepercentage'/100*'samplesper1rotation'
(limit)

Wethencreatetwooutputsignals,firsttheonetoground.
if('angle'<'limit','input_amplitude',0)

(out_toGnd)

Andthepeakpeaksignal.
(out_peakpeak)
if('angle'<'limit','input_amplitude','input_amplitude')

Finallywechecktheinputparameterandselectoneoftheseasoutput.
if('input_IsPeakPeak'=1,'out_peakpeak','out_toGnd')

Stopwatchtriggeredbyevent(keypressed)
Createastopwatch,whichisstartedandstoppedviakeypressduringmeasurement.

Weneedthekeypressedeventforthis,buttogetherwiththeedgefunction,tosuppressretriggering
ofstarteventandtoholdthevalueuntilthestopbuttonispressed.
Forthestartstopwatchkey:
edge(keypressed(37),keypressed(39))
(keystart)

Andofcoursealsoforthestopkey:
edge(keypressed(39),keypressed(37))
(keystop)

Themathfunctionstopwatchcanmeasuretimebetweentwodifferentchanneledgesandthisis
exactlywhatisneededhere.

stopwatch('keystart','keystop')

Version2.1

Page48

Countpulsesthatarelongerthanaspecifiedduration
Toonlycountthepulses,whicharelongerthan30mswecreateadigitalsignalwithathresholdof
abouthalfthepeaksignal,togetaniceedge.
'pressure'>=500

(pressure_digital)

Wealsowanttospecifyalimitforthepulsewidth,andonlyifthislimitisexceededalogicalsignalis
high.
pulsewidth('pressure_digital')>=0.03
(pulsewidth_ok)

Whatweactuallyneedisthesignaltobehighandthelimitconditionshouldbemet.
'pressure_digital'AND'pulsewidth_ok'
(signalhighandlimitmet)

Allthatislefttodonowistocountthegoodpulses.
ecnt('signalhighandlimitmet')

Version2.1

Page49

Measurement(tn)Measurement(tn1)prevfunction
Herewetakeananalogtestsignalandwecreateatriggerevery2seconds:
timemod2=0
(trig)

Thenlatchmathisusedtocreateanasyncchannelateverytriggerposition.

Tocalculatetheactualvalueminustheprevious(async)value,usethefollowingformula
'sig/Latch'prev

Noticethatwechooseasynctimebaseandthereferencechannelisthelatchedsignalnow(see
screenshotbelow).

Version2.1

Page50

Logicaleventcounterwithtworesetconditionslogical,keypressed,storingfunction
Astestsignalweuse
(trian(1))/2
(Rect)

Thelogicalconditionis

'Rect'>0
(Condition)

Thisistheeventcounterhowoftenthelogicalconditionismet
ecnt('Rect'>0)
(Zerocrossingcount)

Alsosamplesarecountedwhileconditionismet
icnt('Rect'>0)
(Samplesabovezero)

Zerocrossingwithkeyreset:

'Zerocrossingcount'hold('Zerocrossingcount',keypressed(32)>0.5)

Zerocrossingwithstoringreset:

'Zerocrossingcount'hold('Zerocrossingcount',storing>0.5)

Note: storingis1aslongasdataisbeingstored,0otherwise

triggivesjustonepulseatthebeginningofstoring

Version2.1

Page51

Filters
Function:Acceleration velocity displacement

Veryoften,accelerationmustbeconvertedtovelocityordisplacement.Thisisdonewithintegration
ordoubleintegration.Buttodoitright,weneedtostartatthebeginning:thescaling.

1.)Sothescalingisdoneeitheringorm/sintheanalogsetupof
DEWESoft,wherethemeasurementchainstarts.

Velocity
2.)Wehavetoapplytheaccelerationchanneltoasingleintegrationtogetthevelocity.Thiswillbe
foundintheIIRfiltersMATHfunction.

Ifanintegrationisdoneonlowfrequencies,orsignalswithastaticoffset,thiswillproduceincorrect
results.ThereforetheintegrationfunctionhasantheoptiontofilterlowfrequenciesandzerooutDC
components (offsets). In this case, a 3 Hz Fourth order high pass filter is used which gives reliable
resultsonmostoftheapplications.

The unit should be m/s, and


becausetheaccelerationisscaledin
g we have to add an additional
scalingfactor9.81.
Iftheaccelerationwouldhavebeen
scaled in m/s in the analog setup
thescalingfactorisnotneeded.
Incasemm/sisneeded,either9810
or1000hastobeenteredasscaling
factor.

Version2.1

Page52

Displacement
3.)Togetdisplacementwehavetousthedoubleintegration.Alsotherethehighpassfilterwillbe
needed,toavoidwrongresultscausedonlowfrequenciesanddcoffset.

4Hz4Orderwillgivereliableresultsonmostcase.Ifnotthefilterhastobesethigher(5Hz).

Mostofthetimethedisplacement
isneededinum.Sothescalefactor
has to be set depending on the
analogaccelerationscaling.

In this example the input was


scaled in g, take a look to the
picture above, so to get um we
havetoenterascalevalueof
9810000or1000000iftheinput
wouldhavescalinginm/s.

Note:Asdescribedabovewehavetouseahighpassfiltertoavoidincorrectresults.

Alsobeawarethatbelowthehighpassfilterfrequency,theoutputwillbeattenuatedbythe
filter.
Soexactreadingswillbeonlyavailable@frequencieshigherthanthehighpassfilter.
Thisisthecaseforbothdisplacementandvelocity.

Ifdisplacementisneededbelowthisfrequency,itispreferabletouseadisplacementsensor
inthefirstplaceandnotusesoftwarefunctions.

Version2.1

Page53

Statistics
Function:AverageExample:RemoveoffsetfromchannelPOSTProcessing

Above,runningisselected.
CalculatestherunningaverageoveraBlocksizeof0,1s.
Average:

Example:
An analog channel with an offset should be recalculated in Math. The first 0,2
secondsofthesignalshouldbeaveragedandusedfortheoffsetcorrection.Belowtherawsignal
fromthesignalisshown.

MATH:
'Force'hold('Force/AVE',time>0.2)

Force/AVEistherunningaveragecalculatedoutofthestatistics.Thiswillbelatched
if the time (reflecting the actual time in the dataset) is higher than 0.2 seconds, the hold
function will latch the average and subtract it from the force. The result is shown in the
picturebelow.

Version2.1

Page54

RMSandaveragevalueforspecificpartsofasignalchosenbycursor
Lets say we would like to cut out specific parts of a signal and calculate statistical values (RMS,
average)forthesecutoutparts.
ItispossibletoexportthezoomedinpartasanewDEWESoftdatafileanddothestatisticsforthe
wholenewfile.Buthereisamuchnicerapproach:
InMathwecreatethefollowingformulasandabasicstatisticschannel:

Timechannel:
time
Triggerchannel:
emptyfornow
Basic statistics (Start Stop blocks): As a start trigger we select the newly created trigger
channelwithpositiveedgeand0.5triggerlevel,thesamewithstoptrigger,exceptherewe
usenegativetriggeredge.

Version2.1

Page55

InAnalysismodeweaddarecorderwiththesignalwewanttoanalyseandthemathtimechannel.
Weenableshowcursorvaluesforthevisualcontrolandarenpwabletoselectaregionwithcursor
1and2.Thetimeinsecondsatthesetwocursorpositionsisdisplayednowsothetriggerchannelcan
nowbedefined.

Triggerchannel:

(time>1.2)and(time<2.1)or
(time>5.34)and(time<7.76)

Toaddanothertriggerfortheactualtimerange,justaddthefollowingtothetrigger
channelmath:
or(time>9.66)and(time<12.18)

Forthisyoudonthavetoswitchbacktosetupandmath,justusethecontextmenu
(rightclick)ofthetriggermathchannelinanalysismodeandpickEditFormula(see
screenshot).

Version2.1

Page56

Peakholdfunction
Todisplaythepeakvalueofthelastperiod(seepicture,noticethesmalldelaybetweenactualpeak
andpeakfunction)thefollowingmathfunctionscanbeused.

Firstweneedatriggersignaleverysignalperiod.
'testsignal'>0

Thenweusethebasicstatisticswiththetriggeredblockssettingandtheabovefunctionastrigger
channel,withtriggerlevelsetto0.5.

Version2.1

Page57

Peakholdfunctionatexactpeakposition
Wehaveseeninthepreviousexample,thatthepeakvalueisheldafteronefullperiodofthesignal.
Fornowwewouldliketogetamoreexactresult,exactlyatthepositionofthemaximum(peak).

Wewouldliketotriggerevery0.5seconds.
scntmod(sr/2)=0

(trigger)

Nowweaddthescopetriggerfunctiontotriggerontheinputsignalwiththeabovetriggerastrigger
channel,0.5asthresholdlevelandhistorychecked.

Arraystatisticsdeliversthemaximumvalueofanarray,butalsotheposition,wherethismaximum
lies(relativetothelasttrigger).

Aswegetatriggereveryhalfsecond,wecancalculateelapsedtotaltimewiththisformula.
ecnt('trigger')*0.5

(elapsedtimetriggers)

Togettheoffsetfromlasttriggerpointinseconds,weusetheMAXCLASSresultfromaraystatistics
togetthesamplebasedindexanddividebysamplerate.
'signal/DataHistory/MAXCLASS'/sr
(timepositioninscopetrigger)

Fortheexactpositionofthepeakvalue,wethensimplyaddthosetwotimes.
'elapsedtimetriggers'+'timepositioninscopetrigger'

Version2.1

Page58

Hint:Thedisplaystillshowsthepeakvalueattheendofoneperiod,butfromarraystatisticsweget
notonlythepeakvalue,butalsotheexactposition(shownatthebottomright).

HowtostartAverageblockexactlyfromtriggerevent
Forthiswechoosethemathfunctionbasicstatistics,averagewithoptiontriggeredblocks,butfirst
weneedatriggersignal,whichcanbeanythingwecangetanedgefrom;herewejustuse
edge(keypressed(32))

Nowwecansetupthestatisticswiththetriggersignal,simpleedgeandtriggerlevelat0,5,asitisa
logical(highlow)signal.

Statisticscalculationisnowdoneexactlybetweenthelasttwotriggerevents.

Version2.1

Page59

ReferenceCurve
Function:Createareferencecurve,withrestartpossibility.

Example:Thetargetistocreateafreedefinablereferencecurve,withthepossibilitytorestart.

Herethereferencecurvefunctionwithreferencechannelisused.
Belowyouwillseeareferencecurvewithisrelatedtoasecondchannelcalledx_base.
Soifthex_basechanneldelivers2theoutputwillbe2,iftimedelivers6theoutputwillbe
4,andsoon...

Nowletshaveacloserlookatthex_basechannel,whichiscreatedinamathformula.

Formula:
time+100hold(time+100,keypressed(49))

Oneofthetargetwastostartandrestartthereferencecurveonanevent...whichcanbeakeyboard
event
oranyotherevent,likepressure<12bar.

Soletshaveacloserlooktothereferencecurve,after8sitwillbecome0.
Soatthebeginningthex_basechannelshouldstartwithavaluehigherthan8,sothattheoutputof
thereferencecurveis0.Thatissolvedbyadding100tothetimefunctionoftheformula(redpart).
Soatthebeginningtheformulawilloutput100andcountup,thereferencecurvewilldeliver0.

Thenextthingwouldbetostarttherefencecurvebyanevent.Thisisrealizedinthesecondpartof
the formula(green). If an event, (key pressed) will occur, (time+100) will be subtracted from
time+100.
Sothex_basechannelwillstartfrom0andthereferencecurvewillbeoutput.

Version2.1

Page60

HowtodisplayFFTreferencecurveinFFTdisplay
ForthistoworkweneedtocreateamathFFTreferencecurveandadditintotheFFTdisplay.

In the FFT reference curve setup, we define our signal channel as input. The table in the center is
used to enter the reference curve, by entering the frequency in the first column and the
correspondingamplitudeinthesecond(copyandpastecanalsobeusedhere).
Theoutputofthismathfunctionis0ifallsignalFFTpeaksarebelowthereferencethresholdand1if
apeakisoverthelimit.

TodisplaythereferencecurveintheFFTvisualcontroltogetherwiththecurrentFFT,usethecurve
tabinvisualcontrolpropertiesandselectthereferencesignaltobedisplayed.

Theoutputvalues0and1canbeusedtodisplayinformationinadiscretedisplay(addindicator
lampandchangeproperties),asdescribedinanearlierexample.

Version2.1

Page61

Other
Soundcarddemodetectpeakfrequencywithexactfrequency
We no use the onboard soundcard for demonstration of the FFT spectral analysis and the exact
frequencyalgorithm.Thetestsignalisahumanwhistle.
We have two possibilities to view a FFT analysis. The first is the display instrument FFT (visual
control) where we have the advantage to change FFT parameters during measurement or analysis
andtofindagoodbalanceoffrequencyresolutionandupdaterate.Additionalfeaturesherearethe
displayofRMSvalue,alistofmaximumpeaksandmarkedpeaks.However,itisnotpossibletodo
furthercalculationsortousetheFFTchannelinmath,asitisadisplayinstrumentonly.
ButwecanalsoaddamathchannelFFT,whichisthendisplayedina2Ddiagramandcanbefully
usedinmath,evenarraymathematicsandarraystatistics.
The picture below shows the FFT visual control to the left and the FFT math to the right with the
samesettings,andadigitalinstrumentdisplayingtheexactfrequencyofa nearsinewave (human
whistle).

Hint:
A slight difference between the two FFT displays comes from the way block averaging is done. The
display instrument tries to update as fast as possible and to reach the display update rate setup in
globalsettings,thereforeablockaverageisdoneasoftenasCPUpowerallows(overlapisveryhigh),
whileFFTmathdoestheblockaveragingassetupinthecontrolwithexactlytheoverlapthatisset
up.

Version2.1

Page62

Triggering
Multiplescopetriggers
Wewouldliketowatchtwosignalsintwoscopes,eachtriggeringtooneofthem.DuetoaDEWESoft
limitation only one trigger channel can be defined for scopes, no matter how many scope displays
areshownonscreen.
Thiscanbesolvedwithscopetriggermath.
Inscopetriggersetupselectallthechannelstodisplayandchoosethefirsttriggerchannelwithpre
andposttime.Addanotherscopetriggermoduleanddothesameforthesecondtriggerchannel.

Thefirstdisplayshowsthescopevisualcontrol,whichcanonlyhaveonetriggerchannelintotal.The
secondandthirdcontrolsare2Ddisplays,triggeringtothefirstandsecondchannel,respectively.

Version2.1

Page63

ScopeTrigger,Arraystatistics
The scope trigger math can also be used to show a triggered event every time the trigger level is
reached.Likeintheexamplebeforethetriggerlevel,preandposttimemustbesetcorrectly,then
the triggered signal of specified duration is saved in the history buffer. Statistical values are then
calculatedwitharraystatistics,likethemaximumvalueandmaximumpositioninmsorsamples.

Phaseanglefiringsimulation
Firstweneedasignaltoworksowecreateasinewavewith325Vpeak.
325*sine(50)
(sin)

Then we need angle sensor math to get one trigger per period. When we push Find the zero
crossingiscorrectlydetectedandretriggerlevelissetto162.5(325/2)ofthenegativewave.Using
theanglesensormath,wecanbesuretheanglesignalisnotdriftingawayfromthesignal.

Version2.1

Page64

Nowweneedalogicalsignalthatdependsontheanglewewillselectlateron.
if('sin/Angle'mod180<'angle',1,0)
(nulltrig)
Startingfromeveryhalfperiod,allvaluessmallerthananglearezero.
Anotherifconditionsetstheoutputsignaltozeroifaboveconditionistrueortotheoriginalsignal
otherwise.
if('nulltrig'>0,0,'sin')
(sinph)
AsalaststeptheRMSvalueforthissignalisthencalculatedbymultiplyingwithsquarerootof2:

'sinph'*sqrt(2)
Thepercentageoffullpower(230VRMS)isthencalculatedby

'sinph/RMS'/230*100

For RMS value and crest factor calculation we use basic statistics (displayed at the bottom left
corner)andforcomparisontheDEWESoftpowermodule(displayedatthebotoomrightcorner).
TheDEWESoftpowermoduleissimplysetupwithourphaseanglefiringsignal(withoutRMSfactor)
asasinglephasevoltageinput,asshownbelow:

Version2.1

Page65

Hint:
AsmalldifferenceinRMSvalueisOKhere,becausetheanglesensordetectionisnotperfectandthe
power module in general is more exact, as it uses internal resampling to optimize FFT for period
lenghth.

Countergametime,hold,keypressed,latchmath,if,round,mod,basicstatistics
HereisacountergamedonewithDEWESoftmath,justforfun.
Thegoalistopressthespacekeywhenthecounternumberisdividableby10.Inthedisplaywesee
therunningcounter,thelastvaluewhenthekeywaspressed,numberofvalues,aninfoboxwitha
text message, error of the last triggered value (how far from 10 is it) and the total error average,
finallyatableoverviewofalltries.

Version2.1

Page66

Formulasused:

runningcounter:

time*10
holdvaluebyformula:
hold('cnt',keypressed(32))
Toholdjustthelastvaluetheholdfunctioncouldbeused,buthereweneedavaluehistory,sowe
needlatchmath.

keyevent(forlatchmath)
keypressed(32)

latchmath:forlatchcriteriatheabovekeyeventchannelisused

labelvaluechannel:
if('Latchindex'>5,1,0)
Only5triespergame,infoshowsGameinprogressorgameover,dependingonlabelvalue.

Hereisthecorrespondingvisualcontrol,discretevaluedisplay(indicatorlampfrommenu,change
todiscretevaluedisplayinpropertiesdropdown):

tempvalue

round('cnt/Latch')mod10
Moddeliverstheremainderofadivisionby10here.

ifcondition

if('temp'>5,10'temp','temp')
Wewouldliketohavetheerrortothenearestnumberdividableby10,sothemaximumerroris4to
the next highest multiple of 10 or 5 to the next lowest multiple of 10. The corresponding math
functiondoesthefollowing:iftheremainderisbiggerthan5theresultis5remainder,elseitisthe
remainder

Addbasicstatisticswithaveragechecked,typeissinglevalue.

removedecimals
round('cnt/Latch')

Addvisualcontroltabularvaluesdisplay,unchecktimeinpropertiesandaddtheroundedlatched
channel.

Version2.1

Page67

Dutycyclecalculationfastsignals(withanglesensor)

Theanaloginputsignal(cyan)shouldbeanalysedintermsofdutycyclecalculation.
For this we need to find the period length, or more exactly the 360angle over one whole period
withtheanglesensormath,settoTacho(analog),positiveedgeandtriggerlevel0.
Atthestartofthenegativehalfcycleweneedtotaketheactualangleanddivideitby100%whichis
here360,finallymultiplywithfactor100togetthepercentageforthedutycycle.
hold('AI1/Angle','AI1'<0)/360*100

Theholdvalueistriggeredeverytimethetriggerconditionismet,soeverytimeanewnegativehalf
cyclestartsanewanglevalueiscalculated.

Version2.1

Page68

Spectralanalysis
Findharmoniccomponentsofperiodicsignal

If we have an unknown periodic signal, in time domain it is not always


possibletodistinguishoverlaidfrequencieswithdifferentamplitudes,butin
frequencydomainthesesignalscanbeviewedseparately.

Intheexamplebelowweseeanunknownperiodicsignalonascopedisplay,
which resembles a sine signal. If we have a look at it in frequency domain
with the FFT visual control, we see two different signals overlaid, with
differentamplitudes(seeFFTpropertiesontheleft).

CopyFFTspectrumtomatharrayconstant
If we need to use a spectrum for calculation or we would like to compare it to actual data it is
possibletoaddamathconstantinanalysismode.
The spectrum from FFT math (displayed with a 2D visual control) is copied by just rightclicking on
theinputchannelandchoosingAddmathandConstant.

Version2.1

Page69

Nowwegetanewmathconstant,whichcanalsobeusedforcalculation(arraymaths)orreference
invisualcontrols.

TobeabletocopythisconstantfrommathchanneltoExcelforexample,rightclicksomewherein
thechannelandchoosecopyselectedobject.

Hint:FromtheFFTvisualcontrolnodatacanbecopied.

Findharmoniccomponentsofnoisesignal(ifpresent)
Ifthereisalotofnoise,inscopeorrecorder(timedomain)weseenothingbutnoise.
Neverthelessaperiodicsignalmaybepresent,whichcanbevisualizedandmeasuredwithspectral
analysis.

To improve signal to
noise ratio we use
AveragedFFThere.

The lower graph shows the two periodic signals hidden under lots of noise in time domain, but
clearlyvisibleaftersameaveraging.

Version2.1

Page70

FFTaverageinmathprevfunction
WeuseananalogtestsignalandblockbasedFFTmathematics.

Next,wecreateanaveragecounter(Avecount)withformula:prev+1
(besuretoselecttheFFTchannelasasynctimebase,seebelow)

TheSumFFTchanneliscreatedbyentering:prev+'AI0/AmplFFT'

(noticethetimebaseissettoauto,whichisasynchere)

Finally,theAveFFTformulaisenteredas'SumFFT'/'Avecount'

ThisaverageFFTchannelcannowbeusedforfurthercalculations,suchasmaximumfrequency:
maxpos('AveFFT')

Version2.1

Page71

ComplexFFTextractrealandimaginarypart
Whenwehaveacomplexsignal,weusethemathfunctions.reand.imtoextractrealandimaginary
partsofthesignalforfurthercalculation.

WecreateablockbasedFFTinmathandcheckcomplexasoutputtype.

Fromthissignalwecannowextractrealandimaginaryparts,respectively.

'AI0/CplxFFT'.re

'AI0/CplxFFT'.im

Version2.1

Page72

DEWESoftGeneralhints
Hint:HowtoaddanaverageFFTtoadatafile
If you did not add an average FFT during measurement, it is a little tricky to achieve this later
(becauseyoucannotsimplychangetheFFTinstrumenttoAverageafterwards).

ButitcanbedonewithMATH
inpostprocessing!

Open the datafile (*.d7d) and add in the


ofline math a FFT function. This is listed
underthe6thmenupoint.
Choosethechannel,settheaverage
cyclesandtheresolution(lines).
We suggest a window overlap of
75%.
Quit with OK and go back to
Reviewtotheoverview.

Now the label of the button offline


math has changed to recalculate.
Starttherecalculation.

Depending on the channel


count, resolution and data
amount this can take a
littlewhile.

For the calculation


results in a matrix, the
instrumenttobeusedis
the2Dgraph.

Hint when scrolling


through:
in
the
overviewinstrumenton
top the yellow Tbar
shows the FFT window
size.

Version2.1

Page73

Hint:Nonlinearscalingofsensors
A linear sensor scaling can easily be done in the channel setup. How about correcting nonlinear
sensors?

ThiscanbedoneintheSensoreditor.

Sensorsarealignedingroups(e.g.Acceleration,Voltage,Current).

In the column Recal. Date


you will be remembered for
theannualcalibration.

We suggest to store the


sensors with the serial
numberforthecorrectidentifying.

ChangethescaletypetoLinear/Polynom/Tableandenteryourvaluesbelow.
Thesensoristheneasilyselectedinthechannelsetup.

Version2.1

Page74

Hint:Addnotesduringmeasurement
Ifyoupressthebuttonnduringstoringagreenmarkeroccurs.
AtthesametimetheEventwindowopensandyoucanenteryournote.

Youdonthavetohurrybecauseforthenotethetimeyoupressedthenkeyisstored.

Thisisthensavedtothedatafile.Placethemousepointerovertheeventandyouseethenote.

Version2.1

Page75

Hint:DownsizeDEWESoftdatafiles

DEWESoftexport>DEWESoft

ToreducethesizeofastoredDEWESoftdatafileyoucanforexampleexportonlytheinterestingpart
toanewDEWESoftdatafile.
Thereforetakearecorderinstrumentandselecttheareayouwanttoexportwiththecursors.Onthe
overviewinstrumentontopyouseetheselectioninrelationtothewholefile.

ThengotoExportandselecttheoptionDEWESoft.

Allchannelsareexported.

Thenewfileismuchsmallerandhasallthedatayouareinterestedin.

Version2.1

Page76

Hint:PortingDEWESoft6setupfiles(*.dss)toDEWESoft7(*.d7s)
One of the big advantages of DEWESoft7 is the open file structure. Lets have a look at a practical
example.
OpentheoldsetupinDEWESoft6.

NextsavethesetupasanXMLfile.

CloseDEWESoft6andopenDEWESoft7.
LoadtheXMLsetupfileinDEWESoft7,choseXMLasfiletype.

Hint:
You can also copy a whole
screenofinstruments.
Just right click on the
background and chose
CopyScreentoClipboard.

Now you can Paste all the


instruments to another
Screen such as Recorder,
Scope, feel free to make
yourownlayout.

Version2.1

Page77

Hint:Triggeronanoisysignal(filterededge)
Ifyouhavenoiseonyoursignalanduseatriggerlevel,itwilltriggermultipletimes.

TopreventthisthereistheoptionFilterededge.
Specifyarearmlevelwhichshouldbealittlebitbelowyourtriggerlevel.Thetriggerwillonlywork
again,iftheinputsignalfallsbelowtherearmlevel.

Version2.1

Page78

Hint:Keypressedeventasmanualstoringtrigger
Wewouldliketousethespacebartostartandstopstoringofmeasurement.
For this we need to create a trigger channel from the keypressed event, which is a simple math
formula:
edge(keypressed(32),keypressed(32))
keypressedgivesapulsewhenthespecifiedkeyispressed,edgetriggersontheflankandsincethe
sameinputisusedasarearmcondition,onlyeverysecondkeypresstriggersthesignaltohigh,every
otherresetstheinput.

Now all we have to do isdefine a start and stop storing condition in the menu. We pick our math
formulaasatriggerchannelanddefinetriggerlevelas0.5withapositiveedgeforstartstoringand
thesamewithanegativeedgeforstopstoring.

Thiswaywecanstartandstopourmeasurementbypressingspacebar.

Version2.1

Page79

Controlchannelvariableforcontrolbutton,sliderinput,
Controlchannelisafreeplugin(DLLintoAddondirectory).
Thechannelisaddedwiththeplussign,thenchannelnameanddescriptionisgivenandtheminand
maxvaluesaredefined.

IndesignmodethevisualcontrolInputcontroldisplayisadded,withthefollowingproperties:

Controlchannelisselectedandalsoheretheminandmaxvaluesareset.
Now the slider can be used to enter parameters for a control channel, which is also addressible in
mathandcanbeusedfor
further
calculations.

Another application is to use a control button as a trigger signal, which can also be addressed in
othermathchannels.
The control channel assigned to the button gives 1 when the button is pushed (yellow signal in
screenshot).Thissignalcanbeusedtogenerateatriggerpulsewiththeformula(greensignal):
edge('Control_button')

Togetanonoffsignaloutofthispulsesignal,whichishereusedfortheindicatorlampthefollowing
formulaisused:

ecnt('Pulse')mod2

Version2.1

Page80

Version2.1

Page81

DEWESoft7.1arraymath
DEWESoft7.1arraycalculationusedforFLIRinfraredcamera
TheFLIRinfraredcameraimageissavedasamatrix(2dimensionalarray)inDEWESoft.Depending
onthemountingofthecameraXandYaxiscanbeswapped,soherethedataXaxisisthevertical
axisinthe3Ddiagram.
Wewouldliketoseetwotemperaturelinesnow;onehorizontal,whichshowsall8hotICsandone
vertical.Forthisweneedtoextracttherightindexstartpositionandshowthewholearrayforthat
dimension,whichcanbedonewiththe[:]command.

MATH:
Line213X:
'FLIRA3X0'[:][213]
Line182Y:
'FLIRA3X0'[182][:]

Another application here would be to define an area for temperature averaging to smooth the
temperature responseclosetotemperaturegradients,ortoaverageoverlargerareas.Thiscanbe
donelikethis:

Area:
'FLIRA3X0'[170:190][200:230]
Average:
avg('Area')
Maximum:
max('Area')

Version2.1

Page82

Version2.1

Page83

DEWESoft7.1derivationandintegrationofanarray(vector)
Tocreateanarrayweusethescopetriggerfunctiononananalogtestsignal(seebelow).

Discretederivation:
x[k]x[k1]

Tocalculatederivationforanarraythefollowingformulaisused:

'AI0/Data'[1:len1]'AI0/Data'[0:len2]

Discreteintegration:

Tocalculateintegrationforanarrayweusethenewintegratefunction:

integrate('AI0/Data')

Version2.1

Page84

Вам также может понравиться