Chapter Contents



3.0 Analog & Digital Conversions


3.1 Codecs


3.2 D/A Conversion

3.2.1 Binary Weighted DAC

3.2.2 Resistor Ladder DAC

3.2.3 Multiplying DACs


3.3  A/D Conversion

3.3.1 Tracking A/D Converter

3.3.2 Successive Approximation ADC

3.3.3 Flash A/D Converter

3.3.4 Dual Slope A/D Converter

3.3.5 Sigma Delta ADC


3.4 Sample and Hold

3.4.1 Natural Sampling

3.4.2 Flat Topped Sampling

3.4.3 Aperture Error


3.5 Aliasing

3.5.1 Aliasing Filters and Noise Reduction

3.5.2 Decimation


3.6 Quantization Encoding

3.6.1 Quantization Noise


3.7 Companding

3.7.1 Digital Companding

3.7.2 Digital Expansion

3.7.3 Logarithmic Companding Curves

SystemView Examples


3.8 Delta Modulation

3.8.1 Delta Demodulator

3.8.2 Adaptive Delta Modulation

3.8.3 SystemView Model

3.8.4 Sigma Delta Modulation


Assignment Questions


For Further Research




3.0 Analog & Digital Conversions



This section will use a CODEC to:

   Examine the operation A/D and D/A converters

   Observe the difference between natural and flat topped sampling

   Calculate aperture error, aliasing, and quantization distortion

   Consider the process of decimation

   Consider the process of companding


Additional Resources


ADCs and DACs

Sigma Delta Converters


Much of the ‘real’ world utilizes analog signals. This is particularly true of voice, video and modem signals. However, the transport and switching networks of most communications networks use digital transmission. For this reason it is essential to gain some understanding as to what is involved in electrically converting between these two domains.

3.1     Codecs

Codecs are widely used in the telephone industry to convert analog voice signals into the digital domain so that they can be easily transported through the network. They may also have a number of control functions, but we shall ignore those for the moment and focus on the A/D and D/A paths.

From the above diagram, we notice that a number of different devices are needed to successfully convert analog signals to the digital domain and back:

It may seem a bit peculiar, but the easiest place to start understanding these types of devices, is at D/A converter.

For more information, check the following websites and perform a search on codec.


3.2     D/A Conversion

It is much easier to convert from the digital domain to the analog one since many types of ADCs contain a DAC in a feedback loop. Most DACs contain two principle elements: current or voltage switches, and a binary divider. Devices that are more complex will contain deglitching and control circuits.

The DAC output often contains switching transients. These are removed by means of reconstruction filters placed at the output.

3.2.1    Binary Weighted DAC

This circuit is essentially a summing amplifier where the gain associated with each successive bit is doubled.

In actual practice, this network is comprised of binary weighted current sources controlled by the digital input.

3.2.2    Resistor Ladder DAC

This circuit is essentially a summing amplifier where the contribution of each bit is determined by its position in the ladder network. The main advantage of this circuit is that it requires very few resistor values.

In general practice, the digital input enables equal value current sources.

3.2.3    Multiplying DACs

The output of any DAC is proportional to the product of the digital input and whatever is used as the reference current or voltage. In a multiplying DAC, the reference is controllable. This allows the converter to be used as a digital potentiometer or programmable gain amplifier. If the control input allows positive and negative values, it can also be used as a 4-quadrant multiplier.

A special type of MDAC is the LOGDAC or logarithmic DAC. The LOGDAC does not operate in a linear mode but rather has a logarithmic attenuation characteristic. This function is used to provide wide range logarithmic amplitude compression in telephony and audio recording applications.

Multiplying DACs are fast. The output will usually be a stepped waveform, which is then smoothed with a reconstruction filter to remove high frequencies.

The disadvantage of a multiplying DAC is that the voltage or current generated for the MSB must be extremely accurate, for example one part in 216 or 65536 for a 16-bit DAC.

3.3               A/D Conversion

The A/D converter or ADC is much more complex than the DAC. There are two broad categories of ADCs: Nyquist converters and noise-shaping converters.

Most ADCs are of the Nyquist type and produce a single digital output for every sample. Examples include:

Tracking ADC

Successive Approximation ADC

Flash Converters

Dual Slope ADC

