[vorbis-dev] More mdct questions
Dave, Anish
adave at ea.com
Mon Oct 23 14:20:25 PDT 2000
Sorry for starting another topic, this is actually a reply to Segher's post
on Sun Oct 22 on the 'mdct question' topic. I wasn't subscribed properly
and so I didn't get email confirmation and thus can't add to that thread.
So Segher, if the equation is indeed what you say it is, then replacing
mdct_backward with this version should work, but it doesn't.
Am I applying it incorrectly?
void mdct_backward(mdct_lookup *init, double *in, double *out) // I call
this with in != out
{
// For 256 size blocks, coef are in[0..127]
// For 2048 size blocks, coef are in[0..1023]
int N = init->n / 4;
for( int j = 0; j < 4*N; j++ )
{
double sum = 0;
for( int k = 0; k < 2*N; k++ )
{
sum += in[k]*cos(M_PI*(2*j+1+N)*(2*k+1)/8/N);
}
out[j] = sum;
}
}
> It just a normal shifted mdct, like the one used in mpeg layer 3.
> it's equations are:
> (time domain: a_j, freq domain: b_k; w_j is the window)
> forward:
> b_k = sum(j=0..4N-1) a_j * w_j * cos( (2k+1)(2j+1+-N) / 8N ) // forward
> a_j = w_j * sum(k=0..2N-1) a_j * cos( (2k+1)(2j+1+-N) / 8N ) // backward
(missing PI in the cos, and a_j should be b_k in summation)
> where +- means: I'm not sure whether it is + or -, but I think it is +
> (forward as well as backward).
> k is 0..2N-1, j is 0..4N-1.
---------------------------
Anish Dave
Univ. of Waterloo
Comp Sci.
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list