2.8 Introduction to Conversion

2.8 Introduction to Conversion

There are a number of ways in which an audio waveform can be digitally represented, but the most useful and therefore common is PCM, which was introduced in Chapter 1. The input is a continuous-time , continuous-voltage waveform, and this is converted into a discrete-time, discrete-voltage format by a combination of sampling and quantizing. As these two processes are orthogonal (at right angles to one another) they are totally independent and can be performed in either order. Figure 2.4(a) shows an analog sampler preceding a quantizer, whereas (b) shows an asynchronous quantizer preceding a digital sampler. Ideally, both will give the same results; in practice each suffers from different deficiencies. Both approaches will be found in real equipment. In video convertors operating speed is a priority and the flash convertor is universally used. In the flash convertor the quantizing step is performed first and the quantized signal is subsequently sampled. In audio the sample accuracy is a priority and sampling first has the effect of freezing the signal voltage to allow time for an accurate quantizing process.

image from book
Figure 2.4: Since sampling and quantizing are orthogonal, the order in which they are performed is not important. At (a) sampling is performed first and the samples are quantized. This is common in audio convertors. At (b) the analog input is quantized into an asynchronous binary code. Sampling takes place when this code is latched on sampling clock edges. This approach is universal in video convertors.

The independence of sampling and quantizing allows each to be discussed quite separately in some detail, prior to combining the processes for a full understanding of conversion.

2.8.1 Sampling and Aliasing

Sampling is no more than periodic measurement, and it will be shown here that there is no theoretical need for sampling to be audible. Practical equipment may, of course, be less than ideal, but, given good engineering practice, the ideal may be approached quite closely.

Sampling must be precisely regular, because the subsequent process of timebase correction assumes a regular original process. The sampling process originates with a pulse train shown in Figure 2.5(a) to be of constant amplitude and period. The signal waveform amplitude-modulates the pulse train in much the same way as the carrier is modulated in an AM radio transmitter. One must be careful to avoid overmodulating the pulse train as shown in (b) and this is helped by applying a DC offset to the analog waveform so that, in audio, silence corresponds to a level half-way up the pulses as in (c). This approach will also be used in colour difference signals where blanking level will be shifted up to the midpoint of the scale. Clipping due to any excessive input level will then be symmetrical.

image from book
Figure 2.5: The sampling process requires a constant amplitude pulse train as shown at (a). This is amplitude modulated by the waveform to be sampled. If the input waveform has excessive amplitude or incorrect level, the pulse train clips as shown at (b). For an audio waveform, the greatest signal level is possible when an offset of half the pulse amplitude is used to centre the waveform as shown at (c).

In the same way that AM radio produces sidebands or images above and below the carrier, sampling also produces sidebands; although the carrier is now a pulse train and has an infinite series of harmonics as can be seen in Figure 2.6(a). The sidebands in (b) repeat above and below each harmonic of the sampling rate.

image from book
Figure 2.6: (a) Spectrum of sampling pulses. (b) Spectrum of samples. (c) Aliasing due to sideband overlap. (d) Beat-frequency production. (e) Four-times oversampling .

The sampled signal can be returned to the continuous-time domain simply by passing it into a low-pass filter. This filter has a frequency response that prevents the images from passing, and only the baseband signal emerges, completely unchanged.

If an input is supplied having an excessive bandwidth for the sampling rate in use, the sidebands will overlap, and the result is aliasing, where certain output frequencies are not the same as their input frequencies but become difference frequencies. It will be seen from (c) that aliasing occurs when the input frequency exceeds half the sampling rate, and this derives the most fundamental rule of sampling, first stated by Shannon in the West and at about the same time by Kotelnikov in Russia. This states that the sampling rate must be at least twice the highest input frequency.

In addition to the low-pass filter needed at the output to return to the continuous-time domain, a further low-pass filter is needed at the input to prevent aliasing. If input frequencies of more than half the sampling rate cannot reach the sampler, aliasing cannot occur.

Whilst aliasing has been described above in the frequency domain, it can equally be described in the time domain. In Figure 2.7(a) the sampling rate is obviously adequate to describe the waveform, but in (b) it is inadequate and aliasing has occurred.

image from book
Figure 2.7: At (a) the sampling rate is adequate to reconstruct the original signal. At (b) the sampling rate is inadequate, and reconstruction produces the wrong waveform ( dotted ). Aliasing has taken place.

Aliasing is commonly seen on television and in the cinema, owing to the relatively low frame rates used. With a frame rate of 24 Hz, a film camera will alias on any object changing at more than 12 Hz. Such objects include the spokes of stagecoach wheels, especially when being chased by Native Americans. When the spoke-passing frequency reaches 24 Hz the wheels appear to stop. Aliasing partly explains the inability of opinion polls to predict the results of elections . Aliasing does, however, have useful applications, including the stroboscope, which makes rotating machinery appear stationary, and the sampling oscilloscope, which can display periodic waveform of much greater frequency than the sweep speed of the tube normally allows.