Noise-shaping converters, such as the SD converter, sample well above the Nyquist rate and end up discarding most of the results. This technique is widely used in the audio world since it produces very little noise.

The minimum acceptable sampling frequency, known as the Nyquist rate, is equal to twice the highest frequency component to be sampled.

The Nyquist frequency is equal to one half of the actual sampling rate.

The Nyquist range is the band of frequencies from 0 Hz to the Nyquist frequency.

3.3.1    Tracking Converter

In order to convert from the analog domain to the digital one, it is necessary to sample the analog signal. Analog signals are by their very nature constantly in motion. On the other hand, digital signals are like small, quantified electronic snap shots, and can only take certain finite values.

This circuit uses a DAC in the feedback loop to help determine the digital equivalent. The comparator examines the difference between the analog input and the reconstructed digital equivalent, and forces the counter to either increment or decrement.

3.3.2    Successive Approximation Converter

This type of converter uses a successive approximation instead of an up-down counter. This device activates each bit in the internal DAC sequentially starting with the MSB. If that bit causes the comparator to change states, it is rejected. The entire conversion process for an n bit converter takes slightly longer than n clock periods.

Successive approximation ADCs are generally accurate, fast, and inexpensive. However, they can be slow to respond to sudden changes in the input signal and are sensitive to input spikes

3.3.3        Flash Converter

A flash converter requires slightly more than one clock period to perform a conversion. Instead of having one comparator, it has 2n-1 comparators. Each comparator compares the input voltage to a voltage divided reference. All comparators with reference voltages below the input value will be in one state while those above it will be in the other. The comparator’s outputs are then fed to a decoder, which generates the n bit binary code.

Flash converters are the fastest ADCs. Conversion times in the order of 100 nSec are typical. The primary application for these devices is in video coding. This technique is limited to about 8 bits.

3.3.4    Dual Slope Converter

These devices are used for slow but precise measurements. It consists of an integrator, a comparator, an up-down counter, clock, and control logic. The integrator charges by the input value for a fixed time. It then discharges for a variable time through a fixed potential. The ratio of the charge and discharge time is then proportional to ratio between the unknown input voltage and reference.

The advantage of this technique is that its accuracy is not affected by the absolute values of the integrator components or clock rate. However, it is very slow and generally expensive.

3.3.5    Sigma Delta Converter

Sigma delta ADCs make use of over sampling and noise shaping techniques. Unlike conventional ADCs, sigma delta ADCs use mainly digital techniques and digital filters. They provide good noise performance at resolutions up to 20 bits, and are excellent for audio applications.

Over sampling means sampling the input signal at a rate significantly greater than twice the Nyquist frequency. This allows the specification of the anti-alias filter to be relaxed. The over sampled signal is then digitally low pass filtered and decimated to obtain samples at twice the Nyquist frequency. Decimation means throwing away samples. For example, if 8x the Nyquist frequency sampling was used, every 4th sample would remain after decimation.

As the signal is over-sampled, the quantization noise is spread evenly across the spectrum up to the sampling rate, while the signal is still contained in the frequency range up to the Nyquist rate. This means that the level of quantization noise in the frequency band of interest is reduced, enabling more bits of resolution to be obtained than the quantizer actually provides.

Rather than quantizing the absolute value of the sample, the sigma delta ADC returns a single bit value of +1 or -1, depending on whether the current sample is greater than or less than the previous one.

3.4     Sample and Hold

The first step in digitizing an analog signal is to sample it. The easiest way to do this is to simply open and close a switch.

3.4.1    Natural Sampling

This type of sampling is called natural sampling because the resultant signal follows the natural shape of the input during the sampling interval.

Another way to look at the sampling function is to regard it as a form of multiplication. The sampled output occurs when the input is multiplied by 1, but nothing emerges when it is multiplied by zero.

The pulse signal acts as a sample gate for the analog waveform. This process, known as PAM is actually time domain multiplication.

Notice that it is possible to insert another sampled signal into the gaps in the first. This form of analog time domain multiplexing was once widely used in telephone carrier systems.

From Fourier analysis in section 2, we discovered that the spectrum of a pulse waveform is given by:

Multiplying this signal by some arbitrary analog waveform m(t), and expanding the summation, results in a huge number of individual signals:

