Discrete Cosine Transform (DCT)
Signal Processing (SP) Module » Transforms

One dimensional Dicrete Cosine Transform. More...

## Functions

ITPP_EXPORT bool | itpp::have_cosine_transforms ()
| Run-time test if library is built with cosine transforms enabled.
ITPP_EXPORT void | itpp::dct (const vec &in, vec &out)
| Discrete Cosine Transform (DCT).
ITPP_EXPORT vec | itpp::dct (const vec &in)
| Discrete Cosine Transform (DCT).
ITPP_EXPORT vec | itpp::dct (const vec &in, const int N)
| Discrete Cosine Transform (DCT) with zero-padding up to size N.
ITPP_EXPORT void | itpp::idct (const vec &in, vec &out)
| Inverse Discrete Cosine Transform (IDCT).
ITPP_EXPORT vec | itpp::idct (const vec &in)
| Inverse Discrete Cosine Transform (IDCT).
ITPP_EXPORT vec | itpp::idct (const vec &in, const int N)
| Inverse Discrete Cosine Transform (IDCT) with zero-padding up to size N.

## Detailed Description

One dimensional Dicrete Cosine Transform.

Author
  Tony Ottosson and Adam Piatyszek

The functions

X = dct(x)
itpp::dct
ITPP_EXPORT void dct(const vec &in, vec &out)
Discrete Cosine Transform (DCT).

and

x = idct(X)
itpp::idct
ITPP_EXPORT void idct(const vec &in, vec &out)
Inverse Discrete Cosine Transform (IDCT).

are the dicrete cosine and inverse discrete cosine transforms of size N defined as:

where for and for .

The implementation is built upon one of the following libraries:

- FFTW (version 3.0.0 or higher)
- MKL (version 10.0.0 or higher)
- ACML (version 4.4.0 or higher).

Note
  FFTW-based implementation is the fastest for powers of two. Furthermore, the second time you call the routine with the same size, the calculation is much faster due to many things were calculated and stored the first time the routine was called.
  Achieving maximum runtime efficiency with the FFTW library on some computer architectures requires that data are stored in the memory with a special alignment (to 16-byte boundaries). The IT++ memory management functions and container classes do not generally allocate memory aligned this way, and as a result calling FFTW via the IT++ interface (i.e. the dct()/idct() function) may be slower than using the FFTW library directly. Therefore, FFTW users concerned about maximum possible performance may want to consider the possibility of calling the FFTW library and its memory management/allocation routines directly, bypassing the IT++ storage classes and the dct()/idct() interface to FFTW.

## Function Documentation

## dct()

ITPP_EXPORT vec itpp::dct | ( | const vec & | in,
|  | const int | N )

Discrete Cosine Transform (DCT) with zero-padding up to size N.

First N points of input vector are used to perform the transform if N < length(in). Padding with 0's is performed if N > length(in).

## idct()

ITPP_EXPORT vec itpp::idct | ( | const vec & | in,
|  | const int | N )

Inverse Discrete Cosine Transform (IDCT) with zero-padding up to size N.

First N points of input vector are used to perform the transform if N < length(in). Padding with 0's is performed if N > length(in).

Generated on for IT++ by Doxygen 1.15.0