In television systems the input image that falls on the camera sensor will be continuous in time, and continuous in two spatial dimensions corresponding to the height and width of the sensor. All three of these continuous dimensions will be sampled in a digital system. There is a direct connection between the concept of temporal sampling, where the input signal changes with respect to time at some frequency and is sampled at some other frequency, and spatial sampling, where an image changes a given number of times per unit distance and is sampled at some other number of times per unit distance. The connection between the two is the process of scanning. Temporal frequency can be obtained by multiplying spatial frequency by the speed of the scan. Figure 2.8 shows a hypothetical image sensor having 1000 discrete sensors across a width of 1 centimetre. The spatial sampling rate of this sensor is thus 1000 per centimetre. If the sensors are measured sequentially during a scan taking 1 millisecond to go across the 1 centimetre width, the result will be a temporal sampling rate of 1 MHz.

image from book
Figure 2.8: If the above spatial sampling arrangement of 1000 points per centimetre is scanned in 1 millisecond, the sampling rate will become 1 megahertz .

2.8.2 Reconstruction

If ideal low-pass anti-aliasing and anti-image filters are assumed, having a vertical cut-off slope at half the sampling rate, an ideal spectrum shown at Figure 2.9(a) is obtained. Figure 2.9(b) shows that the impulse response of a phase linear ideal low-pass filter is a sin x / x waveform in the time domain. Such a waveform passes through zero volts periodically. If the cut-off frequency of the filter is one-half of the sampling rate, the impulse passes through zero at the sites of all other samples . Thus at the output of such a filter, the voltage at the centre of a sample is due to that sample alone, since the value of all other samples is zero at that instant. In other words the continuous time output waveform must join up the tops of the input samples. In between the sample instants, the output of the filter is the sum of the contributions from many impulses, and the waveform smoothly joins the tops of the samples. If the time domain is being considered , the anti-image filter of the frequency domain can equally well be called the reconstruction filter. It is a consequence of the band-limiting of the original anti-aliasing filter that the filtered analog waveform could only travel between the sample points in one way. As the reconstruction filter has the same frequency response, the reconstructed output waveform must be identical to the original band -limited waveform prior to sampling. It follows that sampling need not be audible. A rigorous mathematical proof of the above has been available since the 1930s, when PCM was invented, and can also be found in Betts 2 .

image from book
Figure 2.9: The impulse response of a low-pass filter which cuts off at F s / 2 has zeros at 1 /F s spacing which correspond to the position of adjacent samples, as shown at (b). The output will be a signal which has the value of each sample at the sample instant, but with smooth transitions from sample to sample.

2.8.3 Filter Design

The ideal filter with a vertical 'brick-wall' cut-off slope is difficult to implement. As the slope tends to vertical, the delay caused by the filter goes to infinity: the quality is marvellous but you do not live to measure it. In practice, a filter with a finite slope is accepted as shown in Figure 2.10, and the sampling rate has to be raised a little to prevent aliasing. There is no absolute factor by which the sampling rate must be raised; it depends upon the available filters.

image from book
Figure 2.10: As filters with finite slope are needed in practical systems, the sampling rate is raised slightly beyond twice the highest frequency in the baseband.

It is not easy to specify such filters, particularly the amount of stopband rejection needed. The amount of aliasing resulting would depend on, among other things, the amount of out-of-band energy in the input signal. This is seldom a problem in video, but can warrant attention in audio where overspecified bandwidths are sometimes found. As a further complication, an out-of-band signal will be attenuated by the response of the anti-aliasing filter to that frequency, but the residual signal will then alias, and the reconstruction filter will reject it according to its attenuation at the new frequency to which it has aliased.

It could be argued that the reconstruction filter is unnecessary in audio, since all of the images are outside the range of human hearing. However, the slightest non- linearity in subsequent stages would result in gross intermodulation distortion. The possibility of damage to tweeters must also be considered. It would, however, be acceptable to bypass one of the filters involved in a copy from one digital machine to another via the analog domain, although a digital transfer is of course to be preferred. In video the filters are essential to constrain the bandwidth of the signal to the allowable broadcast channel width.

The nature of the filters used has a great bearing on the subjective quality of the system. Entire books have been written about analog filters, so they will only be treated briefly here. Figure 2.11 shows the terminology to be used to describe the common elliptic low-pass filter. These filters are popular because they can be realized with fewer components than other filters of similar response. It is a characteristic of these elliptic filters that there are ripples in the passband and stopband. In much equipment the anti-aliasing filter and the reconstruction filter will have the same specification, so that the passband ripple is doubled with a corresponding increase in dispersion. Sometimes slightly different filters are used to reduce the effect.

