+ All Categories
Transcript
  • 8/11/2019 Basics of Digital Recording

    1/21

  • 8/11/2019 Basics of Digital Recording

    2/21

    output is simply the number of values that may be represented by the largest

    possible number (no "in between" values are allowed). If there were only one bit inthe number, the ultimate output would be a pulse wave with a fixed amplitude and

    more or less the frequency of the input signal. If there are more bits in the numberthe waveform is more accurately traced, because each added bit doubles the

    number of possible values. The distortion is roughly the percentage that the least

    significant bit represents out of the average value. Distortion in digital systemsincreases as signal levels decrease, which is the opposite of the behavior of analogsystems.

    Fig. 2 Effect of word size

    The number of bits in the number also determines the dynamic range. Moving a

    binary number one space to the left multiplies the value by two (just as moving a

    decimal number one space to the left multiplies the value by ten), so each bitdoubles the voltage that may be represented. Doubling the voltage increases thepower available by 6 dB, so we can see the dynamic range available is about the

    number of bits times 6 dB.

    Sample Rate

    The rate at which the numbers are generated is even more important than thenumber of bits used. Figure 3. illustrates this. If the sampling rate is lower than the

    frequency we are trying to capture, entire cycles will be missed, and the decoded

    result would be too low in frequency and might not resemble the proper waveformat all. This kind of mistake is called aliasing. If the sampling rate were exactly the

    frequency of the input, the result would be a straight line, because the same spot onthe waveform would be measured each time. This can happen even if the sampling

    rate is twice the frequency of the input if the input is a sine or similar waveform.

    The sampling rate must be greater than twice the frequency measured for accurateresults. (The mathematical statement of this is the Nyquist Theorem.) This implies

    that if we are dealing with sound, we should sample at least 40,000 times per

    second.

  • 8/11/2019 Basics of Digital Recording

    3/21

    Fig. 3 Effects of low sample rates

    The Nyquist rate (twice the frequency of interest) is the lowest allowable sampling

    rate. For best results, sampling rates twice or four times this should be used. Figure

    4 shows how the waveform improves as the sampling rate is increased.

    Fig. 4 Effect of increasing sample rate

    Even at high sample rates, the output of the system is a series of steps. A Fourier

    analysis of this would show that everything belonging in the signal would be therealong with a healthy dose of the sampling rate and its harmonics. The extra junk

    must be removed with a low pass filter that cuts off a little higher than the highestdesired frequency. (An identical filter should be placed before the ADC to prevent

    aliasing of any unsuspected ultrasonic content, such as radio frequency

    interference.)

    If the sampling rate is only twice the frequency of interest, the filters must have avery steep characteristic to allow proper frequency response and satisfactorily reject

    the sampling clock. Such filters are difficult and expensive to build. Many systems

    now use a very high sample rate at the output in order to simplify the filters. Theextra samples needed to produce a super high rate are interpolated from the

    recorded samples.

    By the way, the circuits that generate the sample rate must be exceedingly accurate.

    Any difference between the sample rate used for recording and the rate used atplayback will change the pitch of the music, just like an off speed analog tape.

  • 8/11/2019 Basics of Digital Recording

    4/21

    Also, any unsteadiness orjitterin the sample clock will distort the signal as it is

    being converted from or to analog form.

    Recording Digital Data

    Once the waveform is faithfully transformed into bits, it is not easy to record. Themajor problem is finding a scheme that will record the bits fast enough. If we

    sample at 44,100 hz, with a sixteen bit word size, in stereo, we have to

    accommodate 1,411,200 bits per second. This seems like a lot, but it is within thecapabilities of techniques developed for video recording. (In fact, the first digital

    audio systems were built around VCRs. 44.1 khz was chosen as a sample ratebecause it worked well with them.)

    To record on tape, a very high speed is required to keep the wavelength of a bit at

    manageable dimensions. This is accomplished by moving the head as well as thetape, resulting in a series of short tracks across the tape at a diagonal.

    On a Compact Disc, the bits are microscopic pits burned into the plastic by a

    laser.The stream of pits spirals just like the groove on a record, but is played from

    the inside out.To read the data, light from a gentler laser is reflected off the surfaceof the plastic (from the back: the plastic is clear.) into a light detector. The pitsdisrupt this reflection and yield up the data.

    In either case, the process is helped by avoiding numbers that are hard to detect,

    like 00001000. That example is difficult because it will give just a single very shortelectrical spike. If some numbers are unusable, a larger maximum (more bits) must

    be available to allow recording the entire set. On tape, twenty bits are used torecord each sixteen bit sample, on CDs, twenty-eight bits are used.

    Error Correction

    Even with these techniques, the bits are going to be physically very small, and it

    must be assumed that some will be lost in the process. A single bit can be very

    important (suppose it represents the sign of a large number!), so there has to be away of recovering lost data. Error correction is really two problems; how to detect

    an error, and what to do about it.

    Fig. 5 Effects of data errors

  • 8/11/2019 Basics of Digital Recording

    5/21

    The most common error detection method is paritycomputation. An extra bit is

    added to each number which indicates whether the number is even or odd. Whenthe data is read off the tape, if the parity bit is inappropriate, something has gone

    wrong. This works well enough for telephone conversations and the like, but doesnot detect serious errors very well.

    In digital recording, large chunks of data are often wiped out by a tape dropout or ascratch on the disk. Catching these problems with parity would be a matter of luck.

    To help deal with large scale data loss, some mathematical computation is run on

    the numbers, and the result is merged with the data from time to time. This isknown as a Cyclical Redundancy Check Code or CRCC. If a mistake turns up in

    this number, an error has occurred since the last correct CRCC was received.

    Once an error is detected, the system must deal gracefully with the problem. To

    make this possible, the data is recorded in a complex order. Instead of word twofollowing word one, as you might expect, the data is interleaved, following a

    pattern like:

    words 1,5,9,13,17,21,25,29,2,6,10,14,18,22,26,30,3,7,15,19,27 etc.

    With this scheme, you could lose eight words, but they would represent severalisolated parts of the data stream, rather than a large continuous chunk of waveform.

    When a CRC indicates a problem, the signal can be fixed. For minor errors, the

    CRCC can be used to replace the missing numbers exactly. If the problem is more

    extensive, the system can use the previous and following words to reconstruct apassable imitation of the missing one. One of the factors that makes up the price

    difference in various digital systems is the sophistication available to reconstructmissing data.

    The Benefits of Being Digital

    You may be wondering about the point of all of this, if it turns out that a digitalsystem is more complex than the equivalent analog circuit. Digital circuits are

    complex, but very few of the components must be precise; most of the circuitry

    merely responds to the presence or absence of current. Improving performance isusually only a matter of increasing the word size or the sample rate, which isachieved by duplicating elements of the circuit. It is possible to build analog

    circuits that match digital performance levels, but they are very expensive andrequire constant maintenance. The bottom line is that good digital systems are

    cheaper than good analog systems.

    Digital devices usually require less maintenance than analog equipment. Theelectrical characteristics of most circuit elements change with time and

    temperature, and minor changes slowly degrade the performance of analog circuits.Digital components either work or don't, and it is much easier to find a chip that has

  • 8/11/2019 Basics of Digital Recording

    6/21

    failed entirely than one that is merely 10% off spec. Many analog systems are

    mechanical in nature, and simple wear can soon cause problems. Digital systemshave few moving parts, and such parts are usually designed so that a little vibration

    or speed variation is not important.

    In addition, digitally encoded information is more durable than analog information,again because circuits are responding only to the presence or absence of somethingrather than to the precise characteristics of anything. As you have seen, it is

    possible to design digital systems so that they can actually reconstruct missing or

    incorrect data. You can hear every little imperfection on an LP, but minor damageis not audible with a CD.

    The aspect of digital sound that is most exciting to the electronic musician is that

    any numbers can be converted into sound, whether they originated at a microphone

    or not. This opens up the possibility of creating sounds that have never existedbefore, and of controlling those sounds with a precision that is simply not possible

    with any other technique.

    For further study, I recommendPrinciples of Digital Audioby Ken C Pohlmann,

    published by McGraw-Hill inc ISBN number0-07-050469-5.

    Peter Elsea 1996

    Source:http://artsites.ucsc.edu/ems/music/tech_background/TE-16/teces_16.html

    http://artsites.ucsc.edu/ems/music/tech_background/TE-16/teces_16.htmlhttp://artsites.ucsc.edu/ems/music/tech_background/TE-16/teces_16.htmlhttp://artsites.ucsc.edu/ems/music/tech_background/TE-16/teces_16.htmlhttp://artsites.ucsc.edu/ems/music/tech_background/tech_background.htmlhttp://artsites.ucsc.edu/ems/music/tech_background/TE-16/teces_16.html
  • 8/11/2019 Basics of Digital Recording

    7/21

    The Mathematics Behind

    Digital Technology

    Nowadays, when you watch TV or listento aCD, you'd be forgiven for takingthehigh qualityof the audio and video for

    granted. It seems a long time since we playedwarped, scratched and dustyvinyl records, orstruggled to watchMatch of the Daythrougha blizzard ofatmospheric'snow'.Today'sdigital technologyreproduces to ahigh degree the images which were captured

    at the filming location or the sound recordedin the studio.

    This Entry introduces a branchof mathematicswhich underpins moderncommunication technology and ensures that,among other things, the television pictureswe watch and the recorded sounds we hearare of optimum quality. It's known as codingtheory.

    Going Digital

    http://www.bbc.co.uk/dna/h2g2/plain/A23499138http://www.bbc.co.uk/dna/h2g2/plain/A23499138http://www.bbc.co.uk/dna/h2g2/plain/A476958http://www.bbc.co.uk/dna/h2g2/plain/A476958http://www.bbc.co.uk/dna/h2g2/plain/A676938http://www.bbc.co.uk/dna/h2g2/plain/A676938http://www.bbc.co.uk/dna/h2g2/plain/A30465911http://www.bbc.co.uk/dna/h2g2/plain/A30465911http://www.bbc.co.uk/dna/h2g2/plain/A882182http://www.bbc.co.uk/dna/h2g2/plain/A882182http://www.bbc.co.uk/dna/h2g2/plain/A144280http://www.bbc.co.uk/dna/h2g2/plain/A144280http://www.bbc.co.uk/dna/h2g2/plain/A144280http://www.bbc.co.uk/dna/h2g2/plain/A882182http://www.bbc.co.uk/dna/h2g2/plain/A30465911http://www.bbc.co.uk/dna/h2g2/plain/A676938http://www.bbc.co.uk/dna/h2g2/plain/A476958http://www.bbc.co.uk/dna/h2g2/plain/A23499138
  • 8/11/2019 Basics of Digital Recording

    8/21

    These days we usedigitaltechnology torecord, communicate and replay. Theanalogue or real-life signals are convertedinto long strings ofbinary digitswhen theyare recorded, stored and communicated, andthen converted back into an analogue signalwhen played back to the viewer or listener.

    One of the benefits of using binary numbers

    is that we can use some very clevermathematics to check whether the signals arecorrect at each stage of the process, and, inmany cases, where it isn't we canautomatically correct them. In practice, it's avery complicated business, and the actualmethods used would be far beyond the scopeof this Entry. However, we'll examine one ofthe principles involved, and by using simpleexamples we'll describe the mathematicsbehind one type of binary code, and how

    errors can be automatically detected andcorrected.

    Each digital signal consists of a series ofnumbers. In the case of a CD, for example,each number might indicate the sound levelat one particular point in time along one ofthe stereo channels. The signal is read by

    http://www.bbc.co.uk/dna/h2g2/plain/A533170http://www.bbc.co.uk/dna/h2g2/plain/A533170http://www.bbc.co.uk/dna/h2g2/plain/A5771973http://www.bbc.co.uk/dna/h2g2/plain/A5771973http://www.bbc.co.uk/dna/h2g2/plain/A5771973http://www.bbc.co.uk/dna/h2g2/plain/A533170
  • 8/11/2019 Basics of Digital Recording

    9/21

    a laserwhich scans the binary informationburnt into the microscopic indentations inthe track of the disc. If the track is at aparticular depth at a given point, it reads 0,whereas if it's indented (known as apit1),then it reads 1. In the course of playing theentire CD, the laser will detect many millionsof these numbers.

    Let's say that each number we read can haveone of 16 values at any point in time (in fact,standard compact disc technology uses amore complex and entirely different codingsystem, which we'll mention later). In binary,these values will be represented by thenumbers 0000, 0001, 0010, through to 1111,ie the decimal values 0 to 15). Binary digit isabbreviated to 'bit', so we call this a 4-bitmessage.

    Now, consider the binary number 1001,

    representing a value of 9. This couldrepresent, for example, the sound level on aNigel Kennedy CD through the left-handstereo channel at exactly 1 minute and 14seconds into his rendition of the thirdmovement of 'Spring' fromVivaldi'sFourSeasons. What happens if there's an error

    http://www.bbc.co.uk/dna/h2g2/plain/A597215http://www.bbc.co.uk/dna/h2g2/plain/A597215http://www.bbc.co.uk/dna/place-london/plain/A85655046#footnote1http://www.bbc.co.uk/dna/h2g2/plain/A423154http://www.bbc.co.uk/dna/h2g2/plain/A423154http://www.bbc.co.uk/dna/h2g2/plain/A423154http://www.bbc.co.uk/dna/h2g2/plain/A423154http://www.bbc.co.uk/dna/h2g2/plain/A423154http://www.bbc.co.uk/dna/h2g2/plain/A423154http://www.bbc.co.uk/dna/place-london/plain/A85655046#footnote1http://www.bbc.co.uk/dna/h2g2/plain/A597215
  • 8/11/2019 Basics of Digital Recording

    10/21

    when we read it? Maybe the CD is slightlywarped, or there's a minute manufacturingfault in the track depth, or maybe someonejogs the CD player at that moment. If there'sjust a small error, then one of the bits of ournumber will be misread a 0 will berepresented as a 1 or a 1 as a 0 in our binarymessage.

    Depending on which bit was incorrect, ournumber 1001 could be read by the CD playeras any of the following: 0001, 1101, 1011 or1000. But the trouble is, these are still validnumbers in our set. Instead of 9, theyrepresent 1, 13, 11 or 8 respectively. Our CDplayer can't know that anything is wrong - itwould just process it as if theviolinisthadplayed a sound according to level 13, say,rather than level 9 at that point, and so thiswould corrupt the signal we hear. In practice,

    a single error wouldn't usually be noticeableto the listener, but in some cases it might beheard as a small 'pop'or crackle on thesoundtrack. With lots of errors throughoutthe recording, however, we would notice adeterioration in sound quality, not unlike the

    http://www.bbc.co.uk/dna/h2g2/plain/A437528http://www.bbc.co.uk/dna/h2g2/plain/A437528http://www.bbc.co.uk/dna/h2g2/plain/A437528http://www.bbc.co.uk/dna/h2g2/plain/A37676613http://www.bbc.co.uk/dna/h2g2/plain/A37676613http://www.bbc.co.uk/dna/h2g2/plain/A37676613http://www.bbc.co.uk/dna/h2g2/plain/A37676613http://www.bbc.co.uk/dna/h2g2/plain/A437528
  • 8/11/2019 Basics of Digital Recording

    11/21

    familiar effects of dust or scratches on a vinylLP.

    So, if an error occurs with this code, the CDplayer can't tell, as any error condition is thesame as another valid number in our code. Inorder to tell if there's an error, we need toadd some additional information to ourmessage.

    Error Detection

    The most simple way is to add an extra bit tothe end of the code number - a check bit -and choose its value according to a rule. For

    example, we might say that every word in ourcode has to have an even number of 1s. So0000 would have a 0 appended to the end(giving it zero 1s in total), 0001 would have a1 appended (making two 1s in total), and soon. Our new code looks like this:

  • 8/11/2019 Basics of Digital Recording

    12/21

    Message bits Check bit Codeword

    0000 0 00000

    0001 1 00011

    0010 1 00101

    0011 0 00110

    0100 1 01001

    0101 0 01010

    0110 0 01100

    0111 1 01111

    1000 1 10001

    1001 0 10010

    1010 0 10100

    1011 1 10111

    1100 0 11000

    1101 1 11011

    1110 1 11101

    1111 0 11110

    The first four digits of each codeword are ouroriginal message, and each complete

  • 8/11/2019 Basics of Digital Recording

    13/21

    codeword has an even number of 1s, or, asmathematicians would say, has even parity.

    Now, see what happens if an error occurs inone bit. No matter where it occurs, itinvalidates our rule for the check bit. It willchange a 0 into a 1 or a 1 into a 0, and we endup with an odd number of 1s as a result. Sowe know if there's an error and we can

    programme our equipment to check for thiscondition and take appropriate action. In thecase of some communication systems, whenwe detect an error, we might ask for thesignal to be retransmitted.

    For the CD player, however, this isn'tpossible. The music would sound verystrange and we'd lose a fair amount ofrhythm if we asked the laser to go back andread each error again. If it were amanufacturing fault causing the error, then

    the laser may never be able to read thecorrect value in any case. All is not lost,though. All we need is a clever way to notonly detect an error but to make an informedguess as to what the correct value might havebeen.

  • 8/11/2019 Basics of Digital Recording

    14/21

    In the case of the previous code, we mayknow that something is wrong, but it's notpossible to tell which bit was in error. If wereceive the message 10101, say, containingthree 1s, then we know there's an error, but,assuming only one bit was in error, theintended message may have been any of fivevalues: 00101, 11101, 10001, 10111 or 10100

    (in decimal: 2, 14, 8, 11 or 10) . We don'tknow which one of these is correct.

    Error Correction and

    Hamming Codes

    For automatic error correction we need toadd more check bits. We'll illustrate thisusing one common set of codes used for 4-bitmessages, where three check bits areappended, making each into a 7-bit

    codeword. These are known as Hammingcodes, named after American mathematicianRichard Hamming (1915 - 98).

    There are many ways to encode the checkbits. In the following example, we'll derivethem according to these three rules:

  • 8/11/2019 Basics of Digital Recording

    15/21

    1.The first, second, fourth and fifth bitshave even parity

    2. The first, third, fourth and sixth bitshave even parity

    3. The second, third, fourth and seventhbits have even parity

    This allows us to construct the followingcode. The columns show the binary number

    which is our message, the check bits we addto it, as calculated by the above rules, and thefinal codeword which we would transmit(and hopefully receive).

    Message bits Check bits Codeword

    0000 000 0000000

    0001 111 0001111

    0010 011 0010011

    0011 100 0011100

    0100 101 0100101

    0101 010 0101010

    0110 110 0110110

    0111 001 0111001

    1000 110 1000110

    1001 001 1001001

    1010 101 1010101

  • 8/11/2019 Basics of Digital Recording

    16/21

    1011 010 1011010

    1100 011 1100011

    1101 100 1101100

    1110 000 1110000

    1111 111 1111111

    The reason why this code is clever is aproperty known as the minimum distanceof

    the code. Unlike our earlier code where anerror in one bit merely turned it into anothervalid codeword, each of these codewords in aHamming code differs from any othercodeword by at least three bits. If there is anerror in any one of the seven bits, then wecan identify the nearest codeword which isonly one bit different from it.

    If we received the code 1010111, say, then thisisn't a valid codeword in our list. If we searchthrough the allowable codes, we can see it's

    only one bit different from 1010101, so it'sreasonable if we correct it to this. As theminimum distance of our code is three bits,we know there is no other codeword which isonly one bit different.

  • 8/11/2019 Basics of Digital Recording

    17/21

    Automating the Error

    Correction ProcessIn the case of our Hamming code example,we can automate this process using a neat bitof mathematics. It involves a bit of modulo-2matrix multiplication. Now, we appreciate

    that maths doesn't float everyone's boat, so ifyou really don't want to see the clever bit,look away now.

    Remember those rules we used to constructour Hamming Code? We first need to writethem in the form of a binary matrix. There isone row for each rule, and a column for eachbit of the code. We will therefore have threerows and seven columns. Each cell has a 1 ifthe rule checks that bit and 0 if it doesn't. Inour example, our first rule was that the first,

    second, fourth and fifth bits would have evenparity, so the first row is 1101100, and so on.Our completedparity check matrixlooks likethis:

    1 1 0 1 1 0 0

    1 0 1 1 0 1 0

  • 8/11/2019 Basics of Digital Recording

    18/21

  • 8/11/2019 Basics of Digital Recording

    19/21

    If we multiply every codeword we receive bythe parity matrix and then correct the bitindicated by the result, then we willautomatically convert the received messageinto a string of the nearest valid codewords.This corrects every codeword which has nomore than one error in it.

    Multiple ErrorsThe Hamming (7,4) code isn't capable ofcorrecting more than one error bit, but othercoding mechanisms exist which do.

    The more errors we wish to detect, the more

    check bits we have to use and the longer ourmessage becomes as a result. There is atrade-off between the efficiency or rateof acode ie what proportion of the code is theactual message and the error-correctingability of it.

    Different codes are suitable for differentapplications. In the case of a CD, we wouldwish to make the code as efficient as we can,so that we can store as much real data on thedisk as possible. The precision manufacturing

    process ensures that errors are not

  • 8/11/2019 Basics of Digital Recording

    20/21

    widespread, and any clusters of localisederrors, perhaps indicating a pressing defector a scratch, are minimised by a process ofinterleaving the numbers such that that datafrom the same logical location are spread outacross different physical locations of the disk.

    On the other hand, consider the example of aspace probe sending back photographs from

    a distant planet. This will transmit a weaksignal, one which will be susceptible to manyerrors caused by background noise. Thisapplication lends itself to a coding systemwhich corrects multiple errors, ensuring thatthe received picture is as high a quality aspossible. It will necessarily be an inefficientcode, however, with maybe five or six timesas many parity check bits as message bits,and it will take far longer to transmit as aresult.

    Back to those CDs

    In practice, compact discs don't useHamming codes; they use something knownas a Reed-Solomon code2. This code is too

    complex to describe here, but it has theadvantage of being applicable to the problem

    http://www.bbc.co.uk/dna/place-london/plain/A85655046#footnote2http://www.bbc.co.uk/dna/place-london/plain/A85655046#footnote2
  • 8/11/2019 Basics of Digital Recording

    21/21

    of detecting and correcting long bursts oferrors, as may be caused by a scratched CD.

    Source:http://www.bbc.co.uk/dna/place-london/plain/A85655046

    http://www.bbc.co.uk/dna/place-london/plain/A85655046http://www.bbc.co.uk/dna/place-london/plain/A85655046http://www.bbc.co.uk/dna/place-london/plain/A85655046http://www.bbc.co.uk/dna/place-london/plain/A85655046

Top Related