MDCT

In practice, there are more than two windows, because a transition window is needed to switch between the long and short. Also, the windows always overlap two to one (a common technique when applying Fourier transforms).


Click to enlarge

So, the advantage of MDCT is that the block length can change dynamically. More active parts of the input signal equate to shorter blocks, while static parts of the input signal equal longer blocks.

Here's some of the math involved:

The MDCT equation is:

X sub t (m) =

SUMMATION k=0 to n-1 f(k) x sub t (k) cos ( pie/2n (2k + 1 + n/2) (2m +1))

for m = 0 to n/2 -1

Where x(k) is the amplitude of sample number k (as always lowercase x indicates time domain, while uppercase X indicate frequency domain).