image from book
Figure 2.11: The important features and terminology of low-pass filters used for anti-aliasing and reconstruction.

It is difficult to produce an analog filter with low distortion. Passive filters using inductors suffer non-linearity at high levels due to the B / H curve of the cores. Active filters can simulate linear inductors using op-amp techniques, but they tend to suffer non-linearity at high frequencies where the falling open -loop gain reduces the effect of feedback. Active filters can also contribute noise, but this is not necessarily a bad thing in controlled amounts, since it can act as a dither source.

It is instructive to examine the phase response of such filters. Since a sharp cut-off is generally achieved by cascading many filter sections that cut at a similar frequency, the phase responses of these sections will accumulate. The phase may start to leave linearity at a fraction of the cut-off frequency and by the time this is reached, the phase may have completed several revolutions. Meyer 3 suggests that these phase errors are audible and that equalization is necessary. In video, phase linearity is essential as otherwise the different frequency components of a contrast step are smeared across the screen. An advantage of linear phase filters is that ringing is minimized, and there is less possibility of clipping on transients.

It is possible to construct a ripple-free phase-linear filter with the required stopband rejection 4 , 5 , but the design effort and component complexity result in expense, and the filter might drift out of specification as components age. The effort may be more effectively directed towards avoiding the need for such a filter. Much effort can be saved in analog filter design by using oversampling. As shown in Figure 2.12 a high sampling rate produces a large spectral gap between the baseband and the first lower sideband. The anti-aliasing and reconstruction filters need only have a gentle roll-off, causing minimum disturbance to phase linearity in the baseband, and the Butterworth configuration, which does not have ripple or dispersion, can be used. The penalty of oversampling is that an excessive data rate results. It is necessary to reduce the rate using a digital low-pass filter (LPF). Digital filters can be made perfectly phase linear and, using LSI, can be inexpensive to construct. The superiority of oversampling convertors means that they have become universal in audio and appear set to do so in video.

image from book
Figure 2.12: In this 4-times oversampling system, the large separation between baseband and sidebands allows a gentle roll-off reconstruction filter to be used.

2.8.4 Sampling Clock Jitter

The instants at which samples are taken in an A/D convertor (ADC) and the instants at which D/A convertors (DACs) make conversions must be evenly spaced ; otherwise unwanted signals can be added to the waveform. Figure 2.13(a) shows the effect of sampling clock jitter on a sloping waveform. Samples are taken at the wrong times. When these samples have passed through a system, the timebase correction stage prior to the DAC will remove the jitter, and the result is shown in Figure 2.13(b). The magnitude of the unwanted signal is proportional to the slope of the signal waveform and so increases with frequency. The nature of the unwanted signal depends on the spectrum of the jitter. If the jitter is random, the effect is noise-like and relatively benign unless the amplitude is excessive. Clock jitter is, however, not necessarily random. Figure 2.14 shows that one source of clock jitter is crosstalk on the clock signal. The unwanted additional signal changes the time at which the sloping clock signal appears to cross the threshold voltage of the clock receiver. The threshold itself may be changed by ripple on the clock receiver power supply. There is no reason why these effects should be random; they may be periodic and potentially discernible.

image from book
Figure 2.13: The effect of sampling timing jitter on noise. (a) A ramp sampled with jitter has an error proportional to the slope. (b) When the jitter is removed by later circuits, the error appears as noise added to samples. The superimposition of jitter may also be considered as a modulation process.
image from book
Figure 2.14: Crosstalk in transmission can result in unwanted signals being added to the clock waveform. It can be seen here that a low-frequency interference signal affects the slicing of the clock and causes a periodic jitter.

The allowable jitter is measured in picoseconds in both audio and video signals, as shown in Figure 2.13, and clearly steps must be taken to eliminate it by design. Convertor clocks must be generated from clean power supplies that are well decoupled from the power used by the logic because a convertor clock must have a good signal-to-noise ratio. If an external clock is used, it cannot be used directly, but must be fed through a well-damped phase-locked loop that will filter out the jitter. The external clock signal is sometimes fed into the clean circuitry using an optical coupler to improve isolation.

Although it has been documented for many years , attention to control of clock jitter is not as great in actual audio hardware as it might be. It accounts for much of the slight audible differences between convertors reproducing the same data. A well-engineered convertor should substantially reject jitter on an external clock and should sound the same when reproducing the same data irrespective of the source of the data. A remote convertor which sounds different when reproducing, for example, the same Compact Disc via the digital outputs of a variety of CD players is simply not well engineered and should be rejected. Similarly if the effect of changing the type of digital cable feeding the convertor can be heard , the unit is a dud. Unfortunately many consumer external DACs fall into this category, as the steps outlined above have not been taken.

