Sie sind auf Seite 1von 12

DWR

Analogue-to-Digital Conversion

ROYAL SCHOOL OF ARTILLERY


BASIC SCIENCE & TECHNOLOGY SECTION
Analogue-to-Digital Conversion

INTRODUCTION
hen electronic circuits are used to perform any common function then there are two basic types operating modes that can be used: digital and analogue. Digital circuits are ideal for calculations, signal processing and anything that can be performed by a computer-like circuit. Analogue circuits are ideal both as sensors, at the input to a system, for changing physical quantities (such as temperature and sound pressure) into electrical signals and as actuators, at the putput of a system, for changing electrical signals into physical quantities (e.g. heater, loudspeaker, motor). Thus, it is common to have the outside world connected into an electronic system via analogue devices (sensors) and to have the electronic system connected out to the outside world via analogue devices (actuators, visual-display units, hydraulic valves). However the internal systems, which monitor the inputs and process those data to produce the outputs, are often digital. This is because the digital processes have superior performance and, more importantly, flexibility, because they can operate under computer control. Consequently, there is a need for devices that can change analogue data to digital data and vice-versa. This handout describes the processes of conversion from digital to analogue (and vice-versa), with examples that relate to military equipment.

bers (quantised); each number represents the pressure at the time when it was sampled. Those numbers are recorded on the disc. During playback, the numbers are read and converted to an electrical signal whose Voltage corresponds to the numbers. But the numbers are not an analogue of the sound for two, basic reasons: Time Interval: the measurements are taken at regular intervals and they reveal nothing about how the sound pressure changed in the interval of time between each sample. Pressure Interval: the numbers that are used to represent the sampled pressures form part of a limited scale of integer (whole-number) values (e.g. from zero to 255). A change in pressure that is smaller than one unit might not be recorded (e.g. if the pressure were to change from 123.2 to 123.4 then both would be recorded as 123).

The two points, above, differentiate a digital representation of a physical quantity from its analogue representation. The analogue version is continuous both in time and in magnitude, whereas the digital version is discrete both in time and magnitude.

MILITARY EXAMPLES
ost radar systems no longer display their echoes on a simple screen (the type with the rotating line). Instead, the signals are digitised and processed by a computer. The radar screen is, in reality, a computer display. The computer can maintain vigilance, examining the echoes and determining which are likely to be of interest to the operator. The display might be restricted to targets that the computer programme decides are interesting. Additionally, the computer can add data to the echoes, to reveal such things as height, course and speed. The Air Defence Alerting Device (ADAD) collects thermal emissions from the air ang ground within about 10 km. It has a computer built into it which has the task of distinguishing between radiation from static and moving objects. Furthermore, the system tries to differentiate between a moving military target in the air and a flock of birds or a vehicle. The output from its thermal sensors is in analogue form and has to be converted to digital for processing. The ASP, sound-ranging system, uses sensitive microphones to detect gun sounds and to determine their direction. The microphone produces an electrical signal that is an analogue of the sound pressure. That is converted into digital form for processing by the computer.

THE DIIFERENCE BETWEEN THE ANALOGUE AND THE DIGITAL REPRESENTATIONS OF A PHYSICAL QUANTITY
n years gone by, record manufacturers used the pressure of the sound waves on a diaphragm to move a tiny needle that cut into a soft wax surface. The shape of the cut varied in the same way as the pressure of the sound wave - it was a wiggly-line, the groove of the record, whose side-to-side variations were an analogue of the pressure of the sound wave. As the sound pressure fluctuated up and down, so the position of the groove wandered from side-to-side to produce an exact representation - an analogue - of the pressure variations that made up the sound. On playback, another stylus traced-out the same motion and this was used to produce an electrical analogue that, after amplification, could drive the loudspeaker that reproduced the original sound. The movement of the cone of the loudspeaker is an analogue of the pressure variations of the original sound wave. The Compact Disc is now the standard medium on whic sound is recorded and played back - but there is no wiggly line. The sound pressure is measured at regular intervals (sampled) and converted into a series of num-

27 Jul 04

E06-1

E06 - A-D Conversion.QXD

Analogue-to-Digital Conversion

DWR

Figure 1: Illustrating Place Value in the Denary (Base-Ten) Number System

Digit Number Place Value (Index) Place Value (Number)

7 107

6 106

5 105

4 104

3 103 1,000

2 102 100

1 101 10

0 100 1

10,000,000 1,000,000 100,000 10,000

ANALOGUE CLOCK

he traditional analogue clock has a sweeping second hand. It shows a picture of the time and you have to read the time from it. The same is true of an analogue Voltmeter or Ammeter. An analogue device is able to display the exact value of the measurement that the user must interpret from the display. This is a rounding up or down process. You would report the time shown by this clock to be 10:07:58.

