Let's denote and two spectra that one wants to add, and
the output sum. With the ACCUMULATE command, and are precisely the
corresponding buffers exposed to the user in CLASS. With the AVERAGE command, is the average spectrum returned by the
loop, and the spectrum in index, with its weight array
correctly set. We also call (resp. ) the resolution of
(resp. ). This resolution is either in ``number of
channels''3, frequency, or velocity per channel depending on
the alignment mode (SET ALIGN CHANNEL|FREQUENCY|VELOCITY
resp.).
From these, the output resolution is taken as the highest of the two
(absolute) resolutions in input:
The range of abscissa in output spectrum depends on the combination mode:
(2) | |||
(3) |
(4) | |||
(5) |
Given the output resolution and range, the number of channels can
be deduced:
(6) |
For the oncoming call of the addition routine, we also define the
abscissa at the channel used as reference:
This definition of the output spectrum is done only once with the ACCUMULATE command. On the other hand with the AVERAGE command, the above parameters are revised (if required) each time a new spectrum of the index is added. For example, the output range and number of channels may enlarge (SET ALIGN * COMPOSITE) or reduce (SET ALIGN * INTERSECT). Also, the resolution is progressively reduced to the coarsest of all the resolutions in the index (eq. ).