IT++ Logo Newcom Logo

Discrete Cosine Transforms (DCT)

One dimensional Dicrete Cosine Transform. More...

Functions

void itpp::dct (const vec &in, vec &out)
 Discrete Cosine Transform (DCT).
vec itpp::dct (const vec &in)
 Discrete Cosine Transform (DCT).
void itpp::idct (const vec &in, vec &out)
 Inverse Discrete Cosine Transform (IDCT).
vec itpp::idct (const vec &in)
 Inverse Discrete Cosine Transform (IDCT).

Detailed Description

One dimensional Dicrete Cosine Transform.

Author:
Tony Ottosson and Adam Piatyszek
The functions
 X = dct(x) 
and
 x = idct(X) 
are the dicrete cosine and inverse discrete cosine transforms of size N defined as:

\[ X(k) = w(k) \sum_{j=0}^{N-1} x(j) \cos \left(\frac{(2j+1)k \pi}{2N} \right) \]

\[ x(j) = \sum_{k=0}^{N-1} w(k) X(k) \cos \left(\frac{(2j+1)k \pi}{2N} \right) \]

where $w(k) = 1/sqrt{N}$ for $k=0$ and $w(k) = sqrt{2/N}$ for $k\geq 1$.

The implementation is built upon one of the following libraries:

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

void itpp::dct ( const vec in,
vec out 
)

Discrete Cosine Transform (DCT).

Definition at line 519 of file transforms.cpp.

References it_error.

Referenced by itpp::dct().

vec itpp::dct ( const vec in  ) 

Discrete Cosine Transform (DCT).

Definition at line 595 of file transforms.cpp.

References itpp::dct().

void itpp::idct ( const vec in,
vec out 
)

Inverse Discrete Cosine Transform (IDCT).

Definition at line 524 of file transforms.cpp.

References it_error.

Referenced by itpp::idct().

vec itpp::idct ( const vec in  ) 

Inverse Discrete Cosine Transform (IDCT).

Definition at line 602 of file transforms.cpp.

References itpp::idct().

SourceForge Logo

Generated on Sat Aug 25 23:40:31 2007 for IT++ by Doxygen 1.5.2