bst handout e06

Upload: prodigious-jatt

Post on 04-Apr-2018

239 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Bst Handout e06

    1/12

    DWR Analogue-to-Digital Conversion

    ROYAL SCHOOL OF ARTILLERY

    BASIC SCIENCE & TECHNOLOGY SECTION

    Analogue-to-Digi tal Conversion

    INTRODUCTION

    When electronic circuits are used to perform anycommon function then there are two basic typesoperating modes that can be used: digital and ana-

    logue. 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 phys-

    ical quantities (such as temperature and sound pres-

    sure) 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 con-

    nected 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 perform-

    ance 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.

    THE DIIFERENCE BETWEEN THE ANALOGUE

    AND THE DIGITAL REPRESENTATIONS OF A

    PHYSICAL QUANTITY

    In years gone by, record manufacturers used the pres-sure of the sound waves on a diaphragm to move atiny 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 pres-

    sure 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 pro-

    duce 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 onwhic 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-

    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 regu-

    lar 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 torepresent the sampled pressures form part of a lim-

    ited 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 repre-

    sentation of a physical quantity from its analogue repre-

    sentation. The analogue version is continuous both in

    time and in magnitude, whereas the digital version is

    discrete both in time and magnitude.

    MILITARY EXAMPLES

    Most radar systems no longer display their echoeson a simple screen (the type with the rotatingline). Instead, the signals are digitised and processed

    by a computer. The radar screen is, in reality, a com-

    puter 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 mov-

    ing objects. Furthermore, the system tries to differenti-

    ate 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 electri-cal signal that is an analogue of the sound pressure.

    That is converted into digital form for processing by

    the computer.

    27 J ul 04 E06-1 E06 - A-D Conversion.QXD

  • 7/29/2019 Bst Handout e06

    2/12

    Analogue-to-Digital Conversion DWR

    ANALOGUE CLOCK

    The traditional analogueclock has a sweepingsecond 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 measure-

    ment that the user must

    interpret from the display.

    This is a rounding up or down process. You would reportthe time shown by this clock to be 10:07:58.

    DIGITAL CLOCK

    Adigital clock would simply display the time as agroup of numbers, rather than as the motion ofhands 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 sys-

    tems ignore changes that are less than the value of their

    smallest digit.

    ANALOGUE AND DIGITAL DISPLAYS

    Not all digital displays are ideal for human use.Attempts to replace the conventional analoguespeedometer 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 hadto 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

    pointer is immedi-

    ately obvious.Furthermore, the rate

    of change of speed

    (acceleration) can be

    readily determined by the speed at which the pointer

    moves across the dial.

    Conversely, the digital version of the clinical ther-

    mometer (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 oper-

    ator than being presented with a digital display of thebearing 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.

    BINARY REPRESENTATION OF NUMBERS

    M

    ost digital devices represent numbers internally in

    Binary form. The binary system (base-two) is verylike the denary system (base-ten) that we normally use

    to represnt numbers, except that it is based on the num-

    ber two and not on the number ten. Importantly, the

    place values are calculated following the same princi-

    ples, 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 num-

    ber formats, and the numbers that they can store, are:

    4-bit: zero to 15 denary. (Called a nybble.) 8-bit: zero to 255 denary. (Called a Byte.)

    10-bit: numbers from zero to 1,023 denary.

    16-bit: 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.

    E06 - A - D Conversion.QXD E06-2 27 J ul 04

    10:07

    Digit Number 7 6 5 4 3 2 1 0

    Place Value(Index)

    107 106 105 104 103 102 101 100

    Place Value(Number)

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

    Figure 1:

    Illustrating Place

    Value in the Denary

    (Base-Ten) Number

    System

    Digit Number 7 6 5 4 3 2 1 0

    Place Value(Index)

    27 26 25 24 23 22 21 20

    Place Value(Number)

    128 64 32 16 8 4 2 1

    Figure 2:

    Illustrating

    Place Value inthe Binary

    (Base-Two)

    Number System

  • 7/29/2019 Bst Handout e06

    3/12

    DWR Analogue-to-Digital Conversion

    SAMPLING RATE

    The sampling rate of a digital measuring system is thenumber of times each second that it measures thevalue of the physical property that it is observing. There

    is no universal setting of sampling rate that suits all pur-

    poses 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 mak-

    ing observations of meteoroligical conditions for gun-

    nery 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-phrasedas 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 ofsampling. In practical circuits, the sampling rate is always

    greater than Nyquists value. For example, in digitally-

    recorded sound, on CD, the highest frequency in the sig-

    nal 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 cir-

    cuits 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 num-

    ber 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 = 1 /

    and

    = 1 / f

    These are the same formulae that are used to con-

    vert between a waves periodic time and its frequency.

    ALIASING

    When sampling is carried out at too low a rate (lower

    than twice the highest frequency in the informa-tion 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 (pic-

    tures) per second. This means that the fastest move-

    ment 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 sec-

    ond, this means that the required sampling rate is more

    than 200 per second, which would be far too costly interms 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 nor-

    mally. However, the results would be incorrect. For this

    reason, in most systems, any signal that is to be sam-

    pled 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 issampled. Even if the signal itself did not contain any

    high frequencies, any noise present might contain some

    and this would produce false signals.

    27 J ul 04 E06-3 E06 - A - D Conversion.QXD

    STAGECOACH WHEELS IN COWBOY FILMS

    For a typical wagon wheel, with a diameter of1 metre and containing 32 spokes, moving at aspeed 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 rev-

    olution 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 pic-

    ture, 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 posi-

    tion 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 back-

    wards. 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 for-

    wards. The same effect occurs when the speed of the

    wagon is a whole-number multiple of 2.36 ms

    1

    .

  • 7/29/2019 Bst Handout e06

    4/12

    Analogue-to-Digital Conversion DWR

    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 cor-

    rect representation. If we take fewer samples then the

    result will be wrong. The Figure shows six samples (indi-

    cated by dark squares) and these have been joined up by

    a grey, dotted line to illustrate the sine-wave that theyappear to trace-out. Unfortunately, as you can see, there

    is only one cycle of this aliaswave, 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

    Each time that a radar pulse is transmitted and anecho received then the radar is taking a sample ofinformation about the target. The rate at which pulses

    are transmitted is the sampling rate (e.g. 5 kHz) and anyinformation 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 tar-

    get, 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 sam-

    pling theory.This will be covered further in the BST

    Radar handouts.

    STROBE LIGHTING

    The strange visual effects that occur under strobelighting are also a form of aliasing. Rotating objectsmay 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.

    RESOLUTION

    The resolution of a measuring device is the smallestchange in value that it can be used to measure. Inpractice, this might be limited by:

    Noise: all signals include noise and it limits the res-

    olution of measurement by adding a random value to

    whatever you are trying to measure. The effects of

    noise can be reduced by taking many measure-

    ments 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 (signal-

    to-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 usuallyindicates 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.

    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 dig-

    ital 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. Theodometer of a car might indicate to the nearest tenth of

    a mile and can, for example, distinguish between a jour-

    ney of 50 miles and 50.2 miles, but its accuracy is prob-

    ably 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 Resolut ion: the resolution of an ana-

    logue measurement represents the smallest change inreading that you could see. It is related to the properties

    of the display and your eyes. For an ordninary, pointer-

    type instrument, this corresponds to about 0.5 mm of

    movement of the pointer.

    Digital Resolution: the resolution of a digital meas-

    urement 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 mighthave 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 J ul 04

    Figure 3: Illustrating Aliasing when Sampling

  • 7/29/2019 Bst Handout e06

    5/12

    DWR Analogue-to-Digital Conversion

    number represented using eight bits can have 256 differ-

    ent 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 com-

    puter count one less than the human count.

    The formula for resolution is expressed below

    R = Vr ( NL 1 )

    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 OneA computer has a four bit analogue to digital converter.

    It is used to measure voltages between 0 Volts and

    30mV.

    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 2

    4

    levels = 16 levels30 / (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 repre-

    sents 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 between500mils and +500 mils. Assume that -500 mils eleva-

    tion is assigned a value zero and that +500 mils is

    assigned a value 255 .

    a What is the resolution of this converter ?

    b 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 valuesranging from 500 to +500.

    1 000 / (256 1) =3.91 mils (Rounded to 3-figs)

    The resolution =3.91 mils

    b The lowest level, zero, represents 500 mils.

    The second level, stored as a value of one, rep-

    resents (-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, repre-

    sents +500 mils.

    27 J ul 04 E06-5 E06 - A - D Conversion.QXD

  • 7/29/2019 Bst Handout e06

    6/12

    Analogue-to-Digital Conversion DWR

    DIGITAL-TO-ANALOGUE CONVERTER (DAC)

    Asimple, Digital-to-Analogue Converter is shown inFigure Four. This simple circuit used just four-bits andit 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 intothe 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 one-

    thousand 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 3is amplified by a factor of one, the sig-

    nal at bit 2 is amplified by a factor one-half (1,000 2000), the signal of bit 1 is amplified by a factor of one-

    quarter (1,000 4,000) and, finally, the signal at bit 0is

    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 7is input,

    the response is as follows:

    Bit 3is zero - no contribution to the output.

    Bit 2 is 5 V - contributes 1/2 of 5 V =2.5 V.

    Bit 1 is 5 V - contributes 1/4 of 5 V =1.25 V. Bit 0 is 5 V - contributes 1/8 of 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

    oneand 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 nextconversion. If one bit were to change out-of-step with

    the rest then incorrect outputs would be produced.

    ANALOGUE-TO-DIGITAL CONVERTER (ADC)

    One of the simplest ADC operates using trial-and-error to find the digital value that is equivalent toits 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 counterto 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-AConverter remains

    less than the input signal then output of the com-

    parator does not affect the counter - the count con-

    tinues. As soon as the output from the D-to-A C0nverter

    exceeds the input signal, the output from the com-

    parator changes and the count stops.

    The value in the counter is the digital value that rep-

    resents 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.

    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 conversiontakes place.

    E06 - A - D Conversion.QXD E06-6 27 J ul 04

    1 k

    0 V

    4.375 V

    5 V 5 V 5 V

    1 k2 k 4 k 8 k

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

    0 1 1 1

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

    Binary Counter

    Input Signal

    Digital Output Value

    Stop SignalStart Signal

    Comparator

    +

    -

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

  • 7/29/2019 Bst Handout e06

    7/12

    DWR Analogue-to-Digital Conversion

    QUANTISATION

    When an analogue signal is converted into digitalform then the result is a sequence of numbers thatrepresents the values of the analogue signal at the timeof each measurement. When an 8-bit converter is used

    then there can only be 256 different numbers to repre-

    sent 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 Vor 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 ana-

    logue 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 bemeasured 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 simplesystem, 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

    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 reso-

    lution 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.

    QUANTISATION NOISE

    Figure Seven is the same as Figure Six,but with an additional line that shows thedifference between the quantised signal and the original

    signal. This is the quantisation noise. The simple con-

    verter, that is being illustrated, always rounds in the posi-tive 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 jumbled-

    up 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 sam-

    ple is taken and these, therefore, contain frequencies

    that are greater than twice the frequencies in the signal.These can be removed by filtering.

    MEANS OF REDUCING QUANTISATION NOISE

    The simplest way to reduce quantisation noise is toincrease the resolution (number of bits) of the ana-logue-to-digital conversion. This makes the steps

    smaller and allows more closely-spaced levels that bet-

    ter 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-

    27 J ul 04 E06-7 E06 - A - D Conversion.QXD

    Figure 6: A Quantised Sine-Wave

    Figure 7: Illustrating Quantisation Noise

  • 7/29/2019 Bst Handout e06

    8/12

    Analogue-to-Digital Conversion DWR

    tion noise is to add a small random signal into the sys-

    tem. 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 sys-tems. In oversampling, the sample-rate might be as

    much as eight times the usual rate. This has the advan-

    tage 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, whereasthe same error in a signal of 1 V represents an error of

    0.1%. The solution to this problem is to employ a sam-

    pling scheme which uses small quantising intervals for

    small signals and larger quantising intervals for larger

    signals. This is Non-Linear Quantisation and it is illus-

    trated in Figure Eight. shows how the levels are organ-

    ised. 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.

    SIGNAL TO QUANTISATION NOISE RATIO

    The error due to the analogue to digital conversioncan be regarded as a noise on the signal. The sig-nal 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-Dconverter. In practice, this value cannot be realised

    because the value obtained using this formula repre-

    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

    The digital data that are generated during A-to-D conversion have to be stored some-where 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 exam-

    ples describe instances where signals are digitised and

    stored:

    Low quality speech recorder: when a man talks, heproduces sound waves that very rarely rise above

    1 kHz, unless it is a high pitched shriek. Therefore a rel-

    atively low sampling rate above 2 kHz will be sufficient.

    Young children and most females have an upper fre-

    quency 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 sam-

    pling 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 con-

    tain 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

    16bit 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.

    E06 - A - D Conversion.QXD E06-8 27 J ul 04

    Figure 8: Illustrating Non-Linear Quantisation

  • 7/29/2019 Bst Handout e06

    9/12

    DWR Analogue-to-Digital Conversion

    THE NEED FOR FILTERS

    The signal that enters an A-to-D converter must be fil-tered before processing, in order to remove any fre-quencies 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 indistnguish-

    able from signal frequencies.

    The signal that leaves a D-to-A converter also con-

    tains many extra frequencies, introduced by the conver-

    sion 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

    Digital signal processing (DSP) has major advan-tages over analysis of analogue signals. Oneadvantage 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 tone-

    control on a radio can vary the amount of treble andbass in the sound - but only in a very simple way. ADSP

    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 guid-

    ance and control systems.

    27 J ul 04 E06-9 E06 - A - D Conversion.QXD

  • 7/29/2019 Bst Handout e06

    10/12

    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 = f t

    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 = R 2

    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 J ul 04

  • 7/29/2019 Bst Handout e06

    11/12

    DWR Analogue-to-Digital Conversion

    SELF TEST QUESTIONS

    1. When sound arrives at a microphone then the electri-

    cal output of the microphone will be in the form of

    a quantised levels.

    b analogue signals.

    c digital signals.

    d 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 sen-

    sor must:

    a converted from binary to decimal.

    b be converted from Digital to Analogue.

    c be converted from Analogue to Digital.

    d converted from mils to degrees.

    3.The number of levels that can be encoded using a

    five-bit A to D converter is:

    a 64.

    b 16.

    c 8.

    d 32.

    4. Aten-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 1.955 V.

    b 512 V.

    c 1.955 mV.

    d 1.955 V.

    5. A16-bit A-to-D converter is used to represent all volt-

    ages from -100 V to +100 V. The resolution of this con-

    verter is approximately:

    a 3 mV.

    b 100 mV.

    c 6 mV.

    d 16 V.

    6. In the process of Analogue-to-Digital conversion:

    a there is no quantisation error.

    b decreasing the number of bits in the converter

    improves the resolution of the converter.

    c the average quantisation error is equal to half theresolution of the converter.

    d increasing the number of bits in the converter

    improves the resolution of the converter.

    7. Aten-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 195 V.

    b 978 nV.

    c 1.95 mV.

    d 978 V.

    8. Aten-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 approxi-

    mately:

    a zero.

    b 2 V.

    c 1 V.

    d 1.7 V.

    9. A perfect, 24-bit A-to-D converter should have a

    Signal to Quantised Noise Ratio of:

    a 146 dB

    b 24 dB

    c 42 dB

    d 33 dB

    10. A data logger takes a sample of a signal voltage at

    20 s intervals. The sampling rate is:

    a 2 MHz

    b 50 kHz

    c 500 kHz

    d 50 MHz

    27 J ul 04 E06-11 E06 - A - D Conversion.QXD

    1.Analoguesignal(b)

    2.A-to-D,apotentiometerisanalogue(c)

    3.25=32(d)4.21023=1.955mV(c)

    5.20065535=0.003Vor3mV(apx)(a)

    6.morebits=betterresolution(d)

    7.21023=1.955mV,dividethisby2=978V(d)

    8.512ishalf-wayuptherangeof1024levels,1V(c)

    9.S/QRatio=(1.763+6.0224)dB=146db(a)

    10.1/20s=50kHz(b)

    Answers

  • 7/29/2019 Bst Handout e06

    12/12

    Analogue-to-Digital Conversion DWR

    E06 - A - D Conversion.QXD E06-12 27 J ul 04

    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 inan analogue signal has the same form as that of the signalthat it represents.

    E.06.01.02 State that an analogue signal can have an infinite number

    of instantaneous values.

    E.06.01.03 State that an analogue signal varies in a smooth manner

    E.06.01.04 Describe examples of analogue signals E.g. trace on sound ranging film, groove onrecord., audio signal from microphone, radarecho

    E.06.01.05 State the bandwidth requirements of common analoguesignals 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 signalsrepresenting a sequence of samples of analogue

    information.

    E.06.02.02 State that a digital signal can have a limited number ofinstantaneous values.

    E.06.02.03 State that a digital signal varies in a step -wise manner.

    E.06.02.04 Describe examples of digital signals. E.g. digital clock, CD music.

    E.06.03 Describe the Process of Analogue to Digital Conversion

    E.06.03.01 Describe the concept of sampling an analogue signal. Include need to hold during conversion

    E.06.03.02 State that the analogue signal must be sampled at a rate ofat least twice its highest frequency component.

    Nyquist Rule, filtering to remove higherfrequencies.

    E.06.03.03 Describe the process of quantisation.

    E.06.03.04 Relate the number of levels to the number of bits used tocode the sample.

    E.06.03.05 Identify features on graphs showing analogue, sample andquantised values.

    E.06.04 Describe the Properties of a Quantised Signal

    E.06.04.01 Describe the formation of quantisation noise (QN) andrecognise it on a graph.

    E.06.04.02 State that the signal to QN ratio worsens as the signalamplitude reduces.

    E.06.04.03 Describe non-linear quantisation as a means of reducingQN

    E.06.05 Describe the Process of Digital to Analogue Conversion

    E.06.05.01 Describe the operation of a simple, 4 -bit D AConverter.

    .

    E.06.05.02 State that the output consists of the original frequenciesplus harmonics of the sampling frequency

    E.06.05.03 State that a filter is required to remove harmonics of thesampling frequency.

    E.06.05.04 Describe how a computer can produce a sine wave bydelivering a series of sine values into a D A converter.