previous next Up Title Contents

Analysis_CCF: Cross-correlation Function


File name
AnCrossCorr.[ch]


Description
This module generates a cross-correlation function from the connected input signal. The input signal is expected to be binaural, and the cross-correlation is carried out between the right and left channel sets. It puts the result in the output signal, overwriting any previous data if the signal has already been initialised. The function is calculated backwards from the time, timeOffset (s) for a period of period (s). An exponential decay function is included with the time constant, timeConstant (s). The same binning as for the input signal is used.


Example parameter file format
15.0e-3	Time offset, t0 (s).
2.5e-3	Time constant, tw (s).
7.5e-3	Maximum lag period, t (s).



Test program directory
Tests/Analysis

Generic Module Routines

This module has the standard Generic Module Routines (see Basic Module Routines used in Generic Programming, page 52).

The Calc_Analysis_CCF(...) Process Routine

Syntax
BOOLN Calc_Analysis_CCF(EarObjectPtr data);


Returns
TRUE if the process is successful, otherwise it returns FALSE.

The SetPars_Analysis_CCF(...) Routine

Syntax
BOOLN SetPars_Analysis_CCF(double timeOffset, double timeConstant, double period);


Returns
TRUE if the function is successful, otherwise it returns FALSE.

The SetPeriod_Analysis_CCF(...) Routine

Syntax
BOOLN SetPeriod_Analysis_CCF(double thePeriod);


Returns
TRUE if the function is successful, otherwise it returns FALSE.

The SetTimeConstant_Analysis_CCF(...) Routine

Syntax
BOOLN SetTimeConstant_Analysis_CCF(double theTimeConstant);


Returns
TRUE if the function is successful, otherwise it returns FALSE.

The SetTimeOffset_Analysis_CCF(...) Routine

Syntax
BOOLN SetTimeOffset_Analysis_CCF(double theTimeOffset);


Special Values
If negative it is assumed that the autocorrelation will start (backwards) from the end of the signal.


Returns
TRUE if the function is successful, otherwise it returns FALSE.

Example: Tests/Analysis/CrossCorrelation c

Parameter file: CrossCorrelation.par:
#
# Main Parameter file
#
output.dat		Name of output file.
#
# Module specifications.
#
#Par. file		Name			Discription
#---------		---------			-------------
BPTone1.par		PureTone_Binaural		Stimulus generation paradigm.

CrossCo1.par	Cross correlation analysis module.
Output

Figure [34] Output for CCF test. The tapered region is cause by the ramp interval

Comments:

The output file is in the form:

delay period (s), CCF.


previous next Up Title Contents