Skip to main content

Topic: AAC IMDCT algorithms (Read 6383 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
AAC IMDCT algorithms
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?

thank u in advance

siddharth

  • kwwong
  • [*][*][*]
AAC IMDCT algorithms
Reply #1
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?

thank u in advance

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.

  • SebastianG
  • [*][*][*][*][*]
  • Developer
AAC IMDCT algorithms
Reply #2
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 vector
x = real(x(:))';

% N real values -> N/2 complex values
z = (x(1:2:length(x)) + i*x(length(x):-2:1));

% pre twiddling
z = z .* exp((0.5:2:length(x))./length(x).*(-pi/2).*i);

% FFT
z = fft(z);

% post twiddling
z = 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
  • Last Edit: 12 May, 2006, 03:53:20 AM by SebastianG

AAC IMDCT algorithms
Reply #3
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 vector
x = real(x(:))';

% N real values -> N/2 complex values
z = (x(1:2:length(x)) + i*x(length(x):-2:1));

% pre twiddling
z = z .* exp((0.5:2:length(x))./length(x).*(-pi/2).*i);

% FFT
z = fft(z);

% post twiddling
z = 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