previous next Up Title Contents

Harmonic: Complex Harmonic Series


File name
StHarmonic.[ch]


Description
This module generates a harmonic series stimulus. There are FM and butterworth filter options which can be used.


Example parameter file format
300	Stimulus fundamental frequency (Hz).
1	Lowest harmonic number.
1	Highest harmonic number.

#  Mistuning one harmonic
-1	Mistuned harmonic number (0= F0, -1 implies none mistuned).
40	Mistuning factor (%).

#  Phase relationships among harmonics
SINE	Phase mode (SINE, COSINE, RANDOM, SCHROEDER, ALTERNATING).
1	Random number seed.

#  Frequency modulation
2.5	modulation Frequency (Hz).
0	modulation Phase (degrees).
50	modulation Depth (%).

#  Bandpass filter
4	Order
200	LowCutFreq  3 dB down
600	HighCutFreq 3 dB down

#  Intensity, duration, dt
45.0	Stimulus signal intensity (dB SPL).
50e-3	Stimulus signal duration (s).
0.05e-3	Stimulus sampling interval, dt (seconds).



Test program directory
Tests/Combinations

Generic Module Routines

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

The GenerateSignal_Harmonic(...) Process Routine

Syntax
BOOLN GenerateSignal_Harmonic(EarObjectPtr theObject);


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

The SetDuration_Harmonic(...) Routine

Syntax
BOOLN SetDuration_Harmonic(double theDuration);


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

The SetFrequency_Harmonic(...) Routine

Syntax
BOOLN SetFrequency_Harmonic(double theFrequency);


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

The SetHighestHarmonic_Harmonic(...) Routine

Syntax
BOOLN SetHighestHarmonic_Harmonic(int theHighestHarmonic);


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

The SetIntensity_Harmonic(...) Routine

Syntax
BOOLN SetIntensity_Harmonic(double theIntensity);


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

The SetLowerCutOffFreq_Harmonic(...) Routine

Syntax
BOOLN SetLowerCutOffFreq_Harmonic(double theLowerCutOffFreq);


Special Values
(This parameter is only used if the bandpass filter is operationalsee 0 The SetOrder_Harmonic(...) Routine.)


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

The SetLowestHarmonic_Harmonic(...) Routine

Syntax
BOOLN SetLowestHarmonic_Harmonic(int theLowestHarmonic);


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

The SetMistunedHarmonic_Harmonic(...) Routine

Syntax
BOOLN SetMistunedHarmonic_Harmonic(int theMistunedHarmonic);


Special Values
A negative value means that no harmonic is mistuned.


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

The SetMistuningFactor_Harmonic(...) Routine

Syntax
BOOLN SetMistuningFactor_Harmonic(double theMistuningFactor);


Special Values
(This parameter is only used if a harmonic is mistuned).


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

The SetModulationDepth_Harmonic(...) Routine

Syntax
BOOLN SetModulationDepth_Harmonic(double theModulationDepth);


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

The SetModulationFrequency_Harmonic(...) Routine

Syntax
BOOLN SetModulationFrequency_Harmonic(double theModulationFrequency);


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

The SetModulationPhase_Harmonic(...) Routine

Syntax
BOOLN SetModulationPhase_Harmonic(double theModulationPhase);


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

The SetOrder_Harmonic(...) Routine

Syntax
BOOLN SetOrder_Harmonic(int theOrder);


Special Values
A zero order turns off the bandpass filter.


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

The SetPars_Harmonic(...) Routine

Syntax
BOOLN SetPars_Harmonic(char *thePhaseMode, int theLowestHarmonic, int theHighestHarmonic, int theMistunedHarmonic, double theMistuningFactor, long theRanSeed, double theFrequency, double theIntensity, double theDuration, double theSamplingInterval, double theModulationFrequency,double theModulationPhase, double theModulationDepth, int theOrder, double theLowerCutFreq, double theUpperCutFreq);


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

The SetPhaseMode_Harmonic(...) Routine

Syntax
BOOLN SetPhaseMode_Harmonic(char *thePhaseMode);


Special Values
Mode options: "SINE", "COSINE", "RANDOM", "SCHROEDER" or "ALTERNATING".


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

The SetRanSeed_Harmonic(...) Routine

Syntax
BOOLN SetRanSeed_Harmonic(long theRanSeed);


Special Values
A negative random number seed will change the sequence of random numbers used. (This parameter is only used if a the "RANDOM" phase mode option is usedsee 0 The SetRanSeed_Harmonic(...) Routine.)


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

The SetSamplingInterval_Harmonic(...) Routine

Syntax
BOOLN SetSamplingInterval_Harmonic(double theSamplingInterval);


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

The SetUpperCutOffFreq_Harmonic(...) Routine

Syntax
BOOLN SetUpperCutOffFreq_Harmonic(double theUpperCutOffFreq);


Special Values
(This parameter is only used if the bandpass filter is operationalsee 0 The SetOrder_Harmonic(...) Routine.)


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

Example: Tests/Combinations/StimulusResp.c

Parameter file: StimulusResp.par:
#
# Main Parameter file
#

output.dat	Name of output file.

# Module specifications
#Par. file				Name		Description
#---------				-----		-------------
ParFiles/St/Harmonic1.par	Harmonic	Stimulus generation paradigm.
ParFiles/PE/PreEmph1.par	null		Outer-/middler-ear filter model.
ParFiles/BM/GammaT5k.par	null		Basilar membrane filter model.
ParFiles/IHC/CarneyRP1.par	null		IHC receptor potential model.
ParFiles/IHC/Meddis86.par	null		Inner hair cell (IHC) model.
ParFiles/AN/BinomSG1.par	null		Auditory nerve spike generation.
ParFiles/NC/Dendrite3.par	null		Dendritic filtering.
ParFiles/NC/MG92Stellate.par	null		Neural cell model.

# Miscellaneous parameters

2.5e-3	Ramp up rise time for signal (s).
Output

Figure [135] A stimulus generated by the Harmonic module.


previous next Up Title Contents