introduction.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta name="generator" content="PSPad editor, www.pspad.com" />
  6. <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  7. <link rel="stylesheet" type="text/css" href="styles/lame.css" />
  8. <title>Introduction to encoding</title>
  9. </head>
  10. <body>
  11. <div id="menu">
  12. <ul>
  13. <li><a href="index.html">Index page</a></li>
  14. <li><a href="about.html">About LAME</a></li>
  15. <li><a style="border: 0" href="introduction.html">Intro to encoding</a>
  16. <div id="submenu">
  17. <ul>
  18. <li><a href="cbr.html">CBR </a></li>
  19. <li><a href="abr.html">ABR </a></li>
  20. <li><a href="vbr.html">VBR </a></li>
  21. <li><a style="border: 0" href="ms_stereo.html">M/S Stereo</a></li>
  22. </ul>
  23. </div>
  24. </li>
  25. <li><a href="usage.html">Usage of LAME</a></li>
  26. <li><a href="history.html">Version history</a></li>
  27. <li><a href="contributors.html">Coders of LAME</a></li>
  28. <li><a href="contact.html">Contact LAME</a></li>
  29. <li><a style="border: 0" href="links.html">LAME links</a></li>
  30. </ul>
  31. </div>
  32. <div id="container">
  33. <div id="content">
  34. <div align="center">
  35. <img src="images/logo.gif" width="358" height="231" alt="LAME Official Logo" />
  36. <h2 class="hilight">Introduction to encoding</h2>
  37. </div>
  38. <h3> Introduction</h3>
  39. <p>
  40. There is a lot of confusion surrounding the terms audio compression<a href="#note1">
  41. <sup>1</sup></a>, audio encoding, and audio decoding. This section will give you
  42. an overview what audio coding (another one of these terms...) is all about.
  43. </p>
  44. <h3>The purpose of audio compression</h3>
  45. <p>Up to the advent of audio compression, high-quality digital audio data took
  46. a lot of hard disk space to store. Let us go through a short example.
  47. </p>
  48. <p>
  49. You want to sample 1 minute of your favourite song and store it on your harddisk.
  50. Because you want CD quality, you sample at 44.1 kHz, stereo, with 16 bits per sample.
  51. </p>
  52. <p>
  53. 44100 Hz means that you have 44100 values per second coming in from your sound card
  54. (or input file). Multiply that by two because you have two channels. Multiply by
  55. another factor of two because you have two bytes per value (that's what 16 bit
  56. means). The song will take up 44100 <sup>samples</sup>/<sub>s</sub> · 2 channels
  57. · 2 <sup>bytes</sup>/<sub>sample</sub> ·
  58. 60 <sup>s</sup>/<sub>min</sub> ~ 10 MBytes of storage space on your harddisk.
  59. </p>
  60. <p>
  61. In order to stream this over internet, a speed of at least 1.41<sup>Mbits</sup>/
  62. <sub>s</sub> is needed,
  63. which wasn't a common speed at all at the time MP3 was invented.
  64. If you wanted to download that, given an average 56k modem connected at 44k, it
  65. would take 1.41Mbits · 1000 <sup>kbits</sup>/<sub>Mbit</sub> / 44 kbits ~ 32
  66. times as much.
  67. <br/>This means 32 minutes just to download one minute of music!
  68. </p>
  69. <p>
  70. Digital audio coding, which - in this context - is synonymously called digital
  71. audio compression as well, is the art of minimizing storage space (or channel
  72. bandwidth) requirements for audio data. Modern perceptual audio coding techniques
  73. (like MPEG Layer III) exploit the properties of the human ear (the perception of
  74. sound) to achieve a size reduction by a factor of 11 with little or no perceptible
  75. loss of quality.
  76. </p>
  77. <p>
  78. Therefore, such schemes are the key technology for high quality low bit-rate
  79. applications, like soundtracks for CD-ROM games, solid-state sound memories,
  80. Internet audio, digital audio broadcasting systems, and the like.
  81. </p>
  82. <h3>The two parts of audio compression</h3>
  83. <p>
  84. Audio compression really consists of two parts. The first part, called encoding,
  85. transforms the digital audio data that resides, say, in a WAVE file, into a highly
  86. compressed form called bitstream. To play the bitstream on your soundcard, you
  87. need the second part, called decoding. Decoding takes the bitstream and re-expands
  88. it to a WAVE file.
  89. </p>
  90. <p>
  91. The program that effects the first part is called an audio encoder. LAME is such
  92. an encoder . The program that does the second part is called an audio decoder.
  93. Nowadays there are lots of players that decode MP3
  94. </p>
  95. <h3>Compression ratios, bitrate and quality</h3>
  96. <p>
  97. It has not been explicitly mentioned up to now: What you end up with after
  98. encoding and decoding is not the same sound file anymore: All superfluous
  99. information has been squeezed out, so to say. It is not the same file, but it
  100. will sound the same - more or less, depending on how much compression has been
  101. performed on it.
  102. </p>
  103. <p>
  104. Generally speaking, the lower the compression ratio achieved, the better the
  105. sound quality will be in the end - and vice versa.<br/>
  106. Table 1.1 gives you a rough estimate about the quality you can expect.
  107. </p>
  108. <p>
  109. Because compression ratio is a somewhat unwieldy measure, experts use the term
  110. bitrate when speaking of the strength of compression. Bitrate denotes the average
  111. number of bits that one second of audio data will take up in your compressed
  112. bitstream. Usually the units used will be kbps, which is kbits/s, or 1000 bits/s
  113. (not 1024).<br/>
  114. To calculate the number of bytes per second of audio data, simply divide the
  115. number of bits per second by eight.
  116. </p>
  117. <table align="center" cellpadding="5">
  118. <caption><strong>table 1.1:</strong> bitrate versus sound quality</caption>
  119. <tr>
  120. <th>Bitrate</th>
  121. <th>Bandwidth</th>
  122. <th>Quality comparable to</th>
  123. </tr>
  124. <tr>
  125. <td>16 kbps mono</td>
  126. <td>5.5 khz</td>
  127. <td>above shortwave radio / telephone</td>
  128. </tr>
  129. <tr>
  130. <td>32 kbps mono</td>
  131. <td>8.5 khz</td>
  132. <td>near AM (medium wave) radio</td>
  133. </tr>
  134. <tr>
  135. <td>64kbps mono, 128 kbps stereo</td>
  136. <td>16 khz</td>
  137. <td>FM radio</td>
  138. </tr>
  139. <tr>
  140. <td style="border-bottom:0px">-V 3~-V 0 (160~200 kbps) <br/>
  141. (variable bitrate)</td>
  142. <td style="border-bottom:0px">18~20 khz</td>
  143. <td style="border-bottom:0px">perceptual transparency versus CD<a href="#transparency"><sup>2</sup>
  144. </a></td>
  145. </tr>
  146. </table>
  147. <div id="notes">
  148. <ol>
  149. <li><a name="note1"></a>Audio compression (also called coding)
  150. means reduce the size (bytes) that the original source requires to be stored.
  151. This is not the same than compressors in DSP (or audio effects). The latter
  152. reduces the dynamic range of the audio so that there is less difference in
  153. perceived loudness between its strong and subtle parts.
  154. </li>
  155. <li><a name="note2"></a>Lossy encoding (as opposed to lossless) cannot guarantee
  156. transparency all of the time. This is the value accepted as the <i>sweet spot</i>.
  157. </li>
  158. </ol>
  159. </div>
  160. </div>
  161. <div id="footer">
  162. <a href="http://sourceforge.net/projects/lame"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=290&amp;type=12"
  163. alt="Get LAME (Lame Aint an MP3 Encoder) at SourceForge.net. Fast, secure and Free Open Source software downloads"
  164. border="0" height="30" width="120" /></a>
  165. <a href="http://validator.w3.org/#validate_by_upload"><img src="images/valid-xhtml10.png"
  166. alt="Valid XHTML 1.0 Transitional" border="0" height="31" width="88" /></a>
  167. <a href="http://jigsaw.w3.org/css-validator/"><img src="images/valid-css.png"
  168. alt="Valid CSS!" border="0" height="31" width="88" /></a>
  169. <p>HTML markup and design by <a
  170. href="http://www.rjamorim.com" target="_blank">Roberto Amorim</a> and <a
  171. href="http://www.maresweb.de" target="_blank">Sebastian Mares</a>. Logo by <a
  172. href="http://www.brightercreative.co.uk">Sam Fisher</a>.</p>
  173. </div>
  174. </div>
  175. </body>
  176. </html>