HydrogenAudio

Lossy Audio Compression => AAC => AAC - Tech => Topic started by: siddharth vaghela on 2006-05-02 11:37:37

Title: AAC IMDCT algorithms
Post by: siddharth vaghela on 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?

thank u in advance

siddharth
Title: AAC IMDCT algorithms
Post by: kwwong on 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?

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.
Title: AAC IMDCT algorithms
Post by: SebastianG on 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 (http://www.hydrogenaudio.org/forums/index.php?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
Title: AAC IMDCT algorithms
Post by: siddharth vaghela on 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 (http://www.hydrogenaudio.org/forums/index.php?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