previous next Up Title Contents

SignalData Module


Some of the routines in the module would not normally be used directly by the user. Refer to the source code for further information.

The AddScaledData_SignalData(...) Routine

Syntax
BOOLN AddScaledData_SignalData(SignalDataPtr a, SignalDataPtr b, double scale[]);


Description
This routine adds two SignalData data structures together, with a supplied scaling difference. The result is put into the first of the data sets: a = a + b * scale. This version applies a different scale to each channel from the scale array.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)
RunModel_BasilarM_Stone3(...) routine.

The AddScaledData_SignalData_Single(...) Routine

Syntax
BOOLN AddScaledData_SignalData_Single(SignalDataPtr a, SignalDataPtr b, double scale);


Description
This routine adds two SignalData data structures together, with a supplied scaling difference. The result is put into the first of the data sets: a = a + b * scale. This version applies a single scale to each channel.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)

The GetDuration_SignalData(...) Routine

Syntax
double GetDuration_SignalData(SignalDataPtr theSignal);


Description
This function calculates the duration of theSignal using the length and dt fields of the SignalData data structure.


Returns
duration (s)


Example(s)
Tests/Models/Hair Cell/Meddis86/M86RateIntensity.c

The CheckInit_SignalData(...) Routine

Syntax
BOOLN CheckInit_SignalData(SignalDataPtr theSignal, char *callingFunction);


Description
This routine checks whether or not a signal has been initialised, i.e. memory has been allocated for it.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)
InitChannel_SignalData(...) routine.

The CheckPars_SignalData(...) Routine

Syntax
BOOLN CheckPars_SignalData(SignalDataPtr theSignal);


Description
This routine checks that the necessary parameters for theSignal have been correctly initialised.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)
InitOutFromInSignal_EarObject(...) routine.

The CheckRamp_SignalData(...) Routine

Syntax
BOOLN CheckRamp_SignalData(SignalDataPtr theSignal);


Description
This function tests if the ramp flag of theSignal has been set. Some processes require that signals should be ramped, so this facility allows a warning to be given if a signal has not been ramped. The flag is set in the UtRamp module.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)
RunModel_BasilarM_GammaT(...) routine.

The CopyInfo_SignalData(...) Routine

Syntax
BOOLN CopyInfo_SignalData(SignalDataPtr a, SignalDataPtr b);


Description
This routine copies the info values from one signal to another: a = b.

The labels will only be copied if there are an equal number of channels (labels).

If the labels have already been initialised, they will be reset.



Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)

The Delay_SignalData(...) Routine

Syntax
BOOLN Delay_SignalData(SignalDataPtr signal, double delay);


Description



Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)
InitCopy_SignalData(...) Routine

The Divide_SignalData(...) Routine

Syntax
BOOLN Divide_SignalData(SignalDataPtr a, SignalDataPtr b);


Description
This function divides two data structures, sample by sample. The result is put into the first of the data sets: a = a / b


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)

The Free_SignalData(...) Routine

Syntax
void Free_SignalData(SignalDataPtr *theData);


Description
This routine frees the memory allocated to theData SignalData data structure. It also sets the pointer to NULL, hence the address of the pointer is passed to this function.


Returns
none.


Example(s)
Free_EarObject(...) routine.

The GaindB_SignalData(...) Routine

Syntax
BOOLN GaindB_SignalData(SignalDataPtr d, double gaindB);


Description
This routine increases the signal intensity of the d signal by a specified number of dB.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)

The GaindBIndividual_SignalData(...) Routine

Syntax
BOOLN GaindBIndividual_SignalData(SignalDataPtr d, double gaindB[]);


Description
This routine increases the signal intensity for each channel by a specified number of dB's (using the dB 1 scale, so that 0 dB gives an attenuation factor of 1.0).

No special checks are made upon the gaindB array.



Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)

The GetDuration_SignalData(...) Routine

Syntax
double GetDuration_SignalData(SignalDataPtr theSignal);


Description
This function returns the duration of a signal.


Returns
Duration. (s)


Example(s)

The GetOutputTime_SignalData(...) Routine

Syntax
double GetOutputTime_SignalData(SignalDataPtr theSignal, ChanLen sample);


Description
This function returns the output time for a sample of a signal. It uses the outputTimeOffset field of the SignalData structure-See source code.


Returns
Time (s).


Example(s)

The Init_SignalData(...) Routine

Syntax
SignalDataPtr Init_SignalData(char *callingFunctionName);


Description
This function allocates memory for a signal and sets the default values. The callingFunctionName string is passed for debugging purposes.


Returns
a pointer to the SignalData data structure or NULL if it fails.


Example(s)
InitOutSignal_EarObject(...) routine.

The InitChannels_SignalData(...) Routine

Syntax
BOOLN InitChannel_SignalData(SignalDataPtr theData);


Description
This routine allocates memory space for a channel in the, theData SignalData data structure. It automatically updates the numChannel counter for the signal.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)
InitOutSignal_EarObject(...) routine.

The InitCopy_SignalData(...) Routine

Syntax
SignalDataPtr InitCopy_SignalData(SignalDataPtr original);