Jitter tends to be less noticeable on digital video signals and is generally not an issue until it becomes great enough to cause data errors.

2.8.5 Aperture Effect

The reconstruction process of Figure 2.9 only operates exactly as shown if the impulses are of negligible duration. In many convertors this is not the case, and many keep the analog output constant until a different sample value is input and produces a waveform more like a staircase than a pulse train. In this case the pulses have effectively been extended in width to become equal to the sample period. This is known as a zero-order hold system and has a 100% aperture ratio. Note that the aperture effect is not apparent in a track-hold system; the holding period is for the convenience of the quantizer which outputs a value corresponding to the input voltage at the instant hold mode was entered.

Whereas pulses of negligible width have a uniform spectrum, which is flat within the audio band, pulses of 100% aperture have a sin x / x spectrum shown in Figure 2.15. The frequency response falls to a null at the sampling rate, and as a result is about 4 dB down at the edge of the baseband. If the pulse width is stable, the reduction of high frequencies is constant and predictable, and an appropriate equalization circuit can render the overall response flat once more. An alternative is to use resampling whose effect is shown in Figure 2.16. Resampling passes the zero-order-hold waveform through a further synchronous sampling stage consisting of an analog switch that closes briefly in the centre of each sample period. The output of the switch will be pulses that are narrower than the original. If, for example, the aperture ratio is reduced to 50% of the sample period, the first response null is now at twice the sampling rate, and the loss at the edge of the audio band is reduced. As the figure shows, the frequency response becomes flatter as the aperture ratio falls. The process should not be carried too far, as with very small aperture ratios there is little energy in the pulses and noise can be a problem. A practical limit is around 12.5% where the frequency response is virtually ideal.

image from book
Figure 2.15: Frequency response with 100% aperture nulls at multiples of the sampling rate. The area of interest is up to half the sampling rate.
image from book
Figure 2.16: (a) A resampling circuit eliminates transients and reduces aperture ratio. (b) Response of various aperture ratios.

The aperture effect will show up in many aspects of television. Lenses have finite modulation transfer functions, such that a very small object becomes spread in the image. The image sensor will also have a finite aperture function. In tube cameras, the beam will have a finite radius, and will not necessarily have a uniform energy distribution across its diameter. In CCD cameras , the sensor is split into elements that may almost touch in some cases. The element integrates light falling on its surface, and so will have a rectangular aperture. In both cases there will be a roll-off of higher spatial frequencies.

It is highly desirable to prevent spatial aliasing, since the result is visually irritating . In tube cameras the aliasing will be in the vertical dimension only, since the horizontal dimension is continuously scanned. Such cameras seldom attempt to prevent vertical aliasing. CCD sensors can, however, alias in both horizontal and vertical dimensions, and so an anti-aliasing optical filter is generally fitted between the lens and the sensor. This takes the form of a plate that diffuses the image formed by the lens. Such a device can never have a sharp cut-off nor will the aperture be rectangular. The aperture of the anti-aliasing plate is in series with the aperture effect of the CCD elements, and the combination of the two effectively prevents spatial aliasing, and generally gives a good balance between horizontal and vertical resolution, allowing the picture a natural appearance.

Conventional tube cameras generally have better horizontal resolution, and produce vertical aliasing which has a similar spatial frequency to real picture information, but which lacks realism . With a conventional approach, there are effectively two choices. If aliasing is permitted, the theoretical information rate of the system can be approached. If aliasing is prevented, realizable anti-aliasing filters cannot sharp cut, and the information conveyed is below system capacity.

These considerations also apply at the television display. The display must filter out spatial frequencies above one-half the sampling rate. In a conventional CRT this means that an optical filter should be fitted in front of the screen to render the raster invisible. Again the aperture of a simply realizable filter would attenuate too much of the wanted spectrum, and so the technique is not used. The technique of spot wobble was most effective in reducing raster visibility in monochrome television sets without affecting horizontal resolution, and its neglect remains a mystery.

As noted, in conventional tube cameras and CRTs the horizontal dimension is continuous, whereas the vertical dimension is sampled. The aperture effect means that the vertical resolution in real systems will be less than sampling theory permits , and to obtain equal horizontal and vertical resolutions a greater number of lines are necessary. The magnitude of the increase is described by the so-called Kell factors 6 , although the term factor is a misnomer since it can have a range of values depending on the apertures in use and the methods used to measure resolution 7 . In digital video, sampling takes place in horizontal and vertical dimensions, and the Kell parameter becomes unnecessary. The outputs of digital systems will, however, be displayed on raster scan CRTs, and the Kell parameter of the display will then be effectively in series with the other system constraints.