Each of the individual components in the summation is a DSBSC signal. If the sampled signal is a sine wave, the resulting spectrum will consist of the sums and differences between the sampled signal and the sampling signal.

If the samples signal is really a range of frequencies, or a baseband, such as:

The resulting sampled spectrum will consist of the sums and differences of this baseband range, and the various frequency components of the sampling signal. The result is a complex spectrum resembling:

From the above, it is readily apparent that the sampled signal contains many more frequencies than the input baseband and sampling frequencies. It is therefor necessary to place filters at the input of A/D converters and the output of D/A converters to limit spectral content. These are known as antialiasing filters.

The generally decaying amplitude of the higher frequency components occurs because they are following the decay of the sync envelope associated with sampling. The envelope does not represent actual frequencies, but helps to see their relative amplitudes:

3.4.2    Flat Topped Sampling

Flat topped sampling is more difficult to analyze than natural sampling. In a DAC, the sampled signal is held constant during the conversion process by a sample and hold circuit. This changes the resulting time and frequency domain components.

Bringing the sampled value down to zero between conversions allows several signals to be time division multiplexed. On a single channel converter the held value is not returned to zero but remains constant until the next sampling instant.

The spectrum after sampling resembles:

The spectrum of a flat-topped sampled waveform follows the sinc envelope. This has an impact on aliasing noise, which is difficult to analyze.

3.4.3    Aperture Error

Distortion introduced by flat topped sampling, causes loss of high frequency information. This is because the input signal may be changing while the sampled value is held constant. This error can be readily observed in both the time and frequency domains.

This error or noise can be reduced by reducing the aperture width.

It would appear that by reducing the sampling window to very near zero, this form of distortion could be essentially eliminated. This would be true except for the fact that at the other end of the digital transmission system, the signal must be reconverted back to digital. In the case of a telephony codec, the sample rate of 8 KHz produces an aperture of 125 mSec at the DAC.

Video codecs can reduce aperture error at the DAC by interpolating between samples.

Although the sampling signal falls to zero between samples, the sampled signal is held constant. If the sampling rate is increased, the noise or error associated with the held aperture can be reduced. Noise that is a function of sampling rate is known as aliasing noise.

3.5     Aliasing

Aliasing occurs when the lower sideband associated with the sampling frequency, overlaps the baseband spectrum. An aliasing frequency is generated if the sampling rate is less than double the highest frequency component in the baseband.

Besides creating tones, foldover distortion can create broadband aliasing noise.

Notice what happens in the time domain, if a signal such as a sine wave is sampled at less than the Nyquist rate:

A new lower frequency aliasing signal will be generated by the DAC at the output of the system. The DAC simply takes the samples it is given and attempts to reconstruct the original signal. In this case, it is not possible.

The amount of aliasing noise generated is a function of sampling rate, and baseband roll off. Limiting the frequency band prior to sampling can reduce Aliasing noise. These anti-aliasing filters are necessary at the DAC input. The higher the filter order [steeper the roll-off], the lower the aliasing noise.

From this it should be evident that the theoretical minimum sampling rate is twice the highest frequency in the baseband. This is known as the Nyquist rate. In actual practice, the sampling rate must be well above the Nyquist rate, or the antialiasing filters become too difficult to construct.

3.5.1    Aliasing Filters and Noise Reduction

The effect filter roll-off has on noise performance can be seen by examining a simple one pole low pass filter.

The relationship between input and output can be found by applying the voltage divider rule:

for cascaded or ganged sections, the overall magnitude of the response is the single response taken to the n’th power:

As frequency increases to well past the corner frequency, the slope of the response becomes a constant:

Since noise is generally expressed in terms of power, and power is the square of voltage:

Therefor if we let f = 10ft, i.e. 1 decade apart, and convert to logarithmic units, we obtain:

A graph of this resembles:     Aliasing Noise Calculation

To find the amount of aliasing noise, one would normally integrate the roll off curve between 0 Hz and fm. However, this results in an infinity since a 0 occurs in the denominator of one of the expressions. For this reason, the integration limits must be changed to fs and fs – fm.

The area under the curve, (or noise) can be determined as follows:

Normalizing the corner frequency [fm = 1] and signal power [S = 1], the signal to noise ratio in dB is given by:

[Remember that although the S/N ratio for both power and voltage is numerically identical, the actual voltage level is proportional to the square root of the power level.]

