DCT Class Reference

Algorithm to perform a Discrete Cosine Transform of a vector of Real values. More...

#include <DCT.h>

List of all members.

Public Types

enum  DCTType {
  I = 0, II = 1, III = 2, IV = 3,
  OCTAVE = 4
}
 Specifies the type of the DCT. More...

Public Member Functions

 DCT (int inputSize=1024, int dctSize=1024, bool scale=false, DCTType dctType=OCTAVE)
 ~DCT ()
void process (const MatrixXR &frames, MatrixXR *dct)
DCTType dctType () const
void setDctType (DCTType type, bool callSetup=true)
int inputSize () const
void setInputSize (int size, bool callSetup=true)
int dctSize () const
void setDctSize (int size, bool callSetup=true)


Detailed Description

Algorithm to perform a Discrete Cosine Transform of a vector of Real values.

This class represents an object to perform Discrete Cosine Transform (DCT) on Real data. The algorithm takes as input N-point vectors of Real values and returns M-point vectors of Real values.

5 types of DCT are implemented:

  1. Type I
  2. Type II
  3. Type III
  4. Type IV
  5. Octave's Implementation

The DCT type can be selected using the setDCTType() taking as argument a DCTType.

Author:
Ricard Marxer
See also:
FFT

Member Enumeration Documentation

enum DCTType

Specifies the type of the DCT.

See also:
dctType
Enumerator:
I  DCT Type-I
II  DCT Type-II
III  DCT Type-III
IV  DCT Type-IV
OCTAVE  Octave's implementation


Constructor & Destructor Documentation

DCT ( int  inputSize = 1024,
int  dctSize = 1024,
bool  scale = false,
DCTType  dctType = OCTAVE 
)

Constructs a DCT object with the given inputSize, dctSize, scale, dctType parameters.

References setDctSize(), setDctType(), and setInputSize().

~DCT (  ) 

Destroys the algorithm and frees its resources.


Member Function Documentation

void process ( const MatrixXR &  frames,
MatrixXR *  dct 
)

Performs a Discrete Cosine Transform on each of the rows of frames and puts the resulting DCT in the rows of dct.

Parameters:
frames matrix of Real values. The number of columns of frames must be equal to the inputSize.
dct pointer to a matrix of Real values for the output. The matrix should have the same number of rows as frames and dctSize columns.
Note that if the output matrix is not of the required size it will be resized, reallocating a new memory space if necessary.

Referenced by MFCC::process().

DCT::DCTType dctType (  )  const

Returns the type of the DCT

By default it is OCTAVE.

void setDctType ( DCTType  type,
bool  callSetup = true 
)

Specifies the type of the DCT

Referenced by DCT().

int inputSize (  )  const

Returns the size of the input arrays. The default is 1024.

See also:
setInputSize()

void setInputSize ( int  size,
bool  callSetup = true 
)

Specifies the size of the input. The given size must be higher than 0. Note that if size is a power of 2 the algorithm will perform faster.

See also:
inputSize()

Referenced by DCT().

int dctSize (  )  const

Returns the output size of the DCT

Note that the result will when performing the DCT at the most inputSize coefficients will be outputed.

By default it is 1024.

void setDctSize ( int  size,
bool  callSetup = true 
)

Specifies the output size of the DCT

Note that the result will when performing the DCT at the most inputSize coefficients will be outputed.

By default it is 1024.

Referenced by DCT().


The documentation for this class was generated from the following files:

Generated on Tue Mar 31 20:38:33 2009 for Loudia by  doxygen 1.5.6