HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: antrox87 on 2009-06-06 14:49:18

Title: Tremor's mdct backward function
Post by: antrox87 on 2009-06-06 14:49:18
Hi to all,
I'm trying to understand the Tremor's code that implements the iMDCT.
First of all.. Does it implement iMDCT throught a mechanism of rotation and FFT? I'm not sure of it..
If it's true.. where does implement the presorting?
Then.. the parameter "n" defines the dimension on witch the iMDCT is calculated (I know that the range on witch n is defined could be only between 64 and 8192 , multiples of 2).  Is it the input's array dimension?

Thanks for answers

Title: Tremor's mdct backward function
Post by: saratoga on 2009-06-06 15:50:29
First of all.. Does it implement iMDCT throught a mechanism of rotation and FFT? I'm not sure of it..


It does not.  FFT based iMDCTs are very easy to spot since they nearly all look the same.  See mdct.c in ffmpeg (or the unrelated but nearly identically written mdct.c in libfaad) for good examples of these.

Then.. the parameter "n" defines the dimension on witch the iMDCT is calculated (I know that the range on witch n is defined could be only between 64 and 8192 , multiples of 2).  Is it the input's array dimension?


Correct.  Its the input array's dimension (number of frequency domain samples), typically 256 or 2048 for vorbis. 



Title: Tremor's mdct backward function
Post by: antrox87 on 2009-06-06 17:40:32
It does not.  FFT based iMDCTs are very easy to spot since they nearly all look the same.  See mdct.c in ffmpeg (or the unrelated but nearly identically written mdct.c in libfaad) for good examples of these.


So.. what does implement?? How is it implemented?
I thought that it was following the algorithm to implement a MDCT thorugh an FFT in the reverse way...
Title: Tremor's mdct backward function
Post by: saratoga on 2009-06-07 00:43:00
It does not.  FFT based iMDCTs are very easy to spot since they nearly all look the same.  See mdct.c in ffmpeg (or the unrelated but nearly identically written mdct.c in libfaad) for good examples of these.


So.. what does implement?? How is it implemented?


Check the comments in the code.  The author gives a reference for his particular MDCT.  Unfortunately, its a book which I've never bothered to track down so I can't say anything specific about it.  However, if you search for IMDCTs, you'll see that theres quite a few different algorithms out there for computing them (though the FFT method is most popular).

I thought that it was following the algorithm to implement a MDCT thorugh an FFT in the reverse way...


The forward and backward MDCTs are nearly identical, and are extremely simple.  Most are just a few lines of code for rotations, then an FFT, then a few more lines of code for post rotations.  The algorithm in Tremor is clearly quite different since its both very long and has no FFT
Title: Tremor's mdct backward function
Post by: OggY68 on 2009-07-08 09:24:32
It does not.  FFT based iMDCTs are very easy to spot since they nearly all look the same.  See mdct.c in ffmpeg (or the unrelated but nearly identically written mdct.c in libfaad) for good examples of these.


So.. what does implement?? How is it implemented?


Check the comments in the code.  The author gives a reference for his particular MDCT.  Unfortunately, its a book which I've never bothered to track down so I can't say anything specific about it.  However, if you search for IMDCTs, you'll see that theres quite a few different algorithms out there for computing them (though the FFT method is most popular).

I thought that it was following the algorithm to implement a MDCT thorugh an FFT in the reverse way...


The forward and backward MDCTs are nearly identical, and are extremely simple.  Most are just a few lines of code for rotations, then an FFT, then a few more lines of code for post rotations.  The algorithm in Tremor is clearly quite different since its both very long and has no FFT


Hmmm,    ,  actually the mdct_backward function in Tremor's mdct.c file does implement an FFT.  I see bitreverse, butterfly etc methods, all the building blocks of a good old Fast Fourier Transform:
http://www.dspguide.com/ch12/2.htm (http://www.dspguide.com/ch12/2.htm)
Title: Tremor's mdct backward function
Post by: saratoga on 2009-07-08 16:06:41
Hmmm,    ,  actually the mdct_backward function in Tremor's mdct.c file does implement an FFT.  I see bitreverse, butterfly etc methods, all the building blocks of a good old Fast Fourier Transform:
http://www.dspguide.com/ch12/2.htm (http://www.dspguide.com/ch12/2.htm)


If you can pick out a DFT in there, then good work!  But don't assume that just because theres butterflies and bit reversal that its an FFT.  The MDCT is itself a discretized Fourier transform, so it can be computed using much the same decomposition methods.
Title: Tremor's mdct backward function
Post by: ruchi sharma on 2009-10-14 11:43:01
Hi to all,
I'm trying to understand the Tremor's code that implements the iMDCT.
First of all.. Does it implement iMDCT throught a mechanism of rotation and FFT? I'm not sure of it..
If it's true.. where does implement the presorting?
Then.. the parameter "n" defines the dimension on witch the iMDCT is calculated (I know that the range on witch n is defined could be only between 64 and 8192 , multiples of 2).  Is it the input's array dimension?

Thanks for answers



Hi,
i am working on MDCT Backward of tremor's code.
i need to replace this to Duhamels algorithim.
can u plz help me out by any suggesstions or inputs??
i need to replace existing MDCT to duhamels FFT  so as to increase the performance.
Thanks a lot.

Regards,
Ruchi
Title: Tremor's mdct backward function
Post by: saratoga on 2009-10-14 14:26:05
Hi,
i am working on MDCT Backward of tremor's code.
i need to replace this to Duhamels algorithim.
can u plz help me out by any suggesstions or inputs??
i need to replace existing MDCT to duhamels FFT  so as to increase the performance.
Thanks a lot.


I tried several FFT based IMDCTs in place of tremor's and all were slower.  You will need a very fast FFT algorithm to beat Tremor.  Lately I've been working on a slit radix version, but I have no idea if its going to be any faster

If you want to try, take a look at one of the mdct.c files mentioned above and use your own FFT.