{"id":170,"date":"2013-03-24T09:29:46","date_gmt":"2013-03-24T17:29:46","guid":{"rendered":"http:\/\/www.earlevel.com\/main\/?p=170"},"modified":"2019-02-24T15:08:53","modified_gmt":"2019-02-24T23:08:53","slug":"perspective-on-dither","status":"publish","type":"post","link":"https:\/\/www.earlevel.com\/main\/2013\/03\/24\/perspective-on-dither\/","title":{"rendered":"Perspective on dither"},"content":{"rendered":"<p>Recently, I&#8217;ve had lengthy discussions on the topic of dither with a couple of different people\u2014of opposite views. One believes that everything should be dithered, including truncations to 24-bit. The other feels that dither is a waste of time even for 16-bit, and is needed only for shorter word lengths, rarely used today.<\/p>\n<p>This got me thinking about how to give perspective on the truncation distortion and dither levels we&#8217;re talking about for 16-bit and 24-bit files. The usual demonstration would be to find or create a recording that is not unrealistic, yet produces noticeable truncation distortion at the bit levels we&#8217;re interested in\u2014which is mainly near the floor of 16-bit and 24-bit samples.<\/p>\n<p>But it occurred to me that people don&#8217;t have a good idea of how loud the distortion levels are by themselves, and that should be the place to start. I thought of a way to generate signals of those levels with no distortion of their own.<\/p>\n<h3>Perfect audio<\/h3>\n<p>Are you ready to listen to perfect digital audio files? By perfect I mean that they are exactly what they are designed to be. If I&#8217;d tried for low-level sine waves, for instance, they would be crude, distorted approximations. Instead, I created square waves at precise bit levels to avoid quantization errors, synchronized to the sample rate to avoid aliasing. The sample values are exact\u2014they are not values that are &#8220;close&#8221; to expected values\u2014and the harmonic content is representative of truncation effects at those levels.<\/p>\n<p>The signal begins with the LSB set (we&#8217;ll call this &#8220;+1&#8221;), then the next sample is negated (-1). This repeats (+1, -1, +1, -1, \u2026) for a short duration, then the period increases by one sample (+1, +1, -1, -1, +1, +1, -1, -1, \u2026) for a short duration, and the process continues, increasing the period by one sample each time. This is a classic &#8220;divide by n&#8221; oscillator. You&#8217;ll notice that the pitch resolution is very poor at the beginning, as the second tone is an octave down from the first (which is at Nyquist and will be swallowed by your reconstruction filter), but gets better and better as pitch drops and each additional sample is a small percentage of the period. The waveform amplitude is not the smallest possible\u2014toggling between +1 and 0 would do that\u2014but is representative of the amplitude of the smallest truncation effects for bipolar signals.<\/p>\n<p>So, the sound starts dropping at discrete frequencies, and moves increasingly towards a smooth frequency sweep.<\/p>\n<p><a href=\"\/main\/wp-content\/uploads\/2013\/03\/test_wave_chop.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/main\/wp-content\/uploads\/2013\/03\/test_wave_chop.png\" alt=\"\" title=\"test_wave_chop\" width=\"613\" height=\"182\" class=\"alignnone size-full wp-image-171\" srcset=\"https:\/\/www.earlevel.com\/main\/wp-content\/uploads\/2013\/03\/test_wave_chop.png 613w, https:\/\/www.earlevel.com\/main\/wp-content\/uploads\/2013\/03\/test_wave_chop-300x89.png 300w\" sizes=\"(max-width: 613px) 100vw, 613px\" \/><\/a><\/p>\n<h3>Listening tests<\/h3>\n<p>Listen to these files on a quality monitoring system. First, the generated test signal toggling at the level of the fifth bit, moderately loud, so that you can become familiar with what you&#8217;ll be listening for at the lower levels:<\/p>\n<p><a href='\/main\/wp-content\/uploads\/2013\/03\/level_test_5-bit.wav'>Sweep at the 5th bit level (-24.1 dB)<\/a><\/p>\n<p>All files are 24-bit. The difference is that the +1 level for the 24-bit version is the 24th bit, for the 16-bit version it&#8217;s the 16th bit, and for the 5-bit version it&#8217;s the 5th bit (making it 2048 times, or 66 dB, louder than the 16-bit version).<\/p>\n<p>Now for 16-bit. Start by setting your monitoring level to as loud as you would normally play music, by running a song through it. Crank it up, but don&#8217;t hurt your ears. Then play this file by itself:<\/p>\n<p><a href='\/main\/wp-content\/uploads\/2013\/03\/level_test_16-bit.wav'>Sweep at the 16th bit level (-90.3 dB)<\/a><\/p>\n<p>On a quality system at a relatively high monitoring level, you&#8217;ll have no problem hearing this sweep. After listening a few times, you might want to play a song again to remind yourself of the relative level of the test signal. Think about how difficult it would be to hear the test signal during the chunking guitars of a rock tune, but how it might be heard in the fading of quiet piano notes in classical music. (Yes, truncation noise can resulting in more of a tearing sound that the tone of the test sweep, but the relative levels are still representative of the relationship.)<\/p>\n<p>Now, 24-bit. Warning: Do NOT try to compensate by cranking your volume level. You are NOT going to hear this signal anyway, and you risk making a mistake and assaulting your ears horrifically, or blowing speakers. No matter how great you think your 24-bit converters are, it and all of your other gear generate higher levels of noise than the 24th-bit level.<\/p>\n<p><a href='\/main\/wp-content\/uploads\/2013\/03\/level_test_24-bit.wav'>Sweep at the 24th bit level (-138.5 dB)<\/a><\/p>\n<p>If you want to try other levels, use a sample editor (such as the free Audacity, or your favorite DAW) to boost the level 2x, or 6.02 dB, for every additional bit that you want to move up.<\/p>\n<p>Think about the levels, and at what bit levels you&#8217;d care to conceal truncation distortion with dither, and I&#8217;ll comment further in a future article.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I&#8217;ve had lengthy discussions on the topic of dither with a couple of different people\u2014of opposite views. One believes that everything should be dithered, including truncations to 24-bit. The other feels that dither is a waste of time even &hellip; <a href=\"https:\/\/www.earlevel.com\/main\/2013\/03\/24\/perspective-on-dither\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/posts\/170"}],"collection":[{"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":2,"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":933,"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/posts\/170\/revisions\/933"}],"wp:attachment":[{"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.earlevel.com\/main\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}