• No results found

4. The Outcome

4.2 Analogue and digital data

The digital age has been said to have began with the discovery of the bi-polar transistor by William Shockley in 1948 and the subsequent development of the MOS-transistor in the 1960s (Bassett, 2007). Prior to the mid-1900s then, all information was recorded, stored or transmitted in analogue form. Analogue information consists of a theoretically infinite number of values with examples of such information including sine

waves (the waveforms representing human speech) and the signals from conventional television cameras.

The discovery of the transistor and subsequent technological advances such as the silicon chip, micro-processors and computers eventually resulted in the ability to record, store and transmit information in another way; digitally. Unlike analogue information, digital information consists of a limited number of discrete values expressed by the binary numbers 0 and 1 (called “bits”).

An analogue signal can be converted to a digital signal in an electronic device called an analogue-to-digital converter (ADC). The process occurring within the ADC includes both “quantising” and “encoding”. Quantising involves sampling rate (i.e. how often the analogue signal is sampled) and sampling precision (i.e. how accurately the analogue signal is sampled) and is the process whereby the continuous range of values in the analogue signal is approximated by a number of discrete quanta. Figure 4.1(a) for example represents an analogue voice signal over a period of three seconds. The green rectangles in Figure 4.1(b) represent an attempt to approximate that signal using a sampling rate of 4 samples/sec and a sampling precision involving 10 levels (i.e. 0-9). Every second then, the ADC samples the analogue signal 4 times and selects the value (quanta) within the range 0-9 which best represents the analogue signal at that time. The selected numbers (quanta) are shown along the bottom of Figure 4.1 (b).

Figure 4.1 – Analogue to Digital Conversion: (a) Analogue signal. (b) Approximation of analogue signal (green rectangles) using a sampling rate of 4 samples/sec and sampling precision involving 10 levels (0 – 9)

Encoding follows quantisation and is the process whereby the quanta are assigned a digital code (i.e. 0’s and 1’s) thereby becoming “bits” of digital information. Following on from Figure 4.1, the process can be envisaged as per Figure 4.2.

8 9 4 2 5 6 7 6 7 7 6 5 0

1 2 3 4 5 6 7 8

(a)

9

(b)

The bitstream is once again converted to an analogue signal through a digital-to analogue converter (DAC) which essentially reverses the process of the ADC. For audio analogue signals then, the fidelity with which the re-generated analogue signal matches the original is dependent on the sampling rate and sample precision used in the analogue-to-digital conversion process.

The conversion of an analogue image to a digital image also involves ADC’s but is somewhat more complex. An analogue image exists in a 2-dimensional plane (height and width) that contains information in the form of variations in colour and brightness (intensity).

In order to convert such an image into digital form those variations in colour and brightness, along with their location in the plane must be quantised and encoded. That is achieved by

“sampling” the analogue image using a grid placed over the image and so dividing it into an array of small, individual picture elements called “pixels”. As the number of pixels increases so too does the detail recorded in the digital image. For example, an image divided into a grid 640 pixels long x 480 pixels wide (and so containing 307,200 pixels) will look block-like and lack detail compared to the same image sampled using a grid of 1280 x 1024 pixels containing a total of 1,310,720 pixels.

Once having sub-divided the image into pixels, each pixel is examined and its intensity and colour quantised and encoded. The quantisation of intensity is straightforward and involves assigning an integer number proportional to brightness (see Figure 4.3). That integer number, a function of the sampling precision (i.e. number of levels) used by the ADC to represent brightness, is then converted to bits (i.e. 0’s and 1’s).

Quanta Bits

Figure 4.2 – Conversion of quanta to “bits” (binary numbers). The quanta are shown in brackets below their equivalent binary code

…7…6…5…2…4…9…8 …101…10…100…1001…1000

(5) (2) (4) (9) (8)

