SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
sspmod_idct.c File Reference

Inverse Discrete Cosine Transform. More...

Functions

int spr_idct_setup (SprSspInfo *Info, const char **descript, void *aux_info)
 
int spr_idct_process (SprSspInfo *Info, const void *frame_in, void *frame_out)
 
void spr_idct_free (SprSspInfo *Info)
 

Detailed Description

Inverse Discrete Cosine Transform.

Calculate the IDCT in a "symmetrical" or "non-symmetrical" way.

symmetrical: with i: 0..nparam
   wcos[i][j] = cos(i * (j+.5) * M_PI / nspec)  (with j : 0..nspec-1)
   out[i]     = sum(wcos[i][j] * spec[j])       (with j : 0..nspec-1)
   out[i]     = out[i] / nspec

non-symmetrical: with i: 0..nparam
   wcos[i][j] = cos(i * j * M_PI / (nspec-1))   (with j : 1..nspec-1)
   out[i]     = spec[0] * 1 + spec[nspec-1] * wcos[i][nspec-1] +
                sum(2 * wcos[i][j] * spec[j])   (with j : 1..nspec-2)
   out[i]     = out[i] / (2*(nspec-1))

The difference between the two types is the following: in the symmetrical case, all spectral parameters are of equal importance, and they are treated this way. The non-symmetrical case occurs e.g. when an 256 point FFT is taken (points 0..255), then only the power is retained, and points 129..255 are omitted since the are the same as points 1..127 (thus losing the Fourier property of constant energy). Then in fact, these points 1..127 are of double importance compared to the point 0 and 128. This result in the factor 2 in the formulas for points 1..127, and in the factor (2*(nspec-1)). If the input spectrum is a power spectrum, the output will be the autocorrelation. If the input spectrum gives the power in dB, the output parameters are the cepstra. The TRACKTYPE key is changed in this way. The choiche between symmetrical and non-symmetrical IDCT is based on the FILTERSHAPE key, set when using the filter bank. From the formulas for these banks, it is clear that REC and TRI banks, omitting the 0th point as center frequency, result in the symmetrical type of IDCT, but the SCHROEDER bank having a value for a center around the 0th point (in fact, the value for the 1st point is copied), needs the non-symmetrical type of IDCT. Of course, if no filter bank was applied, for the normal fft spectrum, the non-symmetrical type of IDCT has to be used.


[idct]
nparam <number>
Cepstra 0..nparam (default 12) or autocorrelations 0..nparam (default 10) are calculated.
symmetric <yes/no>
Use the (a)symmetric IDCT transform; by default, the assymetric version is used for power spectra and SCHROEDER filterbanks.

See Also
ssp_master.c
Author
Tom Claes (algorithms)
Jacques Duchateau (ssp routines, comment)
Date
25 May 1994 and 18 Nov 1994