SpHr_Stats [ /Cols /Wts=Wts /W=[statsDestWaveName] /RMS /Skew /Kurt /Q ] srcWaveName
Obtains parametric statistics across matrix rows or columns. Statistics include the average, standard deviation, and number of infinite values. Optional values are root mean square (/RMS flag), Skewness (/Skew flag), and Kurtosis (/Kurt flag).
One should normally use Igor Pro’s built-in WaveStats operation.
This operation uses a one-pass algorithm. Thus Igor's built-in WaveStats operation should be used especially if precise standard deviations are desired.
Parameters
srcWaveName Specification for single precision source matrix.
srcWaveName(startX, endX) When the /Cols flag is omitted, startX and endX specify a range of x-axis values in the source wave. When the /Cols flag is present , startX and endX specify a range of y-axis values in the source wave.
srcWaveName[startP, endP] When the /Cols flag is omitted, startP and endP specify a point-range in the source wave. When the /Cols flag is present , startP and endP specify a range of columns in the source wave.
Flags
/Cols = [ cols ]
cols = 0, Same as no /Cols flag. Statistics are computed across rows for each column in srcWaveName. The number of columns in statsDest equals the number of columns in srcWaveName. Statistics are written to different labeled rows.
cols = 1, Same as /Cols alone. Statistics are computed across columns for each row in srcWaveName. The number of rows in statsDest equals the number of rows in srcWaveName. Statistics are written to different labeled columns.
/Wt = WtsWaveName
Specification for a wave of weights. This wave must be single precision and have the same dimensions as srcWaveName.
/W = [ statsDestWaveName ]
Statistics are written to the wave specified by statsDestWaveName. If statistics are obtained for more than one row or column (see /Cols flag), a wave named W_StatsQuartiles is always generated in the current datafolder. This wave is single precision and always overwritten.
/RMS = [ rms ]
Computes root mean square of srcWaveName rows (/Cols=0) or columns (/Cols=1).
rms = 0, Same as no /RMS at all. Default option.
rms = 1, Same as /RMS alone.
/Skew = [ skew ]
Computes Skewness.
skew = 0, Same as no /Skew at all. Default option.
skew = 1, Same as /Skew alone.
/Kurt = [ kurt ] Computes Kurtosis.
kurt = 0, Same as no /Kurt at all. Default option.
kurt = 1, Same as /Kurt alone.
/Q = [ q ] No information printed in history. No information is ever printed when srcWaveName consists of more than one row or more than one column.
/EB = [ eb ] Number of normal numbers normally written to row 2 or column 2 is replaced by a second instance of standard deviation. This may be useful for plotting error bars in a manner consistent with quartiles calculated using the SpHr_StatsQuartiles operation.
/EB=0: Same as no /EB at all. Default option.
/EB=1: Same as /EB alone.
/EB=2: Only averages and two instances of standard deviations are written to statsDestWaveName. Also prevents information from being printed to history (see /Q) or the generation of local or global variables.
Example
Function SpHr_Stats_Example()
variable fs = 48000
variable ITD = 0.2 // ms
// Partially independent noise burst with 0.2 ms ITD
SpHr_SignalBinaural/sec=1/Ramp=20/dB=70/HP=50/Buff={100,100}/Sp=1/Ind=0.1/ITD={ITD,1} fs, Noise
SpHr_FilterCenterFreqs/R/Type=(2) 300, 600, 3, CFs // log
SpHr_FilterBankBiquadCoefs 48000, CFs, coefBank
SpHr_FilterBankBiquad /RMS/Dest=FilterBanks CFs, coefBank, Noise
killwaves/Z coefBank, Noise
SpHr_CrossingCarrierCues/ITD=ITDs CFs, FilterBanks
killwaves/Z FilterBanks
SpHr_Stats/W=Stats ITDs
Edit/K=1 Stats.ld
End