The quantisation of colour is somewhat more complex and is dependent on how the image will ultimately be displayed: RGB (red, green and blue) for scientific applications, CYMK (cyan, yellow, magenta and black) for print applications and HSB (hue, saturation and brightness) for television. A detailed explanation of each scheme is beyond the scope of this work and so a conceptual approach to understanding colour quantisation will be adopted instead.

Conceptually then, any colour can be represented by a combination of the three primary colours red, green and blue. As a consequence, the colour of any pixel can be determined by the relative intensities of those colours within the pixel. If, for example, the intensity of the colour blue in a pixel is level 10 while that of both red and green is level 1, the pixel will appear blue. As the intensity of green increases (with the intensity of red and blue remaining unchanged) the pixel colour will eventually become yellow (at green level 10) and then increasingly green as the intensity of green continues to climb to higher levels.

Specifying a pixel colour then can be achieved by, for example, assigning three quanta to that pixel; one for the intensity of red, one for the intensity of green, and one for the intensity of blue.

Since there is no limit to the number of possible colours, but a definite limit to the storage and processing capacity of computers, some restrictions must apply when assigning digital values to colour information. The number of colours a pixel can display is set by its

“bit depth”, that is the amount of bits made available to the pixel for storing information about that pixel. The more bits made available to the pixel for each of the colours red, green and blue the more shades of colours that pixel can display and so the finer the colour detail of the image. 24-bit colour for example (or “True” colour, the standard for PC monitors) assigns 8 bits each for red, green and blue. That allows 28 = 256 shades of red, 256 shades of green and 256 shades of blue giving a total of 256 x 256 x 256 = 16,777,216 million colours and so making the monitors colours appear “true” to the human eye. 24-bit colour then is superior to 16-bit colour (which assigns 5 bits each for red and blue and 6 bits for green giving a total of 25 x 25 x 26 = 32 x 32 x 64 = 65,536 colours) but not as good as 32-bit colour which gives a total in excess of 80 million colours.

Figure 4.3: Quantisation of brightness. The integer numbers assigned to the various quanta of brightness are subsequently converted to bits (i.e. 0’s and 1’s) within the ADC.

Brightness

2 3 4 5

1

Each pixel occupies a unique location on the grid and so its position can be specified and encoded. That location information in conjunction with the quantised and encoded colour and brightness values assigned to the pixels ultimately results in a bitstream that represents the image. As the number of pixels and “bit depth” increases so too does the picture fidelity with the result that a high-quality (high-fidelity) image requires a large amount of data to be stored. As an example, digitising and recording a standard video signal for digital playback at 640 x 480 pixels/frame in “true” 24-bit colour and displaying the images at the standard rate of 30 frames per second (fps), requires the processing of 640 x 480 x 3 (i.e. for the thee colours red, green, blue) x 8 (bits/colour) x 30 (frames per second) = 224 million bits /second. At such a rate a standard CD-ROM capable of storing 5200 million bits would hold only 23 seconds of video. Technological limitations then currently prevent data transfer at such high rates and so in order to display digital video it is compressed for storage and then de-compressed for display. File compression/de-compression is achieved using a “codec” and is not confined to video/image based data as audio codecs are also employed.

