Friday, February 21, 2014

Representing Images, Sound and other Information


Bit-mapped graphics
If we go back to the early home computers the graphics, to say the least, was very primitive. If you wanted to create a little stick-man figure you would need to work out the binary pattern for that shape. Something like:
In effect we have bit-mapped graphics. The binary patterns that are stored in video memory correspond to the image displayed on screen.
A bitmap is characterised by the width and height of the image in pixels (the smallest unit on a screen or in memory) and the number of bits per pixel which determines the number of shades of grey or colours it can represent. A bitmap representing a coloured image will usually have pixels with between one and eight bits for each of the red, green, and blue components, though other colour encodings are also used. See Visual Basic notes using the RGB colour function.

Vector graphics

Sometimes called "object-oriented" graphics. Vector graphics deals with separate shapes such as lines, polygons and text and groups of such objects as opposed to a painting program which stores only bitmaps. The advantage is that it is possible to change any element of the picture at any time since each part is stored as an independent object whereas once something in a bitmap has been overwritten it cannot in general be retrieved.
At a very simple level the graphics in Microsoft Paint is bit-mapped whereas the graphics tools in Corel Draw or even, to a lesser extent, in Microsoft Publisher, use vector graphics.

Sound

In order to understand how sound can be represented as a bit-pattern we need to consider two different ways in encounter signals of information.
In our everyday lives we are used to analogue signals - the temperature in a room, the light levels outside or the changes in atmospheric pressure are all varying continuously. The temperature does not suddenly change from one level to another. These continually varying signals are analogue signals. However computers do not work with analogue signals - they work with binary signals which are either on or off. A binary signal is just a particular example of a digital signal.
If you look at a digital watch the smallest interval of time might be 0.1 of a second. There is no value between this. It is a discrete, digital signal. Time itself is analogue. We can continually split intervals of time into smaller segments forever (as far as we can tell).
The difference between analogue and digital does cause a number of problem. How do we connect analogue devices such as temperature probes to computers. In effect they are talking a different language. One way is to approximate the analogue signal over a period of time. eg

The analogue signal (the thick wavy line) is converted into digital values (the blocks on the diagram) that approximate to the “real” system. By reducing the time interval the accuracy would increase. The digital number, in a computer system would then be converted into a binary pattern. So, for instance, the highest portion of the graph would, in 8 bits, be represented by 11111111. The lowest portion might only be 10001000. If the graph went down an analogue value of zero then the binary pattern would be zero. Obviously the more “bits” in the converter the greater the accuracy of the pattern to the original. Similarly if the frequency of conversion (how quickly we sample the sound) is increased we get greater accuracy.
There is an electronic device known as an ANALOGUE to DIGITAL CONVERTER (ADC) which can perform this task. If we are starting with binary or digital patterns then a DAC would be used. A DAC is used in CD players since the CD is a digital medium and needs to be converted into something that approximates to an analogue output for the speakers. Similarly, if you are recording sound from a microphone on to a CD the ADC process is required. If you can devote more “bits” and/or sample over smaller periods of time then the quality of out put would improve. Eventually, however, the human ear will not resolve small changes and so it is not necessary to increase the quality any further.
So, if we make a new recording of Dave Berry and the Cruisers, it is more than likely that analogue microphones would be used. The signals would then be converted into digital ones (binary) so that they can be processed by computer. The mixing, fading, etc, is all done on computer and the final output pressed onto a CD. The millions of people who buy this CD then put this into their CD players where it is converted back into analogue and outputted to the speakers.

There are alternative ways of processing sound. It is possible to buy speech chips which have segments of speech (known as phonemes) built into them. Each phoneme is associated with a particular binary pattern. So, if you wanted to generate a certain word, a series of bit patterns would need to be sent to the chip. The final output would sound like Stephen Hawkins but it would still be comprehensible. 

No comments:

Post a Comment