readily determined by the speed at which the pointer moves across the dial. Conversely, the digital version of the clinical thermometer (used for measuring body temperature) is very convenient to use, with little chance of mis-reading. The analogue version had a very thin tube that contained Mercury. Its expansion was an analogue of temperature, but the level was very hard to read and it had to be shaken after each use, to return the mercury to the bottom. The ADAD uses a ring of lights to indicate to the operator the direction in which a threat has been detected. This is much quicker and easier for the operator than being presented with a digital display of the bearing to the threat, because the indication relates directly to what is visible in front of the operator. Most radar screens are analogue, in that the position and motion of the echoes are an analogue of the targets position and motion. The lesson to be learned is that some things work better when presented to the user in analogue form, even when the internal systems are digital.

10:07

DIGITAL CLOCK
digital clock would simply display the time as a group of numbers, rather than as the motion of hands around a clock face. In the example, above, the digital clock shows time at one-minute intervals. There is no indication, as there is in the analogue clock, that the time is about to change from 10:o7 to 10:08. Digital systems ignore changes that are less than the value of their smallest digit.

BINARY REPRESENTATION OF NUMBERS

ANALOGUE AND DIGITAL DISPLAYS


ot all digital displays are ideal for human use. Attempts to replace the conventional analogue speedometer in a car by a digital display have foundered for three reasons:

Time taken to read: each digit of the digital display has to be read and understood by the driver. On the analogue display, the position of the pointer can be taken in at a glance. The position of the pointer is an analogue of speed. Keeping to a set speed: this was found to be quite difficult when using a digital display. The driver had to perform a subtraction to determine how close he was to the desired speed. With an analogue display, the difference in position between desired and actual speed is readily apparent. Noticing changes of speed: when the speed changes then the digits change - but is not apparent whether they went up or down without looking carefully. When using an analogue display, the difference between clockwise and anti-clockwise movement of the Figure 2: Digit Number pointer is immediIllustrating ately obvious. Place Value in Place Value Furthermore, the rate (Index) the Binary of change of speed (Base-Two) Place Value (acceleration) can be Number System (Number)

ost digital devices represent numbers internally in Binary form. The binary system (base-two) is very like the denary system (base-ten) that we normally use to represnt numbers, except that it is based on the number two and not on the number ten. Importantly, the place values are calculated following the same principles, as shown in Figures One and Two. Binary numbers are often classified by the number of binary digits (bits) used to represent them. the largest number that can be represented using n-bits is 2n1, so that a binary number with 4-bits can represent a denary number up to 16 1 or 15. Commonly-used binary number formats, and the numbers that they can store, are: 4-bit: 8-bit: 10-bit: 16-bit: zero to 15 denary. (Called a nybble.) zero to 255 denary. (Called a Byte.) numbers from zero to 1,023 denary. numbers from zero to 65,535 denary. (Often called a Word.)

You should take note of the above values as they occur frequently when describing digital systems.

7 27 128

6 26 64

5 25 32

4 24 16

3 23 8

2 22 4

1 21 2

0 20 1

E06 - A - D Conversion.QXD

E06-2

27 Jul 04

DWR

Analogue-to-Digital Conversion

SAMPLING RATE

STAGECOACH WHEELS IN COWBOY FILMS

he sampling rate of a digital measuring system is the number of times each second that it measures the value of the physical property that it is observing. There is no universal setting of sampling rate that suits all purposes and the sampling rate must be chosen to suit the quantity being measured. For example: a person trying to lose weight on a diet might sample his weight daily or weekly; a person making observations of meteoroligical conditions for gunnery calculations might launch a balloon every two hours; the sound pressure samples used to record music on compact discs are taken at a rate of about forty-four thousand samples per second (44.1 kHz) for each channel (left and right, for stereo reproduction). However, there is a simple rule that can be used to determine the minimum value of the sampling rate that can be used for a given signal: the sampling rate must be greater than twice the value of the highest frequency that is contained in the signal being sampled. This is called the Nyquist Criterion for sampling. This can be re-phrased as a requirement that there must be at least two samples taken for each cycle of the highest frequency in the signal being sampled. For example: if you wanted to observe the changes in sea-level that occur when the tide ebbs and flows then, since the tide ebbs and flows twice each day, you must make at least four measurements each day. However, if you wanted to observe the various sizes of individual waves then, since waves occur at a rate of about one every five seconds, the wave height must be measured (sampled) at least every two-and-a-half seconds. The Nyquist Criterion gives the theoretical limit of sampling. In practical circuits, the sampling rate is always greater than Nyquists value. For example, in digitallyrecorded sound, on CD, the highest frequency in the signal is 20 kHz. Nyquist requires a minimum sampling rate of 40 kHz; the system uses 44.1 kHz (about 10% greater than the minimum) because it would require perfect circuits to work at 40 kHz - such circuits do not exist and they would be very expensive if they did. Sampling rate may be expressed either as the number of samples per second ( f - in Hz) or the time interva between samples ( - in seconds). The link between the two ways of measuring sample rate is: f and = 1/f = 1/