A plot of the S/N power as a function of the sampling coefficient and number of poles resembles:

This relatively straightforward analysis becomes complicated when we start to take the spectral characteristics of flat-topped sampling into account. Recall that the sampled spectrum follows the sinc envelope. This causes unequal amplitude sidebands centered at the sampling rate.

Notice that as the sampling frequency is reduced, the LSB associated with it overlaps the baseband signal produces more aliasing noise that if naturally sampled.

This additional aliasing noise occurs because the amplitude of the LSB components increase as frequency decreases. To minimize this, high order antialiasing filters are required to filter the baseband signal before sampling.

There are two different methods to integrate analog functions such as filtering. One very powerful technique is to employ DSP where the input signal is converted to the digital domain and the function implemented in either digital hardware or software. A second method uses switched capacitor technology. This is a sort of analog-digital hybrid technique.

One of the main applications for switched capacitor filters is in antialiasing filters. A DSP implementation would use over-sampling and decimation.     Switched Capacitor Filters

Quasi-digital circuits are currently implementing many of the traditional analog type functions. A switch is used to transfer an accumulated charge from the input to the output.

The amount of charge entering or leaving the capacitor is dependent on its capacitance and the voltage differential.

If the switching speed is fast enough, the charging curve will appear linear and dependent on the clock rate [f].

Or as it is more usually written         

Note the similarity with Ohm's Law, where:    

Example: RC Low Pass Filter

The corner frequency is given by:   


Note that the 3 dB cutoff frequency is determined by the capacitor ratios and the clock frequency. This process can be continued to create any order of filter desired.

Commercially Available Switched Capacitor Filters




2nd order universal filter


2nd order wideband universal filter


Dual 4th order universal filter


4th order universal filter


6th order low pass


2nd order universal filter


4th order low pass


4th order notch


12th order universal mask programmable


3.5.2    Decimation

Another way to reduce aliasing noise is to over-sample and then discard most of the results. In the frequency domain we observe:

In the above illustration, the sampling frequency is 8 times that of the baseband cutoff, or 4 times the Nyquist limit. Thus, the aliasing noise is low.

In the time domain, over-sampling a sine wave may resemble:

Since the sampling rate in this example is 8 times that of the highest baseband component, 3/4 of the samples can be discarded:

Although the sample rate is now at the Nyquist limit, the effective sampling coefficient is still 4. Thus providing an improvement in the S/N ratio without the need for stringent baseband filters. Over-sampling and decimation is one of the techniques used in audio CDs.

3.6     Quantization Encoding

Ultimately, the reason for sampling an analog waveform is to convert it to a digital equivalent. However, this conversion process itself introduces another form of noise.

The number of different values an analog signal can have is limited by the resolution or number of bits in the encoding process. It would take an infinite number of bits to perfectly encode an analog signal. As a result, a quantization error or noise is introduced into the signal.

3.6.1    Quantization Noise

Noise associated with step size is known as quantization noise.

It is relatively easy to determine the amount of quantizing noise present if linear signals are digitized. The amount of noise is equal to the difference between the input analog signal and the quantized signal. This difference can be found by integration.     Quantization Noise Calculation

One situation which can occur is when the analog input signal just enters the quantization window at the beginning of the sampling period, and rises to the upper end of the quantization window during the hold interval. In this case, the quantization error at any instant is given by:

For an n bit code, there are a total of 2n-1 quantization steps. Consequently the instantaneous quantization error for an n bit D/A converter is:

Since S/N values are ultimately specified in terms of power, it is necessary to convert this noise to RMS units. This is done as follows:

The square:          

The mean of the square:    

The root of the mean of the square: 

The rms value is therefor given by: 

A graph of this function resembles:

3.7     Companding

Telecommunications signals are seldom linearly encoded, but rather are companded [a combination of compression & expansion]. This allows for a more uniform S/N ratio over the entire range of signal sizes.

If the quantization step size is constant, the S/N ratio decreases for small signals. To prevent this, the step size varies according to the signal size.

Compression can be performed by passing the signal through a logarithmic amplifier and then digitizing. However, more consistent performance can be achieved if the operation is done digitally. The analog signal is linearly over digitized. Since the most significant bits for low amplitude signals are zero, they are ignored. For high amplitude inputs, the least significant bits are ignored. The net result is bit reduction and amplitude compression.