2.8.6 Choice of Audio Sampling Rate

The Nyquist criterion is only the beginning of the process that must be followed to arrive at a suitable sampling rate. The slope of available filters will compel designers to raise the sampling rate above the theoretical Nyquist rate. For consumer products, the lower the sampling rate the better, since the cost of the medium is directly proportional to the sampling rate: thus sampling rates near to twice 20 kHz are to be expected. For professional products, there is a need to operate at variable speed for pitch correction. When the speed of a digital recorder is reduced, the offtape sampling rate falls, and Figure 2.17 shows that with a minimal sampling rate the first image frequency can become low enough to pass the reconstruction filter. If the sampling frequency is raised without changing the response of the filters, the speed can be reduced without this problem. It follows that variable-speed recorders must use a higher sampling rate.

image from book
Figure 2.17: At normal speed, the reconstruction filter correctly prevents images entering the baseband, as at (a). (b) When speed is reduced, the sampling rate falls, and a fixed filter will allow part of the lower sideband of the sampling frequency to pass. (c) If the sampling rate of the machine is raised, but the filter characteristics remain the same, the problem can be avoided.

In the early days of digital audio research, the necessary bandwidth of about 1 megabit per second per audio channel was difficult to store. Disk drives had the bandwidth but not the capacity for long recording time, so attention turned to video recorders. These were adapted to store audio samples by creating a pseudo-video waveform that could convey binary as black and white levels 8 . The sampling rate of such a system is constrained to relate simply to the field rate and field structure of the television standard used, so that an integer number of samples can be stored on each usable TV line in the field. Such a recording can be made on a monochrome recorder, and these recordings are made in two standards, 525 lines at 60Hz and 625 lines at 50Hz. Thus it is possible to find a frequency which is a common multiple of the two and also suitable for use as a sampling rate.

The allowable sampling rates in a pseudo-video system can be deduced by multiplying the field rate by the number of active lines in a field (blanked lines cannot be used) and again by the number of samples in a line. By careful choice of parameters it is possible to use either 525/60 or 625/50 video with a sampling rate of 44.1 kHz.

In 60 Hz video, there are 35 blanked lines, leaving 490 lines per frame, or 245 lines per field for samples. If three samples are stored per line, the sampling rate becomes 60 — 245 — 3 = 44.1 kHz.

In 50 Hz video, there are 37 lines of blanking, leaving 588 active lines per frame, or 294 per field, so the same sampling rate is given by 50 — 294 — 3 = 44.1 kHz.

The sampling rate of 44.1 kHz came to be that of the Compact Disc. Even though CD has no video circuitry, the equipment used to make CD masters was originally video based and determined the sampling rate.

For landlines to FM stereo broadcast transmitters having a 15 kHz audio bandwidth, the sampling rate of 32 kHz is more than adequate, and has been in use for some time in the United Kingdom and Japan. This frequency is also in use in the NICAM 728 stereo TV sound system. The professional sampling rate of 48 kHz was proposed as having a simple relationship to 32 kHz, being far enough above 40 kHz for variable-speed operation, and having a simple relationship with PAL video timing which would allow digital video recorders to store the convenient number of 960 audio samples per video field. This is the sampling rate used by all of the professional DVTR formats 9 . The field rate offset of NTSC does not easily relate to any of the above sampling rates, and requires special handling that will be discussed further in this book.

Although in a perfect world the adoption of a single sampling rate might have had virtues, for practical and economic reasons digital audio now has essentially three rates to support: 32 kHz for broadcast, 44.1 kHz for CD, and 48 kHz for professional use 10 . Variations of the DAT format will support all of these rates, although the 32 kHz version is uncommon.

Recently there have been suggestions that extremely high sampling rates such as 96 and even 192 kHz are necessary for audio. Repeatable experiments to verify that this is the case seem to be elusive . It seems unlikely that all the world's psychoacoustic researchers would have so seriously underestimated the bandwidth of human hearing. It may simply be that the cost of electronic devices and storage media have fallen to the extent that there is little penalty in adopting such techniques, even if greater benefit would be gained by attending to areas in which progress would truly be beneficial, such as microphones and loudspeakers.

2.8.7 Choice of Video Sampling Rate

Component or colour difference signals are used primarily for post-production work where quality and flexibility are paramount. In a digital colour difference system, the analog input video will be converted to the digital domain and will generally remain there whilst being operated on in digital effects units. The finished work will then be returned to the analog domain for transmission. The number of conversions is relatively few.

In contrast, composite digital video recorders are designed to work in an existing analog environment and so the number of conversions a signal passes through will be greater. It follows that composite will require a higher sampling rate than component so that filters with a more gentle slope can be used to reduce the build-up of response ripples.

