Introduction to Digital Audio



Similar documents
Analog Representations of Sound

Basics of Digital Recording

Timing Errors and Jitter

Computer Networks and Internets, 5e Chapter 6 Information Sources and Signals. Introduction

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

PCM Encoding and Decoding:

The Calculation of G rms

Voice---is analog in character and moves in the form of waves. 3-important wave-characteristics:

6.025J Medical Device Design Lecture 3: Analog-to-Digital Conversion Prof. Joel L. Dawson

Loop Bandwidth and Clock Data Recovery (CDR) in Oscilloscope Measurements. Application Note

FAST Fourier Transform (FFT) and Digital Filtering Using LabVIEW

AVR127: Understanding ADC Parameters. Introduction. Features. Atmel 8-bit and 32-bit Microcontrollers APPLICATION NOTE

CHAPTER 3: DIGITAL IMAGING IN DIAGNOSTIC RADIOLOGY. 3.1 Basic Concepts of Digital Imaging

Taking the Mystery out of the Infamous Formula, "SNR = 6.02N dB," and Why You Should Care. by Walt Kester

Sampling Theorem Notes. Recall: That a time sampled signal is like taking a snap shot or picture of signal periodically.

Filter Comparison. Match #1: Analog vs. Digital Filters

Optimizing VCO PLL Evaluations & PLL Synthesizer Designs

Department of Electrical and Computer Engineering Ben-Gurion University of the Negev. LAB 1 - Introduction to USRP

Broadband Networks. Prof. Dr. Abhay Karandikar. Electrical Engineering Department. Indian Institute of Technology, Bombay. Lecture - 29.

Dithering in Analog-to-digital Conversion

CBS RECORDS PROFESSIONAL SERIES CBS RECORDS CD-1 STANDARD TEST DISC

Digital Transmission of Analog Data: PCM and Delta Modulation

Conversion Between Analog and Digital Signals

Analog signals are those which are naturally occurring. Any analog signal can be converted to a digital signal.

Analog and Digital Filters Anthony Garvert November 13, 2015

ANALYZER BASICS WHAT IS AN FFT SPECTRUM ANALYZER? 2-1

The front end of the receiver performs the frequency translation, channel selection and amplification of the signal.

DOLBY SR-D DIGITAL. by JOHN F ALLEN

Analog/Digital Conversion. Analog Signals. Digital Signals. Analog vs. Digital. Interfacing a microprocessor-based system to the real world.

The Fourier Analysis Tool in Microsoft Excel

Improving A D Converter Performance Using Dither

Analog-to-Digital Voice Encoding

DEVELOPMENT OF DEVICES AND METHODS FOR PHASE AND AC LINEARITY MEASUREMENTS IN DIGITIZERS

SIGNAL PROCESSING FOR EFFECTIVE VIBRATION ANALYSIS

Multiplexing and Sampling Theory

Trigonometric functions and sound

Understand the effects of clock jitter and phase noise on sampled systems A s higher resolution data converters that can

Digital to Analog Converter. Raghu Tumati

Application Report. 1 Introduction. 2 Resolution of an A-D Converter. 2.1 Signal-to-Noise Ratio (SNR) Harman Grewal... ABSTRACT

RF Measurements Using a Modular Digitizer

Music technology. Draft GCE A level and AS subject content

TCOM 370 NOTES 99-6 VOICE DIGITIZATION AND VOICE/DATA INTEGRATION

W a d i a D i g i t a l

LEVERAGING FPGA AND CPLD DIGITAL LOGIC TO IMPLEMENT ANALOG TO DIGITAL CONVERTERS

Synchronization of sampling in distributed signal processing systems

Spike-Based Sensing and Processing: What are spikes good for? John G. Harris Electrical and Computer Engineering Dept

NRZ Bandwidth - HF Cutoff vs. SNR

Lab 5 Getting started with analog-digital conversion

AN Application Note: FCC Regulations for ISM Band Devices: MHz. FCC Regulations for ISM Band Devices: MHz

MICROPHONE SPECIFICATIONS EXPLAINED

Sampling and Interpolation. Yao Wang Polytechnic University, Brooklyn, NY11201

