Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: AAC IMDCT algorithms (Read 8841 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

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.

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

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