Thu, 01/17/2019 - 10:29 am
This small snippet allows one to efficiently fold and average a 1D wave containing periodic data, for instances, a wave of 100 points containing ten cycles of 10-point data.
The end result is a 10-point 1D wave containing the averaged results of the ten cycles originally contained by the 100-point 1D wave.
wave foldedWave, waveToFold
variable numRowfW = numpnts(foldedWave)
variable numRowwTF = numpnts(waveToFold)
variable numFold = floor(numRowwTF/numRowfw)
duplicate/o/R=[0,numFold*numRowfW] waveToFold, fWMatrix
redimension/N=(numRowfW, numFold,0,0) fWMatrix
multithread foldedWave = meanRow(fwMatrix,p)
threadsafe static Function MeanRow (wave2D, whichRow)
Igor Pro 9
Igor XOP Toolkit
Igor NIDAQ Tools MX