Modified discrete cosine transform: Difference between revisions

Content deleted Content added
eliminate stutter in lead sentence
Line 57:
As can be seen by inspection of the definitions, for '''even''' ''N'' the MDCT is essentially equivalent to a DCT-IV, where the input is shifted by ''N''/2 and two ''N''-blocks of data are transformed at once. By examining this equivalence more carefully, important properties like TDAC can be easily derived.
 
In order to define the precise relationship to the DCT-IV, one must realize that the DCT-IV corresponds to alternating even/odd boundary conditions: even at its left boundary (around ''n''&#8239;=&#8239;&minus;1/2), odd at its right boundary (around ''n''&#8239;=&#8239;''N''&#8239;&minus;&#8239;1/2), and so on (instead of periodic boundaries as for a [[discrete Fourier transform|DFT]]). This follows from the identities <math>\cos\left[\frac{\pi}{N} \left(-n-1+\frac{1}{2}\right) \left(k+\frac{1}{2}\right)\right] = \cos\left[\frac{\pi}{N} \left(n+\frac{1}{2}\right) \left(k+\frac{1}{2}\right)\right]</math> and <math>\cos\left[\frac{\pi}{N} \left(2N-n-1+\frac{1}{2}\right) \left(k+\frac{1}{2}\right)\right] = -\cos\left[\frac{\pi}{N} \left(n+\frac{1}{2}\right) \left(k+\frac{1}{2}\right)\right]</math>. Thus, if its inputs are an array ''x'' of length ''N'', we can imagine extending this array to (''x'', &minus;''x''<sub>''R''</sub>, &minus;''x'', ''x''<sub>''R''</sub>, ...) and so on, where ''x''<sub>''R''</sub> denotes ''x'' in reverse order.
 
Consider an MDCT with 2''N'' inputs and ''N'' outputs, where we divide the inputs into four blocks (''a'', ''b'', ''c'', ''d'') each of size ''N''/2. If we shift these to the right by ''N''/2 (from the +''N''/2 term in the MDCT definition), then (''b'', ''c'', ''d'') extend past the end of the ''N'' DCT-IV inputs, so we must "fold" them back according to the boundary conditions described above.
Line 69:
:IMDCT(MDCT(''a'', ''b'', ''c'', ''d'')) = (''a''&minus;''b''<sub>''R''</sub>, ''b''&minus;''a''<sub>''R''</sub>, ''c''+''d''<sub>''R''</sub>, ''d''+''c''<sub>''R''</sub>) / 2.
 
Half of the IMDCT outputs are thus redundant, as ''b''&minus;''a''<sub>''R''</sub> = &minus;(''a''&minus;''b''<sub>''R''</sub>)<sub>''R''</sub>, and likewise for the last two terms. If we group the input into bigger blocks ''A'',''B'' of size ''N'', where ''A''&#8239;=&#8239;(''a'', ''b'') and ''B''&#8239;=&#8239;(''c'', ''d''), we can write this result in a simpler way:
 
:IMDCT(MDCT(''A'', ''B'')) = (''A''&minus;''A''<sub>''R''</sub>, ''B''+''B''<sub>''R''</sub>) / 2