3.7.1    Digital Companding

The digital compression is performed in the A/D converter. An analog signal is digitized into 12 bits using linear encoding and compressed to 8 bits:

Compression is performed as follows:

   Step 1:        the 1st bit [sign bit] is left unaffected

   Step 2:        determine the segment number: subtract from 7, the number of leading zero's in the 12-bit word [this forms the segment number and consti­tutes the next 3 bits of the compressed 8 bit word]

   Step 3:        determine the step within the segment: copy the next 4 bits of the 12 bit word, into the next 4 bit positions of the 8 bit word

   If there are more than 7 leading zeros, set the segment number to zero and copy the last 4 bits of the 12 bit word into the last 4 bit positions of the 8 bit word

3.7.2    Digital Expansion

Digital expansion occurs in the D/A converter section. The 8 bit word can be expanded to 12 bits as follows:

   Step 1:        the 1st bit [sign bit] is left unaffected

   Step 2:        the segment number is used to regenerate the number of leading zeros

   Step 3:        the next 4 bits are inserted as is

   If there are any more bit positions left in the 12 bit word, the next bit is set high, and all others are set low [since the last group of bits is not known, the mid value is chosen]

Digital Companding Animation

The consequences of this scheme are:

   Segments 0 & 1 in the 12-bit word are accurately reproduced

   Segment 2, which has 32 possible 12 bit codes, is compressed to 16, 8 bit codes

   Segment 3, which has 64 possible 12 bit codes, is compressed to 16, 8 bit codes etc.

The following table illustrates the effect of compression, using sign magnitude notation.


Compression Ratio

12 Bit Code


8-Bit Code

Expanded Code










































3.7.3    Logarithmic Companding Curves

Compression can also be performed by means of logarithms. The telecom industry has used logs to measure acoustic and electrical signals right from the beginning. The most common is the dB unit.

The logarithmic curve applies only for positive input values. This in itself is does not present an overwhelming problem since the absolute value of a signal can be determined before taking its log. The original signal polarity can be conveyed by placing a sign bit in front of the digitized value.

The chief difficulty with the log curve is that it does not pass through the origin and is therefor not suitable for digitizing small signals. The log of values approaching zero, becomes large very quickly. This deficiency can be overcome: by shifting the log curve to the origin, or by crating a tangent from the origin to the curve. Both approaches are used.

This subtle difference has an effect on coding small signals. Unfortunately, both standards are widely used. The origin shift approach is used in the North American µ-law codecs, while the tangential approach is used in the European A-law codecs.

The defining equations for these two systems is given by:

m-Law [North America]

A-Law [Europe]


A-Law and µ-Law Curves

These continuous functions are not directly implemented but are approximated by linear segments. This is accomplished by using a high-resolution linear coder, and then ignoring the least significant bits as the input signal amplitude increases.

Notice that the segment progression [1, 2, 4, 8, etc.] can be implemented concurrently or consecutively. The North American µ-law system uses a consecutive progression, while the European A-law uses concurrent progression. Because of this, the first two segments or chords in the European system have the same step size. Consequently, the µ-law system has 15 different segments, while the A-law approach has only 13.

Another difference between North American and European implementations is the digital code itself. µ-law uses folded binary notation while A-law uses sign magnitude. Furthermore, the µ-law system defines the origin as mid step while A-law defines it as mid riser.

Because of these differences, all digitized telephone channels between North America and Europe must pass through a digital converter. This is generally a simple look-up table, which translates one 8-bit pattern for another.

SystemView Examples

Companding Curve

The companding curve can easily be created by applying a ramp input to a compand token.

Simulation Model

Companding Curve

The companding curve has a profound impact on input signals depending on their amplitude. Small signals will be relatively unaltered while large signals undergo a radical change.

Effect of Companding on Small and Large Signals


Companding helps to keep the signal to quantization noise ratio relatively constant over the entire range of input levels.

3.8             Delta Modulation

In most situations in the analog domain, signal values change relatively little between adjacent samples. Therefor one way to reduce the number of bits sent is to transmit only the changes between samples. This is a more general form of differential modulation found in PSK systems. The delta modulator merely has to transmit whether the current sample is greater or less than the previous one.