In colour difference working, the important requirement is for image manipulation in the digital domain. This is facilitated by a sampling rate that is a multiple of line rate because then there is a whole number of samples in a line and samples are always in the same position along the line and can form neat columns . A practical difficulty is that the line period of the 525 and 625 systems is slightly different. The problem was overcome by the use of a sampling clock which is an integer multiple of both line rates. For standard definition working, the rate of 13.5 MHz is sufficient for the requirements of sampling theory, yet allows a whole number of samples in both line standards with a common clock frequency.

The colour difference signals have only half the bandwidth of the luminance and so can be sampled at one-half the luminance rate, i.e. 6.75 MHz. Extended and high definition systems require proportionately higher rates.

In composite video, the most likely process to be undertaken in the digital domain is decoding to components. This is performed, for example, in video recorders running in slow motion. Separation of luminance and chroma in the digital domain is simpler if the sampling rate is a multiple of the subcarrier frequency. Whilst three times the frequency of subcarrier is adequate from a sampling theory standpoint, this does require relatively steep filters, so as a practical matter four times subcarrier is used.

In high definition systems, clearly the sampling rate must rise. Doubling the resolution requires twice as many lines and twice as many pixels in each line, so the sampling rate must be quadrupled. However, a further factor is the adoption of 16:9 aspect ratio instead of 4:3 so that the rate becomes yet higher as each line has more than twice as many pixels. In some cases 74.25 MHz is used. Eventually it became clear that the proliferation of frame rates and image sizes would make it impossible to interface. The solution for HD was to adopt what is essentially a fixed clock rate interface that can support a variety of actual data rates by using variable amounts of blanking. Thus the actual video sampling rate can be whatever is appropriate for the picture size and rate to give square pixels.

2.8.8 Quantizing

Quantizing is the process of expressing some infinitely variable quantity by discrete or stepped values. Quantizing turns up in a remarkable number of everyday guises. Figure 2.18 shows that an inclined ramp allows infinitely variable height, whereas on a stepladder only discrete height is possible. A stepladder quantizes height. When accountants round off sums of money to the nearest pound or dollar they are quantizing.

image from book
Figure 2.18: An analog parameter is continuous whereas a quantized parameter is restricted to certain values. Here the sloping side of a ramp can be used to obtain any height whereas a ladder only allows discrete heights.

In audio and video the values to be quantized are infinitely variable voltages from an analog source. Strict quantizing is a process restricted to the signal amplitude domain only. For the purpose of studying the quantizing of a single sample, time is assumed to stand still. This is achieved in practice either by the use of a track-hold circuit or the adoption of a quantizer technology that operates before the sampling stage.

Figure 2.19(a) shows that the process of quantizing divides the signal voltage range into quantizing intervals Q . In applications such as telephony these may be of differing size, but for digital audio and video the quantizing intervals are made as identical as possible. If this is done, the binary numbers which result are truly proportional to the original analog voltage, and the digital equivalents of mixing and gain changing can be performed by adding and multiplying sample values. If the quantizing intervals are unequal this cannot be done. When all quantizing intervals are the same, the term uniform quantizing is used. The term linear quantizing will be found, but this is, like military intelligence, a contradiction in terms.

image from book
Figure 2.19: Quantizing assigns discrete numbers to variable voltages. All voltages within the same quantizing interval are assigned the same number which causes the DAC to produce the voltage at the centre of the intervals shown by the dashed lines at (a). This is the characteristic of the mid-tread quantizer shown at (b). An alternative system is the mid- riser system shown at (c). Hero 0 volts analog falls between two codes and there is no code for zero. Such quantizing cannot be used prior to signal processing because the number is no longer proportional to the voltage. Quantizing error cannot exceed 0.5Q as shown at (d).

The term LSB (Least Significant Bit) will also be found in place of quantizing interval in some treatments , but this is a poor term because quantizing is not always used to create binary values and because a bit can only have two values. In studying quantizing we wish to discuss values smaller than a quantizing interval, but a fraction of an LSB is a contradiction in terms.

Whatever the exact voltage of the input signal, the quantizer will determine the quantizing interval in which it lies. In what may be considered a separate step, the quantizing interval is then allocated a code value that is typically some form of binary number. The information sent is the number of the quantizing interval in which the input voltage lay. Exactly where that voltage lay within the interval is not conveyed, and this mechanism puts a limit on the accuracy of the quantizer. When the number of the quantizing interval is converted back to the analog domain, it will result in a voltage at the centre of the quantizing interval as this minimizes the magnitude of the error between input and output. The number range is limited by word length of the binary numbers used. In a 16-bit system commonly used for audio, 65 536 different quantizing intervals exist, whereas video systems typically have eight-bit systems having 256 quantizing intervals.

