Do 8-bit DACs result in 8-bit audio quality?

During a “””discussion””” some weeks ago, I found that apparently some people think that any system that uses 8-bit DACs is therefore ‘8-bit quality’. A comparison was made between the Amiga and a Sound Blaster 1.0. Both may use 8-bit DACs, but the way they use them is vastly different. As a result, the quality is also different.

The Sound Blaster 1.0 is as basic as it gets. It has a single 8-bit DAC, which is mono. There is no volume or panning control. Samples are played via DMA. The sample rate is dictated by the DMA transfer that the DSP microcontroller performs, and can be set between 4 kHz and 23 kHz. In theory, the sample rate can be changed from one DMA transfer to another. But when playing continuous data, you cannot reprogram the rate without an audible glitch (as explained earlier).

I would argue that this is the basic definition of 8-bit audio quality. That is, the bit-depth of a digital signal defines how many discrete levels of amplitude the hardware supports. 8-bit results in 2^8 = 256 discrete levels of audio. This defines various parameters of your sound quality, including the dynamic range, the signal-to-noise ratio, and how large the quantization error/noise is.

This is all that the Sound Blaster does: you put in 8-bit samples, and it will send them out through the DAC at the specified sample rate. It does not modify or process the signal in any way, neither in the digital nor in the analog domain. So the signal remains 8-bit, 256 discrete levels.

The Amiga also uses 8-bit mono DACs. However, it has 4 of them, each driven by its own DMA channel. Two DACs are wired to the left output, and two DACs are wired to the right output, for stereo support. Also, each DAC has its own volume control, with 64 levels (6-bit). And this is where things get interesting. Because this volume control is implemented in a way that does not affect the accuracy of the digital signal. Effectively the volume control gives you additional bits of amplitude: they allow you to output a signal at more than 256 discrete levels.

If you only had one DAC per audio channel (left or right), this would be of limited use. Namely, you can play samples softer, while retaining the same level of quality. But you trade it in for the volume, the output level. However, the Amiga has two DACs per channel, each with their own individual volume control. This means that you can play a soft sample on one DAC, while playing a loud sample on the other DAC. And this means you actually can get more than 8-bit quality out of these 8-bit DACs.

Anyone who has ever used a MOD player or tracker on a Sound Blaster or similar 8-bit PC audio device, will know that it doesn’t quite sound like an Amiga. Why not? Because a Sound Blaster can’t do better than 8-bit quality. If you want to play a softer sample, you actually need to scale down the amplitude of the samples themselves, which means you are effectively using less than 8 bits for the sound, and the quality is reduced (more quantization noise, worse signal-to-noise ratio etc).

Likewise, if you want to play two samples at the same time, you need to add these samples together (adding two 8-bit numbers yields a 9-bit result), and then scale the result back down to 8-bit, meaning you lose some precision/quality.

Another difference with the Amiga is that the Amiga can set the replay rate for each of the 4 DACs individually. So you can play samples at different rates/pitches at the same time, without having to process the sample data at all. Where as mentioned above, the Sound Blaster has a playback rate that is effectively fixed by the looping DMA transfer. This means that to play samples at different pitches, the samples have to be resampled relative to the playback rate. This generally also reduces quality. Especially with early MOD players this was the case, as your average PC still had a relatively slow CPU, and could only resample with a nearest-neighbour approach. This introduced additional aliasing in the resulting sound. Later MOD players would introduce linear interpolation or even more advanced filtering during resampling, which could mostly eliminate this aliasing.

Some clever coder also figured out that you can exploit the capabilities of the Amiga to play back samples of more than 8-bit quality. Namely, since you have two DACs per channel, and you can set one soft and one loud, and they are then mixed together, you can effectively break up samples of higher quality into a high-word and low-word portion, and distribute it over the two DACs. This way you can effectively get 8+6 = 14-bit accurate DACs, so playing a stereo stream of 14-bit quality is possible on an Amiga. The AHI sound system provides standard support for this.

14-bit, now that isn’t quite CD-quality, is it? Well… that depends. The next step up from 8-bit audio is generally assumed to be 16-bit. But that is a giant leap, and with 16-bit you are expected to be able to produce a dynamic range (and therefore signal-to-noise ratio) of about 96 db, as per the CD specification. That requires quite accurate analog components.

Perhaps this is a good moment to give some quick rules-of-thumb when reasoning about digital audio and quality/resolution.

The first is known as the Nyquist-Shannon sampling theorem, which deals with sample rate. It says:

A periodic signal must be sampled at more than twice the highest frequency component of the signal

Which makes sense… If you want to represent a waveform, the most basic representation is its minimum and its maximum value. So that is two samples. So, Nyquist-Shannon basically says that the frequency range of your analog signal is limited to half the sample rate of your digital signal. So if you have 44.1 kHz, the maximum audible frequency you can sample is 44.1/2 = 22.05 kHz. In practice the limit is not quite that hard, and filtering is required to avoid nasty aliasing near the limit. So effectively at 44.1 kHz sampling rate you will get a maximum of about 20 kHz.