How to avoid typical pitfalls when measuring Variable Frequency Drives

ADC and DAC. Quantization

Positive Feedback and Oscillators

Aliasing, Image Sampling and Reconstruction

TCOM 370 NOTES 99-4 BANDWIDTH, FREQUENCY RESPONSE, AND CAPACITY OF COMMUNICATION LINKS

DTS Enhance : Smart EQ and Bandwidth Extension Brings Audio to Life

VCO Phase noise. Characterizing Phase Noise

AM TRANSMITTERS & RECEIVERS

1995 Mixed-Signal Products SLAA013

Technical Note #3. Error Amplifier Design and Applications. Introduction

1. Oscilloscope is basically a graph-displaying device-it draws a graph of an electrical signal.

The Effective Number of Bits (ENOB) of my R&S Digital Oscilloscope Technical Paper

LAB 12: ACTIVE FILTERS

MP3 Player CSEE 4840 SPRING 2010 PROJECT DESIGN.

LAB 7 MOSFET CHARACTERISTICS AND APPLICATIONS

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Electronic Circuits Spring 2007

Harmonics and Noise in Photovoltaic (PV) Inverter and the Mitigation Strategies

EECC694 - Shaaban. Transmission Channel

T = 1 f. Phase. Measure of relative position in time within a single period of a signal For a periodic signal f(t), phase is fractional part t p

Lock - in Amplifier and Applications

Lab Unit 4: Oscillators, Timing and the Phase Locked Loop

Analog Filters. A common instrumentation filter application is the attenuation of high frequencies to avoid frequency aliasing in the sampled data.

Sigma- Delta Modulator Simulation and Analysis using MatLab

Motorola Digital Signal Processors

USB 3.0 CDR Model White Paper Revision 0.5

LOW COST MOTOR PROTECTION FILTERS FOR PWM DRIVE APPLICATIONS STOPS MOTOR DAMAGE

Hideo Okawara s Mixed Signal Lecture Series. DSP-Based Testing Fundamentals 46 Per-pin Signal Generator

Doppler. Doppler. Doppler shift. Doppler Frequency. Doppler shift. Doppler shift. Chapter 19

HIGH QUALITY AUDIO RECORDING IN NOKIA LUMIA SMARTPHONES. 1 Nokia 2013 High quality audio recording in Nokia Lumia smartphones

Optical Fibres. Introduction. Safety precautions. For your safety. For the safety of the apparatus

Lab 1: The Digital Oscilloscope

Analog Signal Conditioning

CDMA TECHNOLOGY. Brief Working of CDMA

Lecture 14. Point Spread Function (PSF)

Non-Data Aided Carrier Offset Compensation for SDR Implementation

Sampling Theory For Digital Audio By Dan Lavry, Lavry Engineering, Inc.

Analog-to-Digital conversion

Higher National Unit Specification. General information for centres. Transmission of Measurement Signals. Unit code: DX4T 35

Implementation of Digital Signal Processing: Some Background on GFSK Modulation

What the Nyquist Criterion Means to Your Sampled Data System Design. by Walt Kester

Acceleration levels of dropped objects

Basic Acoustics and Acoustic Filters

Impedance Matching and Matching Networks. Valentin Todorow, December, 2009

Simplifying System Design Using the CS4350 PLL DAC

Clock Recovery in Serial-Data Systems Ransom Stephens, Ph.D.

Jitter in (Digital) Audio

Abstract. Cycle Domain Simulator for Phase-Locked Loops

Sampling: What Nyquist Didn t Say, and What to Do About It

Transcription:

Introduction to Digital Audio Before the development of high-speed, low-cost digital computers and analog-to-digital conversion circuits, all recording and manipulation of sound was done using analog techniques. These systems functioned by creating an electrical analog of sound waves, converting it to a magnetic representation, storing and processing that analog replica. The analog signal was continuous, meaning that no matter when one looked at the signal, there was a voltage or current value which represented the instantaneous value of the signal. In order to make use of digital representations of the sound, it is necessary to convert the continuous analog representation into a non-continuous stream of numbers. Digital representations of analog signals are not continuous, saving the measured voltages only at the time of each sample. This would appear to throw away the values that exist between samples, which one would expect to severely reduce the accuracy of the new digital representation. As we will see, this is an incorrect assumption as is borne out both by the sampling theorem and by practical implementation. A/D conversion: Since no true digital microphones exist, the analog microphone signal must be converted into a digital representation. This process is known as analog-to-digital (A/D) conversion. It is this process and the complimentary conversion back to analog (D/A conversion) that impart many of the potential shortcomings to digital audio. In order to faithfully re-create the original signal, both the sampling rate and measurement (quantization) must be extremely accurate. Quantization is the process by which the amplitude of the signal at a sample time is measured. Digital representations use binary words to encode the measured amplitude (See Figure 1.) Each word consists of a number of bits that are binary weighted, the more bits used the finer the resolution of the measurement. Early digital audio systems struggled to achieve 16-bit resolution while modern systems use 24 bits at a minimum. Figure 1: Binary weighting. Each bit is binary-weighted, with the least significant bit (LSB) coding for 1 and the nth bit for 2 n. The 8-bit word 01011010 encodes the base 10 value 90. Since the analog input voltage range of a converter is fixed, the more bits used to quantize the signal, the finer the resolution of the least significant bit. Each additional bit in a word doubles the resolution, since the number of discrete levels a word may distinguish is 2 n, where n is the number of bits. This system is known as fixed point representation, in contrast to a more complicated floating point method of encoding the amplitude that uses exponents to scale the value. Floating point systems have replaced fixed point ones for most digital audio processes since computers natively use floating point math, but most A/D converters are still using fixedpoint methods. Modern A/D converters use 24-bit representations, which theoretically exceed the dynamic range possible for electronic circuits at room temperature. This can be misleading, though, since real 24-bit converters only perform linearly to about 20 bits, which is approximately the dynamic range of high-quality 1

analog circuits. Table 1 shows the increasing potential resolution as the number of bits/word is increased. n = number of bits/word number of levels = 2 n dynamic range ~ 20 log 2 n 8 256 48 16 65,536 96 24 16,777,216 144 Table 1: Word length (n bits) determines the resolution of analog-to-digital conversion. The dynamic range available is approximately equal to 20 log 2 n. [The signal-to-error ratio is slightly greater than 20 log 2 n because the signal is more accurately described by the rms statistics that apply to both the signal and the quantization error, which leads to a more precise figure of 6.02n+1.76.] Quantization: Figure 2 shows how the size of the quantization step, each of which corresponds to the analog value represented by the least significant bit, affects the error of the measurement. Figure 2: Error in an A/D conversion is at most one half the value encoded by the least significant bit, but is correlated with the signal. Dither: Since the maximum error of each conversion is 1/2 LSB, increasing the number of bits/word reduces the error of measurement as it reduces the equivalent analog value of the LSB. As is seen in Figure 2, the error of quantization is correlated with the signal. This sounds quite different from the wide-band noise we encounter in analog circuits because it changes as the signal changes. There is a way to de-correlate the error from the signal - dither: add some random noise! Of course, it seems counter-intuitive to add noise on purpose. However, the noise is quite small, usually a fraction of the LSB rms equivalent voltage. This amount of noise is generally inaudible at normal listening levels but its effects can sometimes be heard on long, slow decays like reverb tails. From a perception perspective, random noise sounds preferable to signal-correlated distortion. Dither should be applied any time the number of bits representing a signal is reduced, as well as during quantization. 2

