 Topic: AAC IMDCT algorithms (Read 6855 times)
0 Members and 1 Guest are viewing this topic.

## AAC IMDCT algorithms ##### 2006-05-02 11:37:37
hi,
im tyring to search for algorithms for imdct which can outperform or match the imdct implementation in FAAD2. all the literature for fast and efficient implementations of imdct are on acm or ieee portals which are not available to me

so can u suggest and provide me with links to some literature for the same?

siddharth

## AAC IMDCT algorithms ##### Reply #1 – 2006-05-12 03:07:37
hi,
im tyring to search for algorithms for imdct which can outperform or match the imdct implementation in FAAD2. all the literature for fast and efficient implementations of imdct are on acm or ieee portals which are not available to me

so can u suggest and provide me with links to some literature for the same?

siddharth

I cannot remember the mathematical details right now.. but you can manipulate the equation of the IMDCT and implement it with 2, 4 , 8 or 16 FFTs, depending on the size of your IMDCT block size.

## AAC IMDCT algorithms ##### Reply #2 – 2006-05-12 08:29:26
Here's described how you can decompose the (i)MDCT into a set of butterflies and a DCT4:
http://www.hydrogenaudio.org/forums/index....showtopic=20449
(the "mdct core transform" I was referring to is actually a type-4 DCT)

A Matlab implemetation for a fast type-4 DCT is following: The length of x should be a power of two and must be even.
Code: [Select]
`function [ y ] = fastdct4( x )% make x a real-valued row vectorx = real(x(:))';% N real values -> N/2 complex valuesz = (x(1:2:length(x)) + i*x(length(x):-2:1));% pre twiddlingz = z .* exp((0.5:2:length(x))./length(x).*(-pi/2).*i);% FFTz = fft(z);% post twiddlingz = z .* exp( (0:(length(z)-1)).*(-pi/length(x)).*i );% extracting DCT4 coeffs and scaling ...scale = sqrt(2/length(x));y = zeros(1,length(x));y(1:2:length(y)) =  real(z) .* scale;y(2:2:length(y)) = -imag(z(length(z):-1:1)) .* scale;return;`

Seb

edit: i just fixed a "sign bug" for odd coefficients

## AAC IMDCT algorithms ##### Reply #3 – 2006-05-19 07:53:53
thank u very much for the code!!
we are working on the same algorithm and trying to make it faster by tweaking the pointer manipulations in c.

thankx once again.

Here's described how you can decompose the (i)MDCT into a set of butterflies and a DCT4:
http://www.hydrogenaudio.org/forums/index....showtopic=20449
(the "mdct core transform" I was referring to is actually a type-4 DCT)

A Matlab implemetation for a fast type-4 DCT is following: The length of x should be a power of two and must be even.
Code: [Select]
`function [ y ] = fastdct4( x )% make x a real-valued row vectorx = real(x(:))';% N real values -> N/2 complex valuesz = (x(1:2:length(x)) + i*x(length(x):-2:1));% pre twiddlingz = z .* exp((0.5:2:length(x))./length(x).*(-pi/2).*i);% FFTz = fft(z);% post twiddlingz = z .* exp( (0:(length(z)-1)).*(-pi/length(x)).*i );% extracting DCT4 coeffs and scaling ...scale = sqrt(2/length(x));y = zeros(1,length(x));y(1:2:length(y)) =  real(z) .* scale;y(2:2:length(y)) = -imag(z(length(z):-1:1)) .* scale;return;`

Seb

edit: i just fixed a "sign bug" for odd coefficients