A codec is a device (hardware) or program (software) capable of compressing and/or decompressing a digital data stream. (The word “codec” derives from

‘compressor-decompressor', 'coder-decoder', or 'compression/decompression algorithm'). Hardware codecs have advantages over software codecs in that, apart from reducing CPU load thereby allowing the performance of other tasks, device codecs are optimised for the quick

decompression and display of data. For video data then, such codecs provide higher frame rates and larger images than purely software-based codecs.

Codecs can be classified as either “lossy” or “lossless”. Lossy codecs achieve compression at the cost of fidelity whereas lossless codecs are typically used for archival purposes and store data in a compressed form while still retaining all the information in the original stream. It should be noted that as the cost of storage capacity decreases and network bandwidth increases there is a reduced need for lossy codecs for some media. Most

commonly used video codecs are, however, lossy including MPEG-4 (part of ISO/IEC standard 14496-2), “Quicktime” (Apple’s ITU-T H.264 compliant codec) and “WAV”

(Microsoft’s Windows Media Video codec) and so using such codecs successively, as might occur for example when sending video files for repeated rounds of editing, is to be avoided.

“Loss” occurs, in part, because codecs are often optimised to emphasise important aspects of the media they were designed to encode. A codec designed to encode a sports event such as basketball for example needs to encode motion well but not necessarily exact colour or fine detail such as faces in the crowd. A video of an art exhibit on the other hand needs to perform well in encoding colour and fine detail such as surface texture but not motion.

Video images are generally not silent movies and so are usually accompanied by sound. Such images then contain both video and audio data and so comprise a “multimedia”

data stream requiring the use of a multimedia codec to achieve compression/decompression.

In addition to compressing/decompressing the video and audio data, a multimedia codec adds additional metadata to the stream to enable synchronisation of the video and audio data. For multimedia data to be useful in stored or transmitted form then, its three components (i.e.

video, audio and synchronisation data) must be able to be correctly identified and successfully interleaved and that is achieved via a “container format” such as AVI (the

standard Microsoft Windows container), MP4 (the standard MPEG-4 container) and Matroska (an open source format).

A Google search on “multimedia codecs” reveals many free, open source audio and video codecs available for download as well as proprietary codecs available for purchase.

The wide variety of codecs results in an equally wide variety of file types produced by those codecs including MPEG, JPEG and WAV. While most codecs support the basic operations required to display compressed audio and/or video digital data streams for many common file types, the sheer variety of codecs and their various versions can result in compatibility and obsolescence issues. This can be particularly problematic for multimedia data because the choice/availability of codecs and their optimisation characteristics (i.e. optimised for movement, colour, detail etc.) can result in each of the three data streams being handled by different programs, processes or hardware making accurate decoding and display potentially difficult if the recipient of the multimedia data has an incompatible/obsolete codec.

Container formats too can be problematic since not all such formats are compatible with all codecs.

While the characteristics of the ADC/DAC’s, codecs or container formats might vary, the end result of an analogue to digital conversion is a stream of bits comprising 0’s and 1’s that represent much, but not all, of the original analogue information. Despite the loss of information, digital signals have a number of advantages over their analogue counterparts.

Specifically:

• They allow for more efficient storage of information. Although digital signals can have very high fidelity they do not contain as much information as the analogue signals from which they are derived, particularly if compressed via a codec. As a consequence more digital information than analogue information can be stored in the same volume.

• Digital signals are easier to transmit. When analogue signals become weak due to transmission loss it is difficult to separate them out from random transmission noise. Simply amplifying the signal also amplifies the noise. The well-defined (either 0’s or 1’s) and orderly nature of digital signals on the other hand makes them easier for electronic circuits to distinguish from noise. Once identified the signal can be amplified and sent on another leg of the transmission path.

• Compressed digital signals are more cost-effective to transmit since they allow more information to be sent in a given period of time when compared with analogue signals.

• Digital signals allow for perfect reproduction since the data will always be the same no matter how many times it is accessed as long as the numbers representing that data are not corrupted.

• They are more easily processed than analogue signals since

microprocessors/computers "talk" and "think" in terms of binary data.

It is those properties of digital information that have seen its use extend beyond computers to devices such as mobile phones, music and video players, personal video recorders and digital cameras.

The efficiency with which digital information can be transmitted and the ease with which it can be utilised by microprocessors/computers makes the use of such information particularly appealing for telecommunications and it is those considerations that have resulted

in the world's communication systems converting to the pulse code modulation (PCM) digital transmission format.

While “0’s” and “1’s are well-suited to transmission over long distances, bitstreams themselves are not and so further processing of such signals is required.