Digital to analog conversion

Keyboard Shortcuts

Using an analog oscilloscope, Matt Mayfield proves that digital audio is an accurate, smooth representation of the analog waveform. The anti-aliasing filter in the analog-to-digital converter and the reconstruction filter in the digital-to-analog converter work together to ensure that no frequencies under the Nyquist limit are included in the sample. As a result, the physics of sine waves ensure that the output of the D/A converter is a smooth, exact replica of the sampled band-limited signal.

- To actually hear digital audiowe first need to run it througha Digital to Analog Converter, or DAC for short.The analog output of the DACcan then be sent to a power amplifierand played on speakers or headphones.DACs can work in different wayselectrically under the hoodbut they all do pretty much the same thing.They go through each sampleand produce an analog voltagethat matches that sample's measurmentat the appropriate time based on the sample rate.

Those voltages pass through a reconstruction filterso that the final output is a smooth analog wave form.Contrary to what you might seeon your computer screen,the sampled sound is not made of blocky stair stepsor jagged connect-the-dots lines.The image shown by the software is notwhat the sampled sound wave really is.The programmers didn't intend to lie to you,they just took some shortcuts in the visual part.

Now you may ask, how could it be possiblethat digitally sampled audio is a smooth,natural analog-like wave form insteadof the jagged connect-the-dots or stair stepsthat we can see on the computerand that just feels right to imagine?Well, the answer lies in theShannon and Nyquist Sampling Theorem,which is the mathematical principleall sampled audio is based on.We won't go into the math,but I'll illustrate the general idea by analogy,and then demonstrate and prove itwith this analog oscilloscope.

Say these two thumbtacks are two sample points.Most audio software will show these points on screeneither as a stair stepor a straight line.But, the actual sampled audiois more analogous to the curve of this string,which happens naturally due to the laws of physics.Each thumbtack is like a separate voltagethat the DAC produces per sampleand the string is like the reconstruction filterwhich turns those individual voltagesinto a continuous wave form.

In the case of the thumbtacks and string,the factors that define this natural curveare the length of the string,the position of the thumbtacks, and gravity.In the case of digital audio,the factors that define the smoothanalog output from a DACare the sampling rate, the measurements of the samples,and wave physics within the reconstruction filter.Let's see how this actually worksin digital audio using some software,a DAC, and an analog oscilloscope.

First we have a frequency of one kilohertz,which I have recorded at a sampling rate of 44.1 kilohertz.(long beep)As you can see on screen,this looks fairly smooth when you zoom inenough to see each sample.(long beep) And, on the oscilloscope,we see a smooth wave form at one kilohertz.So far, at this relatively low frequency,what we see on screen pretty wellmatches the actual output of the DAC.

Next, let's use a frequency of 10 kilohertz,also recorded at a sampling rate of 44.1 kilohertz.This sound-- (high beep)is quite high frequency.It's still under the Nyquist frequency of22.05 kilohertz, though, so the sampling theorem tells usthat it should be reproduced smoothlyand naturally by the DAC.Let's zoom in on screen.What's this? This looks like a real mess.

But, when we play it backthrough the analog oscilloscope,(high beep) and zoom in on the oscilloscopeto see the wave more clearly,as you can hear and see it's perfectly smooth.No stair steps,no crazy connect-the-dots jaggedness,just a natural analog sine wave.Finally, let's test a frequency of 20 kilohertz.Again, recorded at a sampling rate of 44.1 kilohertz.This sound is at the very limits of human hearing,and unless you're a teenager or youngeryou probably won't be able to hear it at all.

Your dog or cat might, though.(very high sound or silence)The so-called wave form in our audio softwareisn't even recognizable as a sine wave anymore.But, sure enough, the analog oscilloscopereveals that it was captured accuratelyin the digital domainand converted accurately to the analog domain.We can even zoom in furtherand see that it's perfectly smooth.

So why does the wave look like this on screen?Well, the software takes the visual shortcutof just connecting the dots with straight linesinstead of calculating and renderingthe curves of the true sampled wave form.It would waste a lot of computer powerto calculate with math what just happens naturallywith physics inside the DAC.It's kind of like how it's more workto calculate the curve of a theoretical stringthan it is to just hang a real stringbetween a couple thumbtacks.

Now, one thing we haven't addressed is,what happens if the original soundhas a more complicated curve than this?Say it had another little bump in the middle.Well, by definition,any details in the wave this smallare made up of frequencies higherthan half the sampling rate.For example, if we imagine these two thumbstacksare samples taken at 44.1 kilohertz,then any shape other than this one,the one that naturally falls into a curve,must be made of frequencies higher than 22.05 kilohertz.

The anti aliasing filter in the analog to digital converterwill have already filtered those frequencies outback before the original sound was sampled.If the ADC did this properlythen the wave form is guaranteed not to includeany details that small, and if so,then, the output of the DAC,as defined by the laws of physics,must be the same as the sampled signal.

Now, even though a 44.1 kilohertz sample ratecan potentially capture sounds with full accuracy,all the way past the limits of human hearing,some people prefer to record at a higher sampling ratelike 96 kilohertz or 192 kilohertz.That allows the recording of frequencieseven higher than 22 kilohertz.Using more samples per second is kind of likeadding more thumbtacks to create a more complex curve.

That is, a curve with higher frequencies.But, note that increasing the sample ratepast 44.1 kilohertz does not necessarilyincrease the accuracy or the qualityof sounds that are already lower than 22 kilohertz,because that's like putting in extra thumbtackswhere the string would alreadyfall naturally anyway.So in theory at least,there's not much extra benefit to recordingat very high sample rates.

In practice, of course, your mileage may varybecause some software and some convertersbehave differently at different sample rates.Also, there may be circumstances whereyou need to capture ultrasonics, that is,sounds higher than human hearing,like if you're recording bats or dolphins.There may also be the possibilitythat humans can somehow sense ultrasonic energyalthough the majority of evidence from double-blind testsdoesn't support that idea.

Microphones and speakers havetheir own frequency limits anywayand many can't capture or reproducesounds much higher than 20 kilohertz.In our day to day lives, everywhere we look,from our phones to our car stereosto kids' toys and even talking greeting cards,ADCs and DACs are everywhere.It's amazing to think sometimes how,inside these everyday itemsthat are so easy to take for grantedthere's an awful lot going on.

Resume Transcript Auto-Scroll

Author

Released

4/22/2016

Learn everything you need to know about working with digital audio. In this flagship course, author Matt Mayfield demonstrates a wide array of audio and music fundamentals. The lessons are designed for new musicians, songwriters, producers, and engineers; those making the leap from analog to digital; and professionals who need to brush up on a concept or two.

The course starts with explanations of what sound really is and how we hear it, including discussions on frequency, amplitude, phase, and psychoacoustics. Matt explores analog audio signal path, explaining connections, gain staging, and metering. Next, he brings the audio signal into the digital domain, discussing analog to digital conversion, digital gain staging, file formats and compression, and dither.

Then the course digs into digital audio workstations (DAWs), explaining the concepts and misconceptions involved in digital recording systems. Matt describes how memory, CPU speed, and storage affect your DAW's performance, as well as how to manage computer resources and understand the plethora of file formats associated with digital recording. He follows with an overview of MIDI: how to generate, store, process, and communicate MIDI data. He wraps up with the audio processors that are often used for mixing in a DAW—including EQ, compressors, reverb, delay, and many others.