The second is the definition of the decibel. Decibel uses a logarithmic scale where every step of ~6.02 db indicates an amplitude that is twice as large. Combine that with binary numbers, where every bit added will double the amount of values that can be represented. This leads to the simple quick-and-dirty formula of: N bits == N*6.02 db dynamic range. So our 8-bit DACs are capable of about 48 db dynamic range (although some sources argue that because audio is signed, you should only take the absolute value, which means you should actually use N-1, and basically get a value that is ~6 db lower. Clearly manufacturers tend to use the higher numbers, because it makes their products look better).

Although the CD has always been specced as 16-bit PCM data, ironically enough the first CD players weren’t always 16-bit. Most notably Philips (one of the inventors, the other being Sony) did not have the means to mass-produce 16-bit DACs for consumers yet. They had developed a stable 14-bit DAC, and wanted the CD to be 14-bit. Sony however did have 16-bit DACs and managed to get 16-bit accepted as the CD standard.

So what did Philips do? Well, they made CD players with their 14-bit DACs instead. However, they would introduce a trick called ‘oversampling’, where they would use the 14-bit DAC and effectively run it 4 times as fast (so at 176.4 kHz), which allowed them to ‘noise shape’ the signal at a high frequency, and then filter it down, to effectively get the full 16-bit quality from their 14-bit DAC (and ironically enough some ‘audiophiles’ now try to mod these old Philips CD players and bypass the oversampling, to listen to the 14-bit DAC directly, which they of course claim to sound better, because oversampling would ‘only be used to get better measurements on paper, but actually sounds worse’. The reality is probably that it does actually sound objectively ‘worse’, because the filters aren’t designed to remove the aliasing you now get, because you removed the oversampling and noise-shaping feedback loop. But perhaps that added aliasing and distortion sounds ‘subjectively’ better to them, just as people say of tube amplifiers, or vinyl records).

In fact, this oversampling trick had an interesting advantage in that it resulted in better linearity. A classic DAC is made using a register ladder (as we know from the Covox), and to get its response as linear as possible, you need VERY low tolerances to get enough accuracy for a full 16-bit resolution. And the resistance may vary depending on temperature. This meant that building high quality 16-bit DACs was expensive. Also, these DACs generally had to be calibrated in the factory, to fine-tune the linearity. This made it even more expensive.

Another advantage of oversampling is that you now ran the DAC at extremely high frequencies, and the audible frequencies from the original source material are now nowhere near the Nyquist limit of the DAC. Which means that the analog filtering stage after the DAC can be far less steep, resulting in less distortion and noise.

So we quickly saw manufacturers taking this idea to the extreme: taking a 1-bit DAC and using a lot of oversampling (like 64 times, or some even 256 times), running it at extremely high frequencies to still get 16-bit quality from the DAC. The advantage: the DAC itself was just 1-bit, it was guaranteed to be linear. No calibration required. This meant we now had cheap DACs that delivered very acceptable sound quality.

By the time the successor to the CD came out, the Super Audio CD, 1-bit oversampling DACs were now so common, that the designers figured they could ‘cut out the middle man’. A Super Audio CD does not encode Pulse Code Modulation-samples (PCM), like a CD and most other digital formats. Instead, it encodes a 1-bit stream at 2.8224 MHz (64 times as high as 44.1 kHz, so ’64 times oversampling’), in what they call ‘Direct Stream Digital‘ (DSD), an implementation of Pulse Density Modulation (PDM). So now you could feed the digital data stream directly to a 1-bit DAC, without any need for converting or oversampling.

Ironically enough, modern DAC designs would eventually move back to using slightly more than 1-bit, to find the best possible compromise between the analog and the digital domain. So some modern DACs would use 2-bit to 6-bit internally. Which means that you would once again need to process the data on a Super Audio CD before sending it to a DAC which uses a different format, in the name of better quality.

Another interesting example of an audio device that isn’t quite 16-bit is the AdLib Gold card. Although it was released in 1992, in a time when 16-bit sound cards were more or less becoming the standard, it only had a 12-bit DAC. Did it matter? Nah, not really. It was an excellent quality 12-bit design, so you actually did get 12-bit quality. Many sound cards may have been 16-bit on paper, but had really cheap components, so you had tons of noise and distortion, and would get nowhere near that 96 db dynamic range anyway. Some of them are closer to 12-bit in practice (which is about 72 db of dynamic range), or actually worse.

See also this excellent article, which explains about bit-depth and quality (and how things aren’t stair-stepped except with really basic DACs… which by now you should understand, since most devices use 1-bit DACs, there’s no way they can have that kind of stair-stepping anyway).

Advertisement
This entry was posted in Oldskool/retro programming and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