This circuit is sometimes referred to as a 1 bit DAC, and is used as the bases for digital encoding on audio CDs.

Output Waveform

These waveforms may be seen in the delta modulator file provided by MathCAD in their electrical engineering handbook.

MathCAD Delta Modulator Simulation

The integrator in a delta modulator may be an RC circuit or a digital memory device. A comparator determines the difference between the present value of the input and the previous value. If the present value is greater, the output is a +1. If the present value is smaller than the previous one, the output is a -1. However, if there is a step size imbalance in the encoder, a dc offset may accumulate, and the circuit may saturate. To overcome this, the output may be passed through a very low pass filter and used as a feedback signal to eliminate any drift.

The principle advantage of this system is its simplicity. High sampling rate eases the design requirements on the anti-aliasing filters since the spectral components created by sampling are widely separated.

The quantization noise in delta modulation is sometimes referred to as granular noise, and is most noticeable in slowly varying signals. Slope overload distortion occurs if the input signal changes faster than the encoding circuit can respond. This difficulty can be solved by dynamically adjusting the step value in the modulator. This is similar to companding in a telephony codec.

More information on delta modulation can be found in the following MXCOM applications note:

3.8.1    Delta Demodulator

The receiver is quite straightforward since it merely has to accumulate the changes coming in to determine what the present value should be. DC offset accumulation may be eliminated by a low frequency feedback signal

3.8.2        Adaptive Delta Modulation

In a simple delta modulator, each output pulse has the same quantization level. However, if the comparator output is constant for several clock periods, it means that the integrator in the feedback loop has not caught up with the input. In order to catch-up, the output can be rectified, integrated and used to control the gain of the error signal.

Companding tends to keep the signal to noise ratio more or less constant over a wide range of input signal levels.

The signal to noise ratio is also a function of the number of steps or clocks per second.

3.8.3    SystemView Model

Analog Input/Output Signal

Transmitted Signal

Assignment Questions


Quick Quiz

1.     [Natural, Flat topped] sampling has components resembling DSBSC.

2.     The binary weighted DAC only requires two sizes of resistors. [True, False]

3.     The [tracking, flash] ADC has a DAC in the feedback loop.

4.     Natural sampling prevents [aliasing, aperture error].

5.     Aliasing is also known as [foldover, aperture, quantization] distortion.

6.     Quantization noise is a function of step [rate, size].

7.     In the following expression:


        The value k is the [number of poles, sampling coefficient, number of bits].

8.     In the following expression:

        The value n is the [number of poles, sampling coefficient, number of bits].

9.     The value of µ in a standard µ-law codec is __________.

10.   The value of A in a standard A-law codec is __________.

11.   The capacitance ratio in a switched capacitor filter is not crucial. [True, False]

12.   Switched capacitor filters require non-overlapping split phase clocks. [True, False]


Analytical Problems

1.     Calculate the S/N ratio due to aliasing if the antialiasing filter has 8 poles and the sampling rate is 2.4 times the highest baseband frequency:

2.     Compress the following bit patterns to 8 bits, and then re-expand them to 12 bits:


a) 1011 0110 1100

b)    0000 0001 0100

3.     A codec has the following characteristics:

8 KHz sampling

12-bit resolution

3.4 KHz cutoff frequency

4 pole antialiasing filter

        If the input is 1 Vrms full scale, determine:

a) Noise due to aliasing

b)    rms quantization noise

c) Suggest how the S/N could be improved.

Composition Questions

1.     Illustrate in both the time and frequency domain the differences between natural and flat-topped sampling.

2.     Under what circumstances can a sampling waveform have harmonic frequencies, and yet when used to sample a baseband signal they disappear?

3.     Illustrate and explain the difference between aperture error and aliasing. Use both time and frequency domain sketches.

4.     Discuss how to avoid aliasing.

5.     Why are there two low pass filters in a CODEC?

6.     What is decimation?

7.     What is the principle relationship between companding and signal to quantization noise ratio?

8.     How does a codec differ from an ADC/DAC?

SystemView Models

1.     Create a model that naturally samples a 1 KHz sinewave and plot the time and frequency domain results.

2.     Create a model that flattop samples a 1 KHz sinewave and plot the time and frequency domain results.

For Further Research



               Pulse Amplitude Modulation

               Double Sideband Suppressed Carrier