previous next Up Title Contents

Main Simulation Process

The simulation process for this example, stage (vi) in the standard program format, is shown in figure [17].

	printf("\nStarting main process...\n\n" );
	GenerateSignal_PureTone( stimulus );
	PrintProcessName_EarObject( "1-stimulus: '%s'.\n", stimulus );
	RampUpOutSignal_Ramp( stimulus, Sine_Ramp, rampInterval );
	CalcIntensities_GenAnalysis(intensity, stimulus->outSignal,
rampInterval );
	printf("\tStimulus intensity = %g dB SPL.\n", intensity[CHANNEL] );
	RunModel_PreEmphasis_BandPass( pEFilter );
	PrintProcessName_EarObject("2-Outer-/middle-ear: '%s'.\n", pEFilter );
	RunModel_BasilarM_GammaT( bMFilter );
	PrintProcessName_EarObject("3-Basilar membrane: '%s'.\n", bMFilter );
	RunModel_IHC_Meddis86( hairCell );
	PrintProcessName_EarObject("4-Inner hair cell (IHC): '%s'.\n", hairCell
	WriteOutSignal_DataFile(outputFile, hairCell );

Figure [17]: AudPer86.c - Main Simulation Process

The code differs from the generic program example in two ways. Each process routine is called by its absolute routine name (the CRL routine naming convention is described in the reference section of this manual). The RampUpOutSignal_Ramp(...) is always called, as pure tones must always be ramped when supplying a signal to a filter.[4] It is obvious that any changes to this simulation process, such as using an amplitude modulated pure tone instead, will require that the relevant routine names be changed, and the program re-compiled. This would not be necessary using generic example program, which would only required that the appropriate module name and parameter file be substituted in the main parameter file.

command in the ReadParsFromFile(...) code).

[4]Using the generic example program, it is possible to specify that the "Click" stimulus generation paradigm be used, in the parameter file. "Click" stimuli should not be ramped, and are therefore generated with the rampFlag signal field already set. This signal field can thus be checked to see whether or not the signal requires ramping.

previous next Up Title Contents