SpHr_StatsQuartiles [ /Cols /Wt=Wts /W=[statsDestWaveName] /MAD /Mode /Q /EB ] srcWaveName


Obtains non-parametric statistics across matrix rows or columns. Statistics include the median, 1st quartile, 3rd quartile, inter-quartile range, and the number of infinite values. Optional values are the median absolute deviation (/MAD flag) and the mode (/Mode flag).


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 statsDestWaveName 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 statsDestWaveName equals the number of rows in srcWaveName. Statistics are written to different labeled columns.


/Wt = WtsWaveName

    Specification for a wave of weights. The wave must be single precision and have the same dimensions as srcWaveName.


/W = [ statsDestWaveName ]

    Statisics 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.


/MAD = [ mad ]    

    Computes median absolute deviations (MAD) This option requires two sorting operations.

    mad = 0, Same as no /MAD at all. Default option.

    mad = 1, Same as /MAD alone.


/Mode = [ numBins ]

    Computes the 'modes' of srcWaveName rows or columns (see /Cols flag). Because srcWaveName consists of floating point numbers the 'mode' is calculated as the peak of a histogram of values between the first and third quartiles. If numBins is omitted, 100 bins are used. If the number of normal numbers in a row is less than numBins*10, numBins is set to the number of normal numbers /10.


/Q = [ q ]    No information is printed to history. In addition, no information is printed when srcWaveName consists of more than one row or column (see /Cols flag).


/EB = [ eb ]    1st and 3rd quartiles are replaced by values appropriate for error bars. 1st quartile = median - Q1 and 3rd quartile = median - Q3.

    /EB=0: Same as no /EB at all. Default option.

    /EB=1: Same as /EB alone.

    /EB=2: Only medians, Q1 error bars, and Q3 error bars are written to statsDestWaveName. Also prevents information from being printed to history (see /Q) and the generation of local or global variables.


Example

Function SpHr_StatsQuartiles_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_StatsQuartiles/W=StatsQuartiles ITDs

    Edit/K=1 StatsQuartiles.ld

End

Contact: Brian