Text, Sound and Images | O Level Computer Science 2210 & IGCSE Computer Science 0478 | Detailed Free Notes To Score An A Star (A*)
Character Sets – ASCII Code and Unicode
- ASCII code
- American Standard Code for Information Interchange
- Set up in 1963
- Newer version in 1986
- The standard character set consists of 7-bit codes
- 0 to 127 in denary.
- 00 to 7F in hexadecimal
- These codes represent different numbers, letters and characters that are found on the standard keyboard
- 32 codes are control codes (0 to 31 in the denary system and 00 to 19 in the hexadecimal system)
- Between lowercase and uppercase codes for the same character, the sixth bit changes from 1 to 0.
- 0 represents uppercase
- 1 represents lowercase
- Character sets are grouped together in sequences
- This makes the usability faster
- Extended ASCII uses 8-bit codes
- 0 to 255 in denary
- 0 to FF in hexadecimal
- It provides another 128 codes that allow characters for the use of non-English alphabets and graphical characters as well.
- American Standard Code for Information Interchange
- Disadvantages
- Does not represent non-Western languages
- Different methods of coding have existed between DOS and Windows over the years.
- One coding system is called Unicode
- Represents all languages around the world.
- Supports many operating systems, search engines and internet browsers that are used globally
- It overlaps with standard ASCII as the first 128 characters are the same.
- Unicode can support several thousand characters in total.
- ASCII uses one byte to represent a character
- Unicode uses 4 bytes per character
- The Unicode Consortium was set up in 1991.
- Version 1.0 published with five goals
- Create a universal set covering all languages and writing systems
- Be more efficient than ASCII
- Unambiguous encoding system where both 16-bit and 32-bit values represent the same characters.
- Uniform encoding with each character coded as 16-bit or 32-bit code
- Reserve part of the code for private use.
- User can assign codes for own characters and symbols
- Version 1.0 published with five goals
Representation of Sound
- Soundwaves are air vibrations
- Ear senses the vibrations and interpret them
- Each sound wave has a wavelength, amplitude and frequency
- Sound waves continuously vary, making it analogue data.
- Computers require digital data.
- Instead, soundwaves need to be sampled to be stored in the computer
- Sampling
- Measuring the amplitude of the sound wave
- An Analogue to Digital Converter (ADC) is used for this purpose.
- Converts the analogue data to digital version
- Sound waves are sampled at regular time intervals
- Precise measurement of the amplitude is not possible.
- Approximate values are stored
- On the graph of sound amplitudes, the x-axis shows the time intervals, and the y-axis shows the sampled amplitude.
- Given that amplitude range is usually from 0-10 in most samples, a 4 binary bits can be used to represent each amplitude value
- Increasing the binary value can increase the accuracy of the sampled sound. For example, using 0-127 instead of 0-10 for the sample range will provide more accurate representation.
- Sampling Resolution
- Number of bits per sample
- Also called bit depth
- Sampling Rate
- Number of sound samples taken per second
- Measured in hertz (Hz), 1 hertz means one sample per second
- How sound clip is recorded?
- Amplitude is first determined at set sampling rate
- Approximate representation of sound wave given
- Each sample is then encoded using series of binary digitals.
- A higher sampling rate or larger resolution will allow more faithful representation of the original sound.
- However, increasing sampling rate or resolution can increase file size.
- Benefits of larger sampling resolution
- Larger dynamic range
- Better sound quality
- Less sound distortion
- Drawbacks
- Larger file size
- Longer to transmit or download
- Greater processing power required
- CDs have 16-bit sampling resolution and a 44.1 kHz sample rate, meaning 44 000 samples per second. Therefore, it provide high quality sound reproduction.
Representation of (bitmap) images
- Bitmap mages are made of pixels
- Pixels mean picture element
- Two dimensional matrix of elements
- Pixels may occur in different shapes
- Each pixel can be shown as a binary number
- A bitmap image is stored in the computer as a series of binary numbers
- Black and white image requires only 1 bit per pixel.
- Only two colors, so 1 and 0 is enough to represent it.
- If 2 bits are used to represent each pixel, then each pixel can show one of 4 colors i.e. 00, 01, 10, 11. The rule is, 2 to the power of number of bits so 2^2 =4 colors.
- Similarly, if 3 bits are used per pixel, it can represent 8 colors as 2^3 = 8.
- Color Depth
- Number of bits used to represent each color
- 8 bit color depth means each pixel can determine one of 256 colors, as 2^8 = 256.
- Modern computers have 24 bit color depth.
- Generalization
- X bits per pixel
- 2^x colors represented
- Increasing color depth also increases the size of the file.
- Image resolution
- Number of pixels that make up an image
- An image could contain length x breadth number of pixels
- For example 4096 x 3072 pixels i.e. 12 582 912 pixels in total
- Many cameras allow this resolution to be varied before taking the picture
- Lower resolution means that the picture has less details than a higher resolution picture.
- Lower resolution can result in the image becoming pixelated or fuzzy.
- High resolution has a drawback that the file size is very large.
- Time to download will increase
- Time to transfer between devices will also increase
- Lossless reduction / compression is possible to a certain extent before the quality loss becomes noticeable
- It reduces file size