Description
Initialises a data signal as a replica of the original signal


Returns
a pointer to the SignalData data structure or NULL if it fails.


Example(s)

The InitInfo_SignalData(...) Routine

Syntax
BOOLN InitInfo_SignalData(SignalInfoPtr info);


Description
This routine initialises the signal info structure (see source code) to the default values. Space is allocated for the channel labels when the channels are initialised.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)

The Scale_SignalData(...) Routine

Syntax
BOOLN Scale_SignalData(SignalDataPtr d, double multiplier);


Description
This routine scales the d SignalData data structure's channel values by a specified multiplier.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)
RunModel_Neuron_DendriteLP(...) routine

The OutputToFile_SignalData(...) Routine

Syntax
BOOLN OutputToFile_SignalData(char *fileName, SignalDataPtr theData);


Description
This routine outputs the, theData SignalData data structure to the file, fileName using the simple LUTEar format.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)
WriteASCII_DataFile(...) routine.

The ResetInfo_SignalData(...) Routine

Syntax
BOOLN ResetInfo_SignalData(SignalDataPtr signal);


Description
This routine resets the signal info structure to the default values.


Returns
TRUE if this function succeeeds, otherwise it returns FALSE.


Example(s)

The SameType_SignalData(...) Routine

Syntax
BOOLN SameType_SignalData(SignalDataPtr a, SignalDataPtr b);


Description
This routine checks that two signals, a and b, have the same dimensions, i.e. length, sampling interval etc.


Returns
TRUE if they are the same, otherwise it returns FALSE.


Example(s)
AddScaledData_SignalData(...) routine.

The SetChannelsFromSignal_SignalData(...) Routine

Syntax
BOOLN SetChannelsFromSignal_SignalData(SignalDataPtr theSignal, SignalDataPtr supplier);


Description
This routine copies the data from the supplier channels into the channels of theSignal. If the supplier signal is multi-channelled, then theSignal will consist of an interleave of the supplier channels.


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


Example(s)
InitOutFromInSignal_EarObject(...) routine.

The SetInfoChannelLabels_SignalData(...) Routine

Syntax
void SetInfoChannelLabels_SignalData(SignalDataPtr theData, double labels[]);


Description
This routine sets the channel labels for the signal's info, but only if the information is local, and not just a copy.

It does not verify that the array of value's provided is the correct length.



Returns
None.


Example(s)
BasilarM process modules.

The SetInfoChanDataTitle_SignalData(...) Routine

Syntax
void SetInfoChanDataTitle_SignalData(SignalDataPtr theData, char *title);


Description
This routine sets the channel data title for the signal's info (see source code) structure, but only if the information is local, and not just a copy.


Returns
None.


Example(s)

The SetInfoChannelTitle_SignalData(...) Routine

Syntax
void SetInfoChannelTitle_SignalData(SignalDataPtr theData, char *title);


Description



Returns
None.


Example(s)

The SetInfoSampleTitle_SignalData(...) Routine

Syntax
void SetInfoSampleTitle_SignalData(SignalDataPtr theData, char *title);


Description
This routine sets the channel title for the signal's info structure, but only if the information is local, and not just a copy.


Returns
None.


Example(s)

The SetInterleaveLevel_SignalData(...) Routine

Syntax
void SetInterleaveLevel_SignalData(SignalDataPtr theData, uShort theInterleaveLevel);


Description
This routine sets the interleave level field for the SignalData structure.

A monaural signal has an interleave level of 1 (the default), and a binaural signal has an interleave level of 2.



Returns
None.


Example(s)

The SetLength_SignalData(...) Routine

Syntax
void SetLength_SignalData(SignalDataPtr theData, ChanLen theLength);


Description
This routine sets the length field for theData SignalData data structure. The length of a data set can only be set for a particular SignalData data structure once, thereafter it must be destroyed and re-created if required. As this routine is not generally called by the user, any failures are fatal.


Returns
none.


Example(s)
InitOutFromInSignal_EarObject(...) routine.

The SetSamplingInterval_SignalData(...) Routine

Syntax
void SetSamplingInterval_SignalData(SignalDataPtr theData, double theSamplingInterval);


Description
This routine sets the dt field for theData SignalData data structure. As this routine is not generally called by the user, any failures are fatal.


Returns
none.


Example(s)
InitOutFromInSignal_EarObject(...) routine.

The SetTimeIndex_SignalData(...) Routine

Syntax
void SetTimeIndex_SignalData(SignalDataPtr theData, ChanLen theTimeIndex);


Description
This routine sets the time offset field for the SignalData structure. It can only be set in segmented mode at present. The default value of 0 must be maintained otherwise.


Returns
None.


Example(s)

The SetOutputTimeOffset_SignalData(...) Routine

Syntax
void SetOutputTimeOffset_SignalData(SignalDataPtr theData, double theOutputTimeOffset);


Description
This routine sets the time offset field for the SignalData structure. By default it is set to zero, but it can be set to anything.


Returns
None.


Example(s)
Display process module.


previous next Up Title Contents