SpHr_CrossingCarrierStats [ Flags ]  CenterFreq, BiquadCoefs, srcWave [ , srcWave2 ]


Obtains parametric and/or nonparametric statistics for interaural time (ITD) or level (ILD) differences.

This operation uses an old zero-crossing algorithm. 


Parameters

CenterFreq  Center frequency (Hz) used to generate BiquadCoefs.


BiquadCoefs  Specification for a double precision wave of biquad filter coefficients. See SpHr_FilterBiquadCoefs.


srcWave  Specification two-channel single precision wave used to generate ITDs and/or ILDs. srcWave should have 2 columns (left channel in column 0, right channel in columns 1), unless srcWave2 is also specified. In this latter case, srcWave is a single precision wave having a single column reflecting the left channel of a stereo pair.


srcWave(startX, endX)  Specifies an x-range in the source wave.


srcWave[startP, endP]  Specifies a point-range in the source wave.


srcWave2  Specification for a single precision wave, having a single column reflecting the right channel of a stereo pair. If specified, srcWave must have no more than one column.


Flags

/ITD [ = itd ]    

    Calculate statistics for interaural time differences (ITD).

    Must use /ITD and/or /ILD flag.

    itd = 1 same as /ITD alone, itd = 0 same as no /ITD flag.


/ILD [ = ild ]    

    Calculate statistics for interaural level differences (ILD) at the times of ITDs (even if statistics for ITDs are not computed).

    Must use /ITD and/or /ILD flag.

    ild = 1 same as /ILD alone, ild = 0 same as no /ILD flag.


/PS [ = parametricDestWaveName ]    

    Parametric statistics are calculated using a single pass: V_ITD_avg and V_ITD_sdev with /ITD flag and/or V_ILD_avg and V_ILD_sdev with /ILD flag. The wave specified by parametricDestWaveName is made if the /W is also present.


/Skew [ = skew ]    

    Calculate Skewness in addition to default values. Requires /PS flag. 

    skew = 1 same as /Skew alone, skew = 0 same as no /Skew flag.


/Kurt [ = kurt ]    

    Calculate Kurtosis in addition to default values. Requires /PS flag).

    kurt = 1 same as /Kurt alone, kurt = 0 same as no /Kurt flag.


/NPS [ = nonparametricDestWaveName ]    

    Non-parametric statistics are calculated: V_ITD_Median, V_ITD_Q25, V_ITD_Q75, and V_ITD_IQR, with /ITD flag, and/or V_ILD_Median, V_ILD_Q25, V_ILD_Q75, and V_ILD_IQR, with /ILD flag. The wave specified by nonparametricDestWaveName is made if the /W is also present.

/MAD [ = mad ]    Calculate median absolute deviation in addition to default values. Requires /NPS flag. This option requires a second sorting operation.

    mad = 1 same as /MAD alone, mad = 0 same as no flag.


/Mode [ = mode ]    

    Calculate mode in addition to default values. Requires /NPS flag. 

    mode = 1 same as /Mode alone, mode = 0 same as no /Mode flag.


/P2X = [ P2X ]    

    This operation uses an old zero-crossing algorithm. P2X can range between 0 to 1 but should normally be set to the default value of 0.


/D = [ delaysWaveName ]

    Delay lines are saved to a wave specified by delaysWaveName. The delays are used on subsequent calls unless delaysWaveName is killed or the /C flag is present. This wave is single precision and always overwritten.


/C = [ c ]     

    Clear delay lines before filtering. Delay lines are preserved if delaysWaveName already exists and the /C flag is omitted.

    c = 1 same as /C alone, c = 0 same as no /C flag.


/DF = dfRef    

    dfRef is an optional datafolder reference. Destination waves are written to this existing datafolder, overriding any specified datafolder. Waves are written to the current datafolder if not specified here or by a WaveName.


/W [ = w ]    

    w = 1 parametricDestWaveName and/or nonparametricDestWaveName waves are generated. If parametricDestWaveName is omitted, a wave named Cues_Stats is made. If nonparametricDestWaveName is omitted, a wave named Cues_StatsQuartiles is made.

    w = 0 no waves are generated


/Q [ = q ]    

    No information is printed in history.

    q = 1 same as /Q alone, q = 0 same as no /Q flag.


Example

Function SpHr_CrossingCarrierStats_Example()

    variable fs = 48000, Hz = 500, ITD = 0.2 // ms

    SpHr_SignalBinaural/sec=1/Ramp=20/dB=30/HP=50/Sp=1/Ind=0/ITD={ITD,1}/ILD=6 fs, NoiseBurst

    SpHr_FilterBiquadCoefs fs, Hz, BiquadCoefs

    SpHr_CrossingCarrierStats /W=1/ITD/ILD /NPS=StatsQuartiles/PS=Stats Hz, BiquadCoefs, NoiseBurst // /Q

    killwaves/Z BiquadCoefs, NoiseBurst

    Edit/K=1 Stats.ld, StatsQuartiles.ld

End

Contact: Brian