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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
"Dave, Anish" wrote:> > 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?Maybe, can't see how you call it.> > 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);It can be -N instead of +N. Don't know right now. Maybe my formula has a mistake; look at any of the mpeg layer III techdocs on the web to find the correct formula. Maybe you are applying the window in one of your test cases, but not in the other. Maybe init->n is not what you think; when I was doing my mdct optimizations, I thought the value of init->n was a bit illogical.> } > 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)I'm too lazy to write PI in my own notes. And a cut'n'paste error as well. Ouch. Sorry.> > 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.Dagdag, Segher --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Hey thanks for your help! Your equation works. It's the same as the one given in the eusipco.corrected.ps document minus the 4/n term outside the summation. So was that (4/n) term the typo in the document? Are there any typos in the FFT algorithm described? If so, what are they? I wasn't able to tell by comparing the vorbis code to the algorithm in the paper (I'm not a dsp/fft/dct guru). Thanks!> -----Original Message----- > From: Segher Boessenkool [mailto:segher@wanadoo.nl] > Sent: Monday, October 23, 2000 4:00 PM > To: vorbis-dev@xiph.org > Subject: Re: [vorbis-dev] More mdct questions > > > > > > b_k = sum(j=0..4N-1) a_j * w_j * cos( (2k+1)(2j+1+-N) * > PI / 8N ) // forward > > > > a_j = w_j * sum(k=0..2N-1) b_k * cos( (2k+1)(2j+1+-N) * > PI / 8N ) // backward > > Oh, and maybe +-2N instead of +-N > > Math on a keyboard is kind of difficult, especially when the audience > don't all > speak TeX. Anyway, go to Google and search for mdct (or dct IV). You > will find it. > > Ciao, > > Segher > > --- >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@xiph.org' > containing only the word 'unsubscribe' in the body. No > subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered. >--- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Here: http://www.lte.e-technik.uni-erlangen.de/~spo/eusipco.corrected.ps> -----Original Message----- > From: Marshall Eubanks [mailto:tme@21rst-century.com] > Sent: Tuesday, October 24, 2000 5:41 PM > To: vorbis-dev@xiph.org > Subject: Re: [vorbis-dev] More mdct questions > > > "Dave, Anish" wrote: > > > Hey thanks for your help! Your equation works. It's the > same as the one > > given in the eusipco.corrected.ps document minus the 4/n > term outside the > > summation. So was that (4/n) term the typo in the document? > > > > Hello; > > Can you tell me where I can find eusipco.corrected.ps ? > > > Regards > Marshall Eubanks > > > T.M. Eubanks > Multicast Technologies, Inc > 10301 Democracy Lane, Suite 410 > Fairfax, Virginia 22030 > Phone : 703-293-9624 > Fax : 703-293-9609 > e-mail : tme@on-the-i.com tme@multicasttech.com > > http://www.on-the-i.com http://www.buzzwaves.com > > > > --- >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@xiph.org' > containing only the word 'unsubscribe' in the body. No > subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered. >--- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> "Dave, Anish" wrote: > > > > Hey thanks for your help! Your equation works. It's the > same as the one > > Which one? I guess the +2N one.Yup, the +2N one.> > > given in the eusipco.corrected.ps document minus the 4/n > term outside the > > summation. So was that (4/n) term the typo in the document? > > It's not a typo. The 4/N is necessary to make the backward > transform a true > inverse to the forward transform; otherwise, it will have a > N/4 scaling. But > scaling is not a problem for our purposes, so it's omitted > (or maybe it is > fused with the window multiply; don't know it off my head, > and much too lazy > to look it up).Hm. I'll try to prove to myself that it really *is* the inverse.> > > > > Are there any typos in the FFT algorithm described? If so, > what are they? > > I wasn't aware there is a FFT algorithm described in the > Eusipco document?By FFT, I meant the FFT-method of solving the imdct equation (steps 1-8). Sorry.> > Maybe Monty can answer what the typos are; there are a few obvious > typos, but > even then it won't work. So I guess Monty found the > non-obvious (to me) > typo(s) as well.That would be *really* helpful, Monty.> > > I wasn't able to tell by comparing the vorbis code to the > algorithm in the > > paper (I'm not a dsp/fft/dct guru). > > The skills you need are a lot of programming experience, so > the code is just > like your native tongue to you; and some fluency in algebra > and calculus.Yeah yeah, practice makes perfect. --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.