While conceptually rather simple, the implementation of dither can become critical when our signals pass through multiple computations, as they do in most recording and mixing software. Each plug-in we use performs mathematical operations on the data, employing extra precision variables that extend the word length for precise computation and returning to the original word length at the output. This requires dither. Many recordings are processed through equalizer and compressor plug-ins multiple times, so proper dither is required to avoid building up audible distortion. The spectral character of the applied dither can be selected to provide the least audible effect on the sound. By shifting the dither spectrum to favor higher frequency noise, the maximally sensitive frequencies of the auditory system can be avoided. Other techniques of shaping the dither spectrum have been tested and most currently used dither algorithms are quite transparent to the listener. Sample-and-hold: Another potential issue that appears in the quantization process is caused by the continuous nature of the input signal. It takes finite time to complete a sample measurement and the signal can change while we are trying to sample the signal. The answer is to use a circuit called a sample-and-hold to take an analog sample of the signal at precisely the sample time by holding the analog voltage on a capacitor until it can be measured by the A/D converter. The capacitor is connected to electronic switches that control the input and output connections. Aliasing: Even if quantization could be made perfectly accurate, there is still a potential problem associated with the conversion process: the signal must not contain any frequencies higher than half the sampling rate. This is a result of the way the audio signal interacts with the sampling frequency. In a way, the process of sampling is equivalent to combining the sampling signal with the audio signal, generating sum and difference frequencies. If the sample rate is low, the difference frequencies are audible and constitute a form of distortion: the so-called fold-over distortion or aliasing. [This is the same phenomenon that accounts for the slowly reverse-rotating wagon wheel effect seen in old Western movies, where the image is sampled by a movie camera.] In order to minimize aliasing, the sample rate should be much higher than the highest frequency present in the signal, at the very least greater than twice the highest frequency present in the signal. This can be accomplished either by increasing the sample rate or by limiting the signal bandwidth. Since increasing the sample rate increases the amount of data which must be stored, it is preferable to keep the sample rate as low as possible. Limiting the bandwidth will decrease the high-frequency content of the signal, also not desirable. We must therefore find a balance between sample rate and signal bandwidth. Of course, as the speed and capacity of digital systems continues to improve, the use of higher sample rates and longer word lengths is relaxing many of the constraints originally adopted to make early digital recording feasible. The mathematics of sampling dictates that we sample at a rate higher than twice the highest frequency present in the signal (the Nyquist Theorem). If we want the entire audio bandwidth of 20 to 20,000 Hz, we must sample at greater than 40,000 Hz. This means that for 1 second of stereo sound, we will have more than 80,000 numbers. But this assumes that there are no signal components present above 20,000 Hz. How do we guarantee this? Anti-Aliasing Filters: In order to prevent aliasing, we must remove any frequencies above half the sampling rate from the signal. This is done by filtering the signal. Since we want 20 khz frequencies to be reproduced, we must filter very sharply above this frequency. Unfortunately, a simple filter cannot remove frequencies near to the 20 khz cutoff very well without affecting lower frequencies present in the signal. We must use a very sharp, complicated filter to remove the unwanted frequencies while preserving frequencies within the desired audio bandwidth. These 3

filters are known as brick-wall filters because they cut off so rapidly above their corner frequency. It was not unusual to find 12 pole filters employed as anti-aliasing filters. As you might imagine, the design of these critical filters is very complicated. It is not possible to filter a signal so heavily without making some changes to the signal which is passed through. Often, the transient response suffers audibly as the complex filter responds to the driving signal. These filters are responsible for much of the criticism of digital audio, especially for the so-called harshness of early digital recorders. In recent years, the speed of computer chips has increased to the point where sophisticated mathematical processes can be applied to digitized signals which remove the unwanted frequencies from the signal after it is digitized, reducing the need for sharp analog filters. These procedures come under the heading of oversampling, a technique which allows high-speed sampling without increasing the amount of data to be stored. Even in these systems some analog filtering is still required, but simple filters with just a few poles are used, thereby reducing the deleterious effects of brick-wall filters. And as sample rates extend to 96 khz and even 192 khz, the requirement for analog filters is further relaxed. Clocking: The timing accuracy of the clock used to trigger the sampling is another potential problem area for A/D converters. In order to conform to the sampling theorem, perfect sample timing is assumed. In real circuits, this is not as easy as it might sound. Very slight variations in the clocking lead to samples being measured at the wrong time, thereby producing incorrect sample values. Clock timing variations are known as jitter. Clock pulses are generally created by using a crystal oscillator running at very high frequency and dividing the frequency down to the desired sample rate. When done inside a digital audio device, the circuit pathway used for clock signal distribution can be carefully chosen to avoid capacitance and inductance that would alter the shape of the pulses, leading to inaccurate trigger timing. This is not a simple design issue, but modern digital devices are good at providing an internal clock with low jitter. When digital audio devices are interconnected, they must share the same clocking. Transmitting a clock signal outside the carefully-designed devices introduces more possible issues that can lead to jitter in the receiving device if not properly designed. A circuit known as a phase-locked loop can be used to synchronize an external clock with a receiving device s local clock. Eliminating jitter from A/D conversions is critical, since once the signal is quantized, any jitter present will remain in the recorded signal. Although jitter may not always be obviously audible, it can sometimes be heard to compromise imaging in stereo sound file playback. D/A conversion: Once a signal is stored digitally, it must eventually be converted back to analog for us to hear it. This process is essentially the reverse of sampling: the numbers are converted back to analog voltages. But since we have samples at discrete times, what should the output voltage do between the samples? What it should do is what the original signal did, but unfortunately, we no longer know what that was. One solution is to hold the last value until the next value is converted. This results in a staircase-like output which was not present in the original signal. The more bits we use for quantization, the smaller the step size, but we will always have some step-like distortion of the original signal if we use the stored data directly. We must low-pass filter the output to remove the effects of quantization. D/A converters are conceptually the reverse of the A/D converter. The analog output of the D/A converter is always connected to the outside world, so any momentary glitches that occur would be transmitted as part of the analog signal output. This requires circuitry to hold the output while a conversion is in process, a sample-andhold like that used in the A/D process. The output is then filtered by an anti-imaging filter, similar to the antialiasing filter in the A/D converter. Imaging, like aliasing, is created by combining the sample pulse with the analog signal, but this time it is all the higher frequency sum and difference components that contribute to the 4

problem. Images of the analog signal centered on multiples of the sample rate, sum and difference products at multiples of the sample frequency, appear as the stair-step so often associated with sampled audio signals. The anti-imaging filter removes these components and restores the continuous signal originally captured by the A/D converter. Figure 3: Imaging created by sampling. Frequencies created by combining the sample pulse with an audio signal create new images at multiples of the sample rate f s. Figure 3 shows images of the original spectrum centering about the multiples of the sample rate. Removing these images would require sharp filtering, but digital filters may again do the job instead. The technique called oversampling can shift the images to higher effective sample rates, thereby reducing the demands on the anti-aliasing filters. Oversampling uses digital filtering to remove the images around f s, shifting the first set of images to a higher multiple of the sample rate. This leaves a greater distance between the signal spectrum and the first remaining image, allowing more gentle filtering to eliminate the images from the system output. Figure 4: The effect of two times oversampling. Images centered on the sample rate are eliminated. Figure 4 shows the effect of a two-times oversampling D/A conversion. Practical D/A converters use 8 or 16 times oversampling to place the first set of images far above the audible frequency range. In comparing Figures 3 and 4, it is obvious that the low-pass filter necessary to remove images from oversampled conversions is much more gentle. 5

Time domain versus frequency domain Figures 3 and 4 show amplitude as a function of frequency, a different way of plotting signal data from the more familiar amplitude versus time. In the analog world, signals are time-varying voltages. In the digital domain, the same information can be described in terms of the individual sine waves that compose the complex sound rather than by the voltage variations. This is known as the frequency domain. The conversion between the two representations is made by the Fourier transform, an algorithm that determines the amplitude and phase of the sine wave components that make up any complex sound signal. Computers can make use of the frequency information to do things that are not easy or even possible in the time domain, like re-synthesizing sounds while eliminating unwanted components like noise, retuning instrument or vocal performances, and creating complex digital filters that would be impossible with analog equipment. Digital signal processing depends extensively on the Fourier transform and the inverse transform to convert back to the analog time domain. Figure 5 details the difference between time and frequency domain representations of a sinusoidal signal. Figure 5: Time domain versus frequency domain representation of a sine wave. As we see, the frequency domain needs a single amplitude and time to represent a sine wave that would take many individual samples to describe. Many of the complex algorithms used in digital audio processing are easier to accomplish in the frequency domain. 6