10 Responses to Do 8-bit DACs result in 8-bit audio quality?

  1. dong1e says:

    Hey scali glad to hear you’re still alive and blogging. the win32asm crew is missing you.
    -timecop

  2. Cloeren Jackson says:

    Wow, what a copious amount of “blah”, false-choice and no reliable measurement.

    https://eab.abime.net/showpost.php?p=1452684&postcount=4

    https://eab.abime.net/showpost.php?p=1452685&postcount=5

    You want audio? Even PCM audio? Don’t buy an Amiga. Its 8 bit sound chip is crap.

    Want pro audio on a PC? Don’t buy a basic cheap ass consumer sound card for it you moron.

    You’re just digging the same hole: Banging on and on about a choice YOU have selected which is by no means a realistic selection from the actual choice people had.

    Have you noticed nobody reads you comments or your blog or your Twitter feed? Do you know why? It’s because it’s a stream of fanciful contrived stupid crap.

    • dumbo says:

      I’ve seen quite a few of your tirades against the Amiga and you always miss the point… You seem to have some serious issues (Epistemological, logical, emotional) and for sure a huge confirmation bias… No one is claiming Paula is able to do high res audio… and yes, I’m quite aware of Thomas Richter’s findings…

      “a realistic selection”, “actual choice” – and how much was a pro audio soundcard in the late 80s/early 90s? I was lucky enough to pick up the Sunrize AD516 years after Commodore’s demise. It was my dream soundcard in the early 90s, widely regarded as the best soundcard for the Amiga, but of course I was only able to see it used in professional settings a couple times in those days. US retail price was $1495, which amounts to about $2900 today, making it way out of reach for a teenage kid… although it was viewed as a bargain for a pro at the time… The price was even higher in my country, it cost more than an A4000/030 at the time…

      Have you forgotten the prices for electronics back then? Of course you can always dig up some high end system that matched and surpassed an Amiga based system, no one is disputing that, but at what cost? The Amiga gave people the opportunity to dabble in things previously only available in professional settings and we remember it fondly for that.

      I’ve seen you made similar mistakes discussing NLEs… When comparing Avid Media Composer to Newtek’s Video Toaster Flyer you were not taking into account that Avid’s base solution was 10 times the price and offered low quality video at 15fps, while the Toaster offered what was then broadcast quality. You also didn’t mention the limited usability of hard drive based NLEs in 1990 when pointing out which NLE was earliest to market.

      You even deny Commodore management’s well documented part in the Amiga’s demise while at the same time pointing out the lack of development for the Amiga… You really don’t see a connection between the two? While Apple pushed Avid to use Mac for their system, sending them prototypes and a developer to help them port it, Commodore had a tumultuous relationship and did not support Newtek. Sun Microsystems wanted to rebrand the A3000UX as low end alternative to their workstations, Commodore declined…

      Don’t you remember how computers were viewed back then? For most there was a huge distinction between what was considered games machines and serious computers. Lots of engineers have told stories about what an uphill battle it was to get their boss to sign off on an Amiga based system, despite its advantages, due to how the Amiga (and Commodore) was viewed. Of course it is taken for granted today that a computer can do both word processing and games, but that wasn’t always the case…

      You only want to consider factors supporting your views and disregard any objections as absurd. How is this not intellectual dishonesty? You come off as absurd and simplistic, a troll and a clown…

      • Scali says:

        Not to mention that my article was about how the bit-depth rating of a DAC is not the only factor in the total dynamic range you can achieve, where I give various examples where additional circuitry can add extra bit-depth.
        Yet somehow it is interpreted as buyer’s advice, on a system that has been off the market for decades.
        It’s just severely off in so many ways.

      • dumbo says:

        @Scali yeah, sorry for continuing off topic… Funny thing is his links, even though they question if you truly can achieve 14-bit, does of course agree with the gist of your article. Thank you for an interesting read.

      • Scali says:

        Yea, well I guess it depends on the context. On the one hand with the volume-trick, or with the oversampling method used in CD-players, you can actually process more bits than the DAC is physically capable of. So the Amiga actually plays 14-bit PCM samples, and CD players with oversampling DACs actually play 16-bit PCM samples.

        Whether the actual output quality justifies the precision of the samples processed, is another matter, which was beyond the scope of this article.

      • dumbo says:

        Point taken. Also beyond the scope of your article, but the 8-bit dac is a funny thing to criticise… Compared to the very much sought after Emulator or Linndrum the Amiga is a bargain for that sweet lofi sound 😀

  3. Cloeren Jackson says:

    LOL. Reject the comment then: You may not want any honesty to enter your life but you can’t stop other people from knowing you are talking boring irrelevant crap. which is why absolutely nobody cares.

  4. Pingback: Retro programming, what is it? | Scali's OpenBlog™

  5. bortch says:

    Thank you for this very interesting article.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s