Modified discrete cosine transform: Difference between revisions

Content deleted Content added
m Definition: fmt., punct.
m Window functions: punct., fmt.
Line 31:
== Window functions ==
 
[[file:MDCT_WF.png|thumb|upright=1.8|'''MDCT window functions:'''<br> blue:{{snd}} Cosinecosine, red:{{snd}} Sine–Cosinesine–cosine, green:{{snd}} modified Kaiser–Bessel]]
 
In typical signal-compression applications, the transform properties are further improved by using a [[window function]] ''w''<sub>''n''</sub> (''n'' = 0, ..., 2''N''−1&nbsp;−&nbsp;1) that is multiplied with ''x''<sub>''n''</sub> in the MDCT and with ''y''<sub>''n''</sub> in the IMDCT formulas, above, in order to avoid discontinuities at the ''n'' = 0 and 2''N'' boundaries by making the function go smoothly to zero at those points. (That is, the window function is applied to the data ''before'' the MDCT or ''after'' the IMDCT.) In principle, ''x'' and ''y'' could have different window functions, and the window function could also change from one block to the next (especially for the case where data blocks of different sizes are combined), but for simplicity we consider the common case of identical window functions for equal-sized blocks.
 
The transform remains invertible (that is, TDAC works), for a symmetric window ''w''<sub>''n''</sub> = ''w''<sub>2''N''−1−''n''</sub>, as long as ''w'' satisfies the Princen-BradleyPrincen–Bradley condition:
: <math>w_n^2 + w_{n + N}^2 = 1.</math>.
 
:<math>w_n^2 + w_{n + N}^2 = 1</math>.
 
Various window functions are used. A window that produces a form known as a modulated lapped transform (MLT)<ref>H. S. Malvar, "Lapped Transforms for Efficient Transform/Subband Coding", ''IEEE Trans. on Acoustics, Speech, and Signal Processing'', vol. 38, no. 6, pp. 969–978 (Equation 22), June 1990.</ref><ref>H. S. Malvar, "Modulated QMF Filter Banks with Perfect Reconstruction", ''Electronics Letters'', vol. 26, no. 13, pp. 906–907 (Equation 13), June 1990.</ref> is given by
 
:<math>w_n = \sin \left[\frac{\pi}{2N} \left(n+\frac{1}{2}\right) \right]</math>
 
Various window functions are used. A window that produces a form known as a modulated lapped transform (MLT)<ref>H. S. Malvar, "Lapped Transforms for Efficient Transform/Subband Coding", ''IEEE Trans. on Acoustics, Speech, and Signal Processing'', vol. &nbsp;38, no. &nbsp;6, pp. &nbsp;969–978 (Equation &nbsp;22), June 1990.</ref><ref>H. S. Malvar, "Modulated QMF Filter Banks with Perfect Reconstruction", ''Electronics Letters'', vol. &nbsp;26, no. &nbsp;13, pp. &nbsp;906–907 (Equation &nbsp;13), June 1990.</ref> is given by
: <math>w_n = \sin \left[\frac{\pi}{2N} \left(n + \frac{1}{2}\right) \right]</math>
and is used for MP3 and MPEG-2 AAC, and
: <math>w_n = \sin \left( \frac{\pi}{2} \sin^2 \left[\frac{\pi}{2N} \left(n + \frac{1}{2}\right) \right] \right)</math>
 
:<math>w_n = \sin \left( \frac{\pi}{2} \sin^2 \left[\frac{\pi}{2N} \left(n+\frac{1}{2}\right) \right] \right)</math>
 
for Vorbis. AC-3 uses a [[Kaiser_window#Kaiser–Bessel-derived_(KBD)_window|Kaiser–Bessel derived (KBD) window]], and MPEG-4 AAC can also use a KBD window.