2.8.9 Quantizing Error

It is possible to draw a transfer function for such an ideal quantizer followed by an ideal DAC, and this is shown in Figure 2.19(b). A transfer function is simply a graph of the output with respect to the input. When the term linearity is used, this generally means the straightness of the transfer function. Linearity is a goal in audio and video, yet it will be seen that an ideal quantizer is anything but.

Figure 2.19(b) shows that the transfer function is somewhat like a staircase, and the voltage corresponding to audio muting or video blanking is half way up a quantizing interval, or on the centre of a tread. This is the so-called mid-tread quantizer universally used in audio and video. Figure 2.19(c) shows the alternative mid-riser transfer function that causes difficulty because it does not have a code value at muting/blanking level and as a result the code value is not proportional to the signal voltage.

Quantizing causes a voltage error in the sample given by the difference between the actual staircase transfer function and the ideal straight line. This is shown in Figure 2.19(d) to be a sawtooth function periodic in Q . The amplitude cannot exceed 0.5 Q unless the input is so large that clipping occurs.

In studying the transfer function it is better to avoid complicating matters with the aperture effect of the DAC. For this reason it is assumed here that output samples are of negligible duration. Then impulses from the DAC can be compared with the original analog waveform and the difference will be impulses representing the quantizing error waveform. As can be seen in Figure 2.20 the quantizing error waveform can be thought of as an unwanted signal that the quantizing process adds to the perfect original. As the transfer function is non-linear, ideal quantizing can cause distortion. As a result practical digital audio devices use non-ideal quantizers to achieve linearity. The quantizing error of an ideal quantizer is a complex function, and it has been researched in great depth 11 . It is not intended to go into such depth here. The characteristics of an ideal quantizer will only be pursued far enough to convince the reader that they cannot be used.

image from book
Figure 2.20: At (a) an arbitary signal is represented to finite accuracy by PAM needles whose peaks are at the centre of the quantizing intervals. The errors caused can be thought of as an unwanted signal (b) added to the original.

As the magnitude of the quantizing error is limited, the effect can be minimized by the use of a larger signal. This will require more quantizing intervals and more bits to express them. The number of quantizing intervals multiplied by their size gives the quantizing range of the convertor. A signal outside the range will be clipped. Clearly if clipping is avoided, the larger the signal the less will be the effect of the quantizing error.

Consider first the case where the input signal exercises the whole quantizing range and has a complex waveform. In audio this might be orchestral music; in video a bright, detailed contrasting scene. In these cases successive samples will have widely varying numerical values and the quantizing error on a given sample will be independent of that on others. In this case the size of the quantizing error will be distributed with equal probability between the limits. Figure 2.21(a) shows the resultant uniform probability density. In this case the unwanted signal added by quantizing is an additive broadband noise uncorrelated with the signal, and it is appropriate in this case to call it quantizing noise. This is not quite the same as thermal noise which has a Gaussian probability shown in Figure 2.21(b). The subjective difference is slight. Treatments that then assume that quantizing error is always noise give results at variance with reality. Such approaches only work if the probability density of the quantizing error is uniform. Unfortunately at low levels, and particularly with pure or simple waveforms, this is simply not true.

image from book
Figure 2.21: (a) The amplitude of a quantizing error needle will be from -0.5 Q to +0.5 Q with equal probability. (b) White noise in analog circuits generally has Gaussian amplitude distribution.

At low levels, quantizing error ceases to be random, and becomes a function of the input waveform and the quantizing structure. Once an unwanted signal becomes a deterministic function of the wanted signal, it has to be classed as a distortion rather than a noise. We predicted a distortion because of the non-linearity or staircase nature of the transfer function. With a large signal, there are so many steps involved that we must stand well back, and a staircase with many steps appears to be a slope. With a small signal there are few steps and they can no longer be ignored.

The non-linearity of the transfer function results in distortion, which produces harmonics. Unfortunately these harmonics are generated after the anti-aliasing filter, and so any which exceed half the sampling rate will alias. Figure 2.22 shows how this results in anharmonic distortion in audio. These anharmonics result in spurious tones known as birdsinging. When the sampling rate is a multiple of the input frequency the result is harmonic distortion. This is shown in Figure 2.23. Where more than one frequency is present in the input, intermodulation distortion occurs, which is known as granulation.

