previous next Up Title Contents

Connecting the EarObject Data Structures

At this point in the simulation program, corresponding to stage (iv), the EarObject data structures are connected to define the required data flow:

	ConnectOutSignalToIn_EarObject( stimulus, pEFilter );
	ConnectOutSignalToIn_EarObject( pEFilter, bMFilter );
	ConnectOutSignalToIn_EarObject( bMFilter, recptPotn );
	ConnectOutSignalToIn_EarObject( recptPotn, hairCell );

Each EarObject has an input and an output signal. The ConnectOutSignalToIn_EarObject(...) routine "connects" the output signal of one EarObject as the input of another, so that the output of one process is piped directly to the connect process. The first argument of the command is the EarObject supplying its output signal to the EarObject which is the second argument, as shown in figure [7].

Figure [7]: ConnectOutSignalToIn_EarObject(...) Command To re-iterate, the ConnectOutSignalToIn_EarObject(...) routine links the "stimulus" and "pEFilter" EarObjects such that when the "pEFilter" EarObject's input signal is accessed, it is really looking at the output signal of the "stimulus" EarObject. The data flow for the simulation program, describing a pipeline, is represented as shown in figure [8].

Figure [8]: AudPerGen.c-Simulation Data Flow The connections between the EarObjects are managed automatically by the connection management system. The system ensures that the connections are kept up to date; if an EarObject's output signal is changed, then the management system signals to all of the linked "customer" EarObjects that there has been a change. Multi- or single-channel data is passed from one EarObject or process stage, to another invisibly via these connections. In this example program a pipeline is used, but EarObjects can supply more than one customer if required.

previous next Up Title Contents