or a typical wagon wheel, with a diameter of 1 metre and containing 32 spokes, moving at a speed of 5 ms1 (about 10 mph), the wheel moves 5 m in a second, its circumference is 1 m (3.14 m) so it makes 5/3.14 revolutions per second. Each revolution causes 32 spokes to pass a point, so the spokes pass at a rate of 32 5 = 51 per second. At this speed, the movie film would need just over one hundred pictures per second to properly record the motion of the spokes - but it only uses twenty-four pictures per second. If the wagon were to move at a speed of 2.36 metres per second then one picture would show a spoke, say, at the top of the wheel and the next picture, 1/24 second later, would show the wagon wheel apparently in the same position. This is because the next spoke would have rotated into exactly the position that was formerly occupied by the previous spoke. Thus, the two pictures of the wagon wheel appear identical and the wheel seems stationary. This is aliasing - a series of samples of repeating events appears to run too slowly or in the opposite direction. A slight reduction in the speed of the wagon would change the picture so that the second spoke would appear slightly behind the first - giving the impression that the wheel was rotating slowly backwards. A slight increase in speed would show the second spoke to be slightly ahead of the first - giving the impression that the spoke was rotating slowly forwards. The same effect occurs when the speed of the wagon is a whole-number multiple of 2.36 ms1.

These are the same formulae that are used to convert between a waves periodic time and its frequency.

ALIASING
hen sampling is carried out at too low a rate (lower than twice the highest frequency in the information being sampled) then false information is generated. This effect, which is called Aliasing is clearly visible in cowboy movies where the wheels on wagons and

stagecoaches appear to rotate at the wrong speed, in the wrong direction or appear stationary. The sampling rate used for movie film is twenty-four samples (pictures) per second. This means that the fastest movement that can be recorded correctly is twelve cycles per second (or twelve events per second). The event that is occuring in the cowboy film is the number of spokes of the wheel that pass a point in one second. At the typical speed of horse-drawn transport, hundreds of spokes of the wheel pass during one second, this means that the required sampling rate is more than 200 per second, which would be far too costly in terms of the amount of movie film that would be required - each second of film would require eight times as much film than that which is currently used. For a DVD, it would require eight disks to hold a single movie. Whenever aliasing occurs, there is no indication of a fault - the system would appear to be functioning normally. However, the results would be incorrect. For this reason, in most systems, any signal that is to be sampled is first passed through a circuit called a low-pass filter that removes any frequencies that are greater than half the sampling rate. Therefore, no frequencies greater than the limit are present when the signal is sampled. Even if the signal itself did not contain any high frequencies, any noise present might contain some and this would produce false signals.

27 Jul 04

E06-3

E06 - A - D Conversion.QXD

Analogue-to-Digital Conversion

DWR

RESOLUTION

he resolution of a measuring device is the smallest change in value that it can be used to measure. In practice, this might be limited by: Noise: all signals include noise and it limits the resolution of measurement by adding a random value to whatever you are trying to measure. The effects of noise can be reduced by taking many measurements and averaging them, but this takes time. To reduce the effects of noise by any factor (e.g. 10 times) you must increase the averaging time by the square of that factor (e.g. 100 times). Noise (signalto-noise ratio) determines the fundamental limit of resolution in any measurenemt. Display: a three-digit, digital display cannot display a value with four digits, such as 106.3. An ordinary ruler would be difficult to use with the naked eye if its divisions were 1/10 mm, because the eye can hardly see them. Purpose: the mileometer (odometer) of a car usually indicates to the nearest tenth of a mile. Very few drivers need to know how far they have travelled, to the nearest inch, so there is no practical value in showing it.

Figure 3: Illustrating Aliasing when Sampling Aliasing of a simple sine-wave is illustrated in Figure Three. The solid line shows six cycles of a simple signal (a sine-wave). Nyquists Rule implies that there must be at least twelve samples of the wave in that time for correct representation. If we take fewer samples then the result will be wrong. The Figure shows six samples (indicated by dark squares) and these have been joined up by a grey, dotted line to illustrate the sine-wave that they appear to trace-out. Unfortunately, as you can see, there is only one cycle of this alias wave, whereas there were six of the original. You do not need to be able to calculate what frequency the alias will have - just to know that it exists whenever the sampling rate is lower that the Nyquist value.