image from book
Figure 2.22: Quantizing produces distortion after the anti-aliasing filter, thus the distortion products will fold back to produce anharmonics in the audio band. Here the fundamental of 15 kHz produces 2nd and 3rd harmonic distortion at 30 and 45 kHz. This results in aliased products at 40-30 = 10 kHz and 4045 = (-)5 kHz.
image from book
Figure 2.23: Mathematically derived quantizing error waveform for a sine wave sampled at a multiple of itself. The numerous autocorrelations between quantizing errors show that there are harmonics of the signal in the error, and that the error is not random, but deterministic.

As the input signal is further reduced in level, it may remain within one quantizing interval. The output will be silent because the signal is now the quantizing error. In this condition, low-frequency signals such as air-conditioning rumble can shift the input in and out of a quantizing interval so that the quantizing distortion comes and goes, resulting in noise modulation.

In video, quantizing error results in visible contouring on low-key scenes or flat fields. Continuous change of brightness across the screen is replaced by a series of sudden steps between areas of constant brightness.

Needless to say any one of the above effects would prevent the use of an ideal quantizer for high quality work. There is little point in studying the adverse effects further as they can be eliminated completely in practical equipment by the use of dither.

2.8.10 Dither

At high signal level, quantizing error is effectively noise. As the level falls, the quantizing error of an ideal quantizer becomes more strongly correlated with the signal and the result is distortion. If the quantizing error can be decorrelated from the input in some way, the system can remain linear. Dither performs the job of decorrelation by making the action of the quantizer unpredictable.

The first documented use of dither was in picture coding 12 . In this system, the noise added prior to quantizing was subtracted after reconversion to analog. This is known as subtractive dither. Although subsequent subtraction has some slight advantages 11 , it suffers from practical drawbacks, since the original noise waveform must accompany the samples or must be synchronously recreated at the DAC. This is virtually impossible in a system where the signal may have been edited. Practical systems use non-subtractive dither where the dither signal is added prior to quantization and no subsequent attempt is made to remove it. The introduction of dither inevitably causes a slight reduction in the signal-to-noise ratio attainable, but this reduction is a small price to pay for the elimination of non-linearity. As linearity is an essential requirement for digital audio and video, the use of dither is equally essential and there is little point in deriving a signal-to-noise ratio for an undithered system as this has no relevance to real applications. Instead, a study of dither will be used to derive the dither amplitude necessary for linearity and freedom from artefacts , and the signal-to-noise ratio available should follow from that.

The ideal (noiseless) quantizer of Figure 2.19 has fixed quantizing intervals and must always produce the same quantizing error from the same signal. In Figure 2.24 it can be seen that an ideal quantizer can be dithered by linearly adding a controlled level of noise either to the input signal or to the reference voltage used to derive the quantizing intervals. There are several ways of considering how dither works, all of which are valid. The addition of dither means that successive samples effectively find the quantizing intervals in different places on the voltage scale. The quantizing error becomes a function of the dither, rather than just a function of the input signal. The quantizing error is not eliminated, but the subjectively unacceptable distortion is converted into broadband noise that is more benign.

image from book
Figure 2.24: Dither can be applied to a quantizer in one of two ways. At (a) the dither is linearly added to the analog input signal whereas at (b) it is added to the reference voltages of the quantizer.

That noise may be also frequency shaped to take account of the frequency shaping of the ear and eye responses.

An alternative way of looking at dither is to consider the situation where a low level input signal is changing slowly within a quantizing interval. Without dither, the same numerical code results, and the variations within the interval are lost. Dither has the effect of forcing the quantizer to switch between two or more states. The higher the voltage of the input signal within the interval, the more probable it becomes that the output code will take on a higher value. The lower the input voltage within the interval, the more probable it is that the output code will take the lower value. The dither has resulted in a form of duty cycle modulation, and the resolution of the system has been extended indefinitely instead of being limited by the size of the steps.

Dither can also be understood by considering the effect it has on the transfer function of the quantizer. This is normally a perfect staircase, but in the presence of dither it is smeared horizontally until, when the amplitude has increased sufficiently, the average transfer function becomes straight.

The characteristics of the noise used are rather important for optimal performance, although many suboptimal but nevertheless effective systems are in use. The main parameters of interest are the peak-to-peak amplitude, and the probability distribution of the amplitude. Triangular probability works best and this can be obtained by summing the output of two uniform probability processes.

The use of dither invalidates the conventional calculations of signal-to-noise ratio available for a given word length. This is of little consequence as the rule of thumb that multiplying the number of bits in the word length by 6dB gives the S/N ratio will be close enough for all practical purposes.

The technique can also be used to convert signals quantized with more intervals to a lower number of intervals.

It has only been possible to introduce the principles of conversion of audio and video signals here. For more details of the operation of convertors the reader is referred elsewhere 13 , 14 .



Digital Interface Handbook
Digital Interface Handbook, Third Edition
ISBN: 0240519094
EAN: 2147483647
Year: 2004
Pages: 120

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net