#include <DCT.h>
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) |
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:
The DCT type can be selected using the setDCTType() taking as argument a DCTType.
| enum DCTType |
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.
| 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.
| 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. |
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 | |||
| ) |
| int inputSize | ( | ) | const |
| 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.
Referenced by DCT().
| int dctSize | ( | ) | const |
| void setDctSize | ( | int | size, | |
| bool | callSetup = true | |||
| ) |
1.5.6