ALIASING IN RADAR
ach time that a radar pulse is transmitted and an echo received then the radar is taking a sample of information about the target. The rate at which pulses are transmitted is the sampling rate (e.g. 5 kHz) and any information about the target that involves a frequency greater than half this value (e.g. 2.5 kHz) will give a false answer which, like the rotating wagon wheel, might be the exact opposite of the true situation. Unfortunately, under some conditions, the Doppler Shift, which a radar uses to measure the speed of a target, might have a frequency in the range that can cause aliasing. In radar theory it is called ambiguity, but it is basically the same as what is called aliasing in sampling theory.This will be covered further in the BST Radar handouts.

STROBE LIGHTING

he strange visual effects that occur under strobe lighting are also a form of aliasing. Rotating objects may seem to slow and stop - even as they continue to turn. This can be dangerous in workshops, for example, where flickering lights may give a false impression that a rotating machine, such as a lathe, is stationary when, in fact, it is rotating quite rapidly.

When using an analogue indicating device, even a simple ruler, the resolution can be increased by viewing the scale through a magnifying glass. When using a digital device, there is no way to display the missing digits. Accuracy: this is not the same as resolution! Accuracy is a measure of the difference between the true value of a quantity and the indicated value. The odometer of a car might indicate to the nearest tenth of a mile and can, for example, distinguish between a journey of 50 miles and 50.2 miles, but its accuracy is probably no better than 2%. This means that the journey of 50 miles might have been any value between 47.5 miles and 52.5 miles - but the resolution of 0.1 mile implies that the odometer can correctly identify that one journey is 0.2 miles longer than the other, even though one might actually be 52.5 miles and the other 52.7 miles. (The accuracy of 2% would also apply to the 0.2 mile, so that that could be in error by 0.004 mile.) Analogue Resolution: the resolution of an analogue measurement represents the smallest change in reading that you could see. It is related to the properties of the display and your eyes. For an ordninary, pointertype instrument, this corresponds to about 0.5 mm of movement of the pointer. Digital Resolution: the resolution of a digital measurement is found by dividing the range of values that it can measure by the number of different values that it can use to represent that range. For example, an instrument that can measure from 0 Volts to 10 Volts and uses 8-bits in its measurement, has a resolution of 10 255 or 39.2 mV, or 40 mV approximately. Its reading cannot change by an amount less than this. However, its display might have provision to display two decimal places of Volts therefore, its display has a resolution of 10 mV, but it will always change its reading in steps of 40 mV. Note that a

E06 - A - D Conversion.QXD

E06-4

27 Jul 04

DWR

Analogue-to-Digital Conversion

number represented using eight bits can have 256 different values, ranging from zero to 255, but there are only 255 steps between these 256 levels. The resolution is the step-size not the number of steps. (In practice, there is not much difference betwen 10 V 256 and 10 V 255.) Note that when counting in digital circuits, the count usually starts at zero, not at one. This makes the computer count one less than the human count. The formula for resolution is expressed below R = Vr ( NL 1 )

b The lowest level, zero, represents 500 mils. The second level, stored as a value of one, represents (-500 mils + 3.91) = 496.09 mils. Level 100 represents an elevation that has 99 resolutions added to the lowest elevation. (500 mils + 99 x 3.91 mV) = 113.3 mils Note that the 256th level, stored as 255, represents +500 mils.

Where: R = Resolution of the digital system. Vr = Range of the values sampled. NL = Number of levels used to express the digital value - usually 2n, where n is the number of bits used to store the number. Example One A computer has a four bit analogue to digital converter. It is used to measure voltages between 0 Volts and 30 mV. a What is the resolution of this converter ? b What voltage will be represented by the third level? c What voltage will be represented by the tenth level? Answers a A 4 bit converter has 24 levels = 16 levels 30 / (16 1) = 2. The resolution is 2 mV. b The first level represents 0 mV, the second level represents 2 mV, and the third level represents 4 mV. c The tenth level will have nine resolutions added to the lowest level, so the Voltage represented is 0 + 9 2 = 18 mV. Note that the sixteenth level will represent 30 mV. Example Two A system has an eight-bit analogue-to-digital converter. It is used to measure elevation angles between 500 mils and +500 mils. Assume that -500 mils elevation is assigned a value zero and that +500 mils is assigned a value 255 . a b What is the resolution of this converter ? What elevation will be represented by the number 100?

Answers a An 8-bit converter has 28 levels = 256 levels. This time the measurement range is 1 000 mils, because it must be able to convert mils values ranging from 500 to +500. 1 000 / (256 1) = 3.91 mils (Rounded to 3-figs) The resolution = 3.91 mils

27 Jul 04

E06-5

E06 - A - D Conversion.QXD

Analogue-to-Digital Conversion

DWR

Digital Output Value


Bit 3 (8) Bit 2 (4) Bit 1 (2) Bit 0 (1)

0
0V 5V

1
5V

1
5V

Start Signal Binary Counter


1k

Stop Signal

1k

2k

4k

8k

4.375 V

Figure 4: A Simple, Digital-to-Analogue Converter

DIGITAL-TO-ANALOGUE CONVERTER (DAC)


simple, Digital-to-Analogue Converter is shown in Figure Four. This simple circuit used just four-bits and it works using Ohms Law and the current in resistors. Each binary-digit (bit) is connected to its own input, at the left. The most important bit, worth 23 (8) is connected into the amplifier using a one-thousand Ohm resistor. The next bit, worth 22 (4), is connected via a resistor of twice the resistance of the previous bit. This pattern repeats until the least-significant bit, worth 20 (1), which is connected via a resistor of eight-thousand Ohms. Thus, the weight of each bit is determined by a resistor. The amount of amplification is controlled by the onethousand Ohm resistor around the amplifier (the triangle symbol). The amplification is found by dividing this resistance by the resistance in the input channel. Thus, the signal at bit 3 is amplified by a factor of one, the signal at bit 2 is amplified by a factor one-half (1,000 2000), the signal of bit 1 is amplified by a factor of onequarter (1,000 4,000) and, finally, the signal at bit 0 is aomplifed by a facotr of one-eighth (1,000 8,000). When a value of five Volts is used to represent a binary One and zero Volts is used for a binary Zero then this circuit produces sixteen levels of output between zero and about ten Volts. For example, when a binary number 0111, equivalent to the denary 7 is input, the response is as follows:

Input Signal

+
Comparator

Figure 5: A Simple, Analogue-to-Digital Converter

ANALOGUE-TO-DIGITAL CONVERTER (ADC)

ne of the simplest ADC operates using trial-anderror to find the digital value that is equivalent to its analogue input. A diagram of such a circuit is shown in Figure Five. This circuit can digitise simple, positive voltages, up to some maximum value, depending on the D-to-A Converter. Its sequence of operations is as follows: The start signal (top-left) causes the binary counter to begin counting from zero up to its maximum value (e.g. 255).. At each count, the binary number is passed down to the D-to-A Converter, where it is converted into an analogue value. The Input signal is passed into one input of a Comparator (the triangle symbol, in the Figure). The signal from the D-to-A Converter is passed into the other input of the Comparator. Whilst the output from the D-to-A Converter remains less than the input signal then output of the comparator does not affect the counter - the count continues. As soon as the output from the D-to-A C0nverter exceeds the input signal, the output from the comparator changes and the count stops. The value in the counter is the digital value that represents the signal. It is always the digital value that is just above the actual level of the signal - rounding up, because the output from the A-to-D Converter must exceed the signal before the count stops.

Bit Bit Bit Bit

3 is 2 is 1 is 0 is

zero 5V 5V 5V

no contribution contributes 1/2 contributes 1/4 contributes 1/8

to of of of

the output. 5 V = 2.5 V. 5 V = 1.25 V. 5 V = 0.625.

The total output is the sum of the above values, or 4.375 V. The Maximum output occurs when all bits are one and is 9.275 V. The smallest step in the output (i.e. teh Resolution) corresponds to the least-significant bit and is 1/8 of 5 V or 0.625 V. Practical systems use more than just four bits, so that the resolution is much higher. The system also needs more control circuits than are shown in the Figure. In particular, the output requires a sample-and-hold circuit, so that the inputs can be changed to their new values, ready for the next conversion. If one bit were to change out-of-step with the rest then incorrect outputs would be produced.

In a practical circuit, additional functions are needed to determine when a conversion has to be made and to hold the input at a steady value whilst a conversion takes place.

E06 - A - D Conversion.QXD

E06-6

27 Jul 04

DWR

Analogue-to-Digital Conversion

equal to 10.01 V. The maximum value of the error - at the time of sampling - in this simple system is, clearly, equal to the resolution of the converter. However, once the sample is taken then any changes in the signal will not be effective until the next sample occurs. Therefore, as the signal continues to change, between samples, then the quantisation error changes with it. In effect, the quantised signal could be considered as the sum of the original signal and an extra signal, generated by the process of A-to-D conversion, called the quantisation noise. Figure 6: A Quantised Sine-Wave

QUANTISATION NOISE
igure Seven is the same as Figure Six, but with an additional line that shows the difference between the quantised signal and the original signal. This is the quantisation noise. The simple converter, that is being illustrated, always rounds in the positive direction, so the quantisation noise has a slight, positive bias of half a quantisation interval. This bias can be eliminated by applying a negative signal of half the quantisation interval. This also reduces the peak value of the quantisation error to half a quantisation interval. The quantisation noise appears to contain jumbledup fragments of the original sine-wave - this means that it is impossible to remove it completely by filtering, as it contains frequencies similar to those of the signal. However, the sharp spikes occur each time that a sample is taken and these, therefore, contain frequencies that are greater than twice the frequencies in the signal. These can be removed by filtering.

QUANTISATION
hen an analogue signal is converted into digital form then the result is a sequence of numbers that represents the values of the analogue signal at the time of each measurement. When an 8-bit converter is used then there can only be 256 different numbers to represent each value. The process of allocating a digital value to an analogue signal is called Quantisation. A problem arises when the value of the analogue signal falls between two of the available digital values. For example: if an analogue-to-digital converter used eight bits and measured up to 25.6 V then its resolution would be 0.1 V (100 mV). This means that a digital value of 100 corresponds to a signal of 10 Volts and a digital value of 101 corresponds to a signal of 10.1 V. However, which digital value should be given to a signal of 10.03 V or 10.07 V? There is no possibility of normal rounding, because the digital converter, with a resolution of 0.1 V, cannot measure the second decimal place, as this would require a resolution ten-times greater that that which is available. Since this decimal place cannot be measured then it cannot be used for rounding. In a simple system, the signal might be quantised by a process that finds the first level that exceeds the analogue signal. Thus, any analogue value that is greater than 9.9 Volts and not greater than 10.0 Volts will be quantised as 10.0 Volts. Until the signal just exceeds 10.0 Volts, it continues to be measured as 10.0 Volts. In effect, this is a process of rounding up (i.e. in a positive direction). Negative values are also rounded up, so that a level of 10.01 would be quantised as 10.0.) This is illustrated in Figure Six, where a sine-wave of 4.8 V peak value is shown being quantised using levels from -6 V to +6 V, in 1 V intervals. The difference between the quantised version of the signal and its true value is called Quantisation Error. In the simple system, described, this error will range from zero (for a signal that is slightly over 10.0 V) to 0.01 V (for a signal that is just

MEANS OF REDUCING QUANTISATION NOISE

he simplest way to reduce quantisation noise is to increase the resolution (number of bits) of the analogue-to-digital conversion. This makes the steps smaller and allows more closely-spaced levels that better match the values of the signal. Increasing the smaple rate, above what it required by Nyquist, will also help, as it gives the signal less opportunity to change between samples. A more subtle means of reducing the quantisa-

Figure 7: Illustrating Quantisation Noise

27 Jul 04

E06-7

E06 - A - D Conversion.QXD

Analogue-to-Digital Conversion

DWR

sents the best that could be achieved with a perfect circuit - perfect circuits do not exist. Example An A-to-D converter using 8 bits has a signal to quantisation noise ratio of: SQR = (1.763 + 6.02 8) dB = 50 dB

DATA STORAGE
Figure 8: Illustrating Non-Linear Quantisation tion noise is to add a small random signal into the system. The amount of this noise is approximately equal to the resolution of the A-to-D converter. The presence of this noise disrupts the regular nature of the quantisation noise and makes it less intrusive. A process called oversampling, where the number of samples per second is much more than the minimum (Nyquist) is commonly used in CD and DVD audio systems. In oversampling, the sample-rate might be as much as eight times the usual rate. This has the advantage that the same amount of quantisation noise is spread over a wider bandwidth, so there is less in the audio range and the remaining noise is far above 20 kHz and, therefore, easy to filter out. If quantisation error is calculated as a precentage then it becomes more significant as the signal gets smaller. This is because the error at the time of sampling is always between zero and one quantisation interval, averaging half a quantisation interval. An error of 1 mV in a signal of 10 mV represents a 10% error, whereas the same error in a signal of 1 V represents an error of 0.1%. The solution to this problem is to employ a sampling scheme which uses small quantising intervals for small signals and larger quantising intervals for larger signals. This is Non-Linear Quantisation and it is illustrated in Figure Eight. shows how the levels are organised. The vertical scale tick marks do not have equal gaps between them. For high positive and high negative voltages, the levels are far apart. At small voltages near the horizontal time axis, the quantisation levels are closer together, so the resolution is better for the small voltages. he digital data that are generated during Ato-D conversion have to be stored somewhere of they are to be recorded or analysed. Increasing the sampling-rate and the number of bits in the converter will certainly improve quality but the amount of data will increase too. The following examples describe instances where signals are digitised and stored:

Low quality speech recorder: when a man talks, he produces sound waves that very rarely rise above 1 kHz, unless it is a high pitched shriek. Therefore a relatively low sampling rate above 2 kHz will be sufficient. Young children and most females have an upper frequency limit of 3 kHz (Unless they are opera singers) so the sampling rate needed would rise to above 6 kHz. If this were processed using an 8 bit system with a sampling rate of 4 kHz then three minutes of recording would need 720 kBytes of storage, as follows: Each sample will generate one byte (because 8 bits make a byte). Every second 4000 samples are taken. 3 minutes is 180 seconds. So the number of bytes stored will be 180 x 4000 = 720 000 bytes, 720 kBytes.

High quality CD Audio recorder: music can contain frequencies right up to the limit of human audibility (20 kHz) Therefore a fast sampling rate above 40 kHz is needed. To improve the quality still further, more bits are used for each sample. The CD standard is to use a 16 bit system, in streo, with a sampling rate of 44 kHz. The number of Bytes required to store a three-minute recording is now over 30 MBytes, as follows: Each sample will generate two bytes (because 16 bits makes two bytes) Every second 88 000 samples are taken in each channel (44,000 left and 44,000 right). 3 minutes = 180 seconds File size = 180 x 2 x 88 000 = 31 680 000 Bytes. This is approximately 32 MBytes.

SIGNAL TO QUANTISATION NOISE RATIO

he error due to the analogue to digital conversion can be regarded as a noise on the signal. The signal to quantisation noise ratio varies with signal strength, being worst for small signals. It value for large signals (1 dB less than the maximum signal - about 80% of the maximum signal), for an ideal A-to-D converter, can be calculated using a standard formula: SQR = (1.763 + 6.02 b) dB

Where b is the number of bits used by the A-to-D converter. In practice, this value cannot be realised because the value obtained using this formula repre-

E06 - A - D Conversion.QXD

E06-8

27 Jul 04

DWR

Analogue-to-Digital Conversion

THE NEED FOR FILTERS

he signal that enters an A-to-D converter must be filtered before processing, in order to remove any frequencies that lie above the Nyquist criterion. Failure to do so would introduce a range of alias frequencies that could not be removed because they are indistnguishable from signal frequencies. The signal that leaves a D-to-A converter also contains many extra frequencies, introduced by the conversion process. These spurious frequencies range upwards, from half the sampling rate and, again, can be removed by filtering. These frequencies are higher than the signal frequencies, so they can be filtered out.

DIGITAL SIGNAL PROCESSING - DSP


igital signal processing (DSP) has major advantages over analysis of analogue signals. One advantage is the speed at which digital information can be processed by a computer, another is the flexibility of the operations that can be performed. A simple tonecontrol on a radio can vary the amount of treble and bass in the sound - but only in a very simple way. A DSP can produce effetcs such as:

Graphic Equaliser: like twenty tone controls, each operating over a small part of the frequency band. Pitch Change: recorded signals can be played back at a different pitch, without changing the duration of the recording. Time Change: recorded signals can be played back in a shorter time, without changing the pitch. Signal Analysis: recorded signals can be analysed for patterns or to identify sounds.

Many military systems use DSP to process their data signals, including radars signal analysis, missile guidance and control systems.

27 Jul 04

E06-9

E06 - A - D Conversion.QXD

Analogue-to-Digital Conversion

DWR

FORMULA SUMMARY
Sampling rate: f = 1

f = Sampling rate (Hz) = Time between each sample (s) Number of Samples taken: Ns = ft

Ns = Number of Samples taken f = Sampling Rate (Hz) t = duration of sampling period (s) Number of quantisation Levels: NL = 2b

NL = Number of quantisation Levels b = Number of bits in the A to D Converter Resolution of an A-to-D Converter: R = Vr (NL -1)

R = Resolution of the A to D Converter (V) Vr = Range of the voltages sampled (V) NL = Number of quantisation Levels Peak Quantisation Error: Epk = R2

R = Resolution of the A to D Converter (V) Signal-to-Quantisation Noise Ratio: S/Q Ratio = (1.763 + 6.02 b) dB b = Number of bits in the A to D Converter Nyquist Condition: fs > 2 fmax

fs = Sampling frequency (Hz) fmax= Maximum frequency present in the signal (Hz)

E06 - A - D Conversion.QXD

E06-10

27 Jul 04

DWR

Analogue-to-Digital Conversion

SELF TEST QUESTIONS

7. A ten-bit A-to-D converter, such as that used in ADAD, is used to represent all voltages from zero to 2 V, the peak quantisation error is approximately: a b c d 195 V. 978 nV. 1.95 mV. 978 V.

1. When sound arrives at a microphone then the electrical output of the microphone will be in the form of a b c d quantised levels. analogue signals. digital signals. samples.

2. In a missile control system that uses a potentiometer to determine azimuth, before the computer can accept data from the azimuth sensor then the output of the sensor must: a b c d converted from binary to decimal. be converted from Digital to Analogue. be converted from Analogue to Digital. converted from mils to degrees.

8. A ten-bit A-to-D converter, such as that used in ADAD, is used to represent all voltages from zero to 2 V, the Voltage represented by level number 512 is approximately: a b c d zero. 2 V. 1 V. 1.7 V.

9. A perfect, 24-bit A-to-D converter should have a Signal to Quantised Noise Ratio of: 3.The number of levels that can be encoded using a five-bit A to D converter is: a b c d 64. 16. 8. 32. a b c d 146 dB 24 dB 42 dB 33 dB

10. A data logger takes a sample of a signal voltage at 20 s intervals. The sampling rate is: 4. A ten-bit A-to-D converter, such as that used in ADAD, is used to represent all voltages from zero to 2 V. The resolution of this converter is: a b c d 1.955 V. 512 V. 1.955 mV. 1.955 V. a b c d 2 MHz 50 kHz 500 kHz 50 MHz

5. A 16-bit A-to-D converter is used to represent all voltages from -100 V to +100 V. The resolution of this converter is approximately: a b c d 3 mV. 100 mV. 6 mV. 16 V. (b) (c) (d) (c) (a) (d) (d) (c) (a) (b)
E06-11

Answers 1. Analogue signal 2. A-to-D, a potentiometer is analogue 3. 25 = 32 4. 2 1023 = 1.955 mV 5. 200 65535 = 0.003 V or 3 mV (apx) 6. more bits = better resolution 7. 2 1023 = 1.955 mV, divide this by 2 = 978 V 8. 512 is half-way up the range of 1024 levels, 1 V 9. S/Q Ratio = (1.763 + 6.02 24) dB = 146 db 10. 1 / 20 s = 50 kHz
E06 - A - D Conversion.QXD

6. In the process of Analogue-to-Digital conversion: a b c d there is no quantisation error. decreasing the number of bits in the converter improves the resolution of the converter. the average quantisation error is equal to half the resolution of the converter. increasing the number of bits in the converter improves the resolution of the converter.

27 Jul 04

Analogue-to-Digital Conversion

DWR

Teaching Objectives

Comments

E.06.01 Describe the Basic Properties of an Analogue Signal


E.06.01.01 State that the waveform of the voltage and/or current in an analogue signal has the same form as that of the signal that it represents. State that an analogue signal can have an infinite number of instantaneous values. State that an analogue signal varies in a smooth manner Describe examples of analogue signals E.g. trace on sound ranging film, groove on record., audio signal from microphone, radar echo

E.06.01.02 E.06.01.03 E.06.01.04

E.06.01.05

State the bandwidth requirements of common analogue signals in terms of their maximum frequencies.

E.06.02 Describe the Basic Properties of a Digital Signal


E.06.02.01 State that a digital signal is a sequ ence of coded signals representing a sequence of samples of analogue information. State that a digital signal can have a limited number of instantaneous values. State that a digital signal varies in a step -wise manner. Describe examples of digital signals. E.g. digital clock, CD music.

E.06.02.02 E.06.02.03 E.06.02.04

E.06.03 Describe the Process of Analogue to Digital Conversion


E.06.03.01 E.06.03.02 E.06.03.03 E.06.03.04 E.06.03.05 Describe the concept of sampling an analogue signal. State that the analogue signal must be sampled at a rate of at least twice its highest frequency component. Describe the process of quantisation. Relate the number of levels to the number of bits used to code the sample. Identify features on graphs showing analogue, sample and quantised values. Include need to hold during conversion Nyquist Rule, filtering to remove higher frequencies.

E.06.04 Describe the Properties of a Quantised Signal


E.06.04.01 E.06.04.02 E.06.04.03 Describe the formation of quantisation noise (QN) and recognise it on a graph. State that the signal to QN ratio worsens as the signal amplitude reduces. Describe non -linear quantisation as a means of reducing QN

E.06.05 Describe the Process of Digital to Analogue Conversion


E.06.05.01 E.06.05.02 E.06.05.03 E.06.05.04 Describe the operation of a simple, 4 -bit D A Converter. State that the output consists of the original frequencies plus harmonics of the sampling frequency State that a filter is required to remove harmonics of the sampling frequency. Describe how a computer can produce a sine wave by delivering a series of sine values into a D A converter. .

E06 - A - D Conversion.QXD

E06-12

27 Jul 04

Das könnte Ihnen auch gefallen