T C"(r) = -L f·(t)· [.(t + r) dt 1JT 0 1 1 fj(t) or fj(t) = 0 ---+ fj(t) • fj(t) = 0 fj(t) and fj(t) =1 ---+ fj(t) . fj(t) =1
RESULTSAn example of correlation functions obtained with the above program is illustrated in Fig. 2. Spindle activity recorded from Channel 0 appears to be in lag with respect to that recorded from Channel 1 by two time units (one time unit =0.16 sec).The global results obtained from one preparation are where fi(t) and fj(t) are the rectangular wave outputs of a spindle detection program for two EEG channels, which has been described elsewhere (Vo-Ngoc, Poussart, & Langlois, 1971).In general, we have chosen r max = 5.12 sec and T = 15 min, so that (r max/T) "i 1. In the ideal case, where T ---+ 00 and where fj(t) and fj(!) are stationary, this expression can be identified with the conventional definition of the cross-correlation function of two stochastic signals.Here, fj(t) and fj(t) can only have the values 0 or 1, corresponding, respectively, to the absence or presence of spindle activity. The product fj(t) . fj(t) becomes a simple AND logic operation. Therefore, the computation time is considerably reduced.The flow diagram of the program which computes the cross-correlation functions of spindle activities, as identified by the detection program and stored on DECtape, is shown in Fig. 1.First, one specifies to the program all required parameters, such as the starting block and the number of blocks of data stored in the DECtape obtained from the spindle detection program, and the maximum delay r max' The program then clears all counter registers and tables of results.For pratical reasons related to the computer memory capacity, the computation of correlation functions is worked out as follows: (1) For each value of r , the data on DECtape is divided into groups of two blocks each. (2) The program transfers two consecutive blocks of data to computer memory, for example, Blocks nand n + 1, computes the partial correlation functions, Cij(r), and stores the results. (3) The data transfer is repeated, this time with Blocks n + 1 and n + 2. The new partial functions, Cij(r), are then added up to the previous Cij(r). (4) The process is repeated automatically. After all specified blocks have been analyzed, the program transfers to display mode.The program is fully interactive. By a suitable command at the Teletype, one can choose the type of correlation function for display, change the scales, observe the results on the CRT display, or also obtain a duplicate of results on graph paper with the point plotter.The main hardware used in this analysis consists of PDP-8 computer, DECtapes, CRT display, and point plotter. The program uses 2.5K of core memory.