Let nonequispaced nodes and frequencies in the index sets
The nonequispaced discrete cosine and sine transforms are given by
The straight forward algorithm of this matrix vector product, which is called ndct and ndst, takes and arithmetical operations. For these real transforms the adjoint transforms coincide with the ordinary transposed matrix vector products. Our fast approach is based on the NFFT and seems to be easier than the Chebyshev transform based derivation in [44] and faster than the algorithms in [56] which still use FFTs. Instead of FFTs we use fast algorithms for the discrete cosine transform (DCT-I) and for the discrete sine transform (DST-I). For details we refer to [22].