2.3.4 COSTI/COST

1.
Function
Performs cosine transformation on even cyclic data: COSTI initializes; and COST performs cosine transformation.
2.
Definition
Forward transformation is defined as follows:
กก\begin{displaymath}X_{k} = x_{1} + (-1)^{k-1}x_{N}+ 2\sum_{i=2}^{N}x_{i}\cos \...... (i-1)(k-1)}{N-1},\mbox{\hspace{1em}}( k = 1, \ldots, N ). \end{displaymath}

Inverse transformation is the same as the forward transformation.

3.
Call
CALL COSTI(N,WSAVE)
CALL COST(N,R,WSAVE)
4.
Explanation of Parameters
N (I) Length of data to process.
WSAVE (R) Working array: must have length of at least 3N+15.
R (R) Floating-point array to process. It is both the input and output parameter. (See above definition.)
5.
Notes
(a)
COST is also the inverse transformation. This transformation does not involve normalization. In other words, when COST is called twice, then the value of the original value multiplied by a factor of 2(N-1) is returned.