Chapter1_InformationRepresentation
Data Representation
Prefixes
Binary prefix name | symbol | value | Decimal prefix name | symbol | value |
---|---|---|---|---|---|
Kibi | Ki | $2^{10}$ | Kilo | k | $10^3$ |
Mebi | Mi | $2^{20}$ | Mega | M | $10^6$ |
Gibi | Gi | $2^{30}$ | Giga | G | $10^9$ |
Tebi | Ti | $2^{40}$ | Tera | T | $10^{12}$ |
Overflow: the result of carrying out a calculation which produces a value too large for the computer’s allocated word size
Applications
Application of hexadecimal system
- Memory dumps
- Memory contents are output to printer or monitor
- MAC address
- Error message
- IP address
- Unicode
- Colour in HTML
Application of Binary Coded Decimal (BCD)
- Calculator
- Clock
Character sets
Character set:
- The symbols that computer uses
- A list of characters recognized by computer software and hardware
- Each character has a character code
- The binary code for each character in the string is stored in sequence
Disadvantage of ASCII:
- Only 256 characters can be represented
- Uses values 0 to 127/256
- Many characters in other languages cannot be represented
- The extended ASCII the characters from 128 to 255 may be coded differently in different system.
UNICODE:
- UNICODE has greater range of characters than ASCII
- UNICODE represents most written language in the world, while ASCII does not; used for English only
- ASCII uses 7-8 bits per character, whereas UNICODE uses up to 4 bytes per character
- UNICODE is standardized while ASCII is not
Multimedia
Graphics
Bitmap | Vector graphic | |
---|---|---|
Definitions | · Made up of pixels (picture elements) · Stored in a two-dimensional matrix of pixels · Each pixel has a colour · Stored as binary number · The number of bits used to represent a pixel is called colour depth |
· A series of geometric shapes · Drawing object · Exact dimension is not stored Stored coordinates · Contains a drawing list · Commands/formulae for creating each individual object · Property for that object Eg: colour, thickness |
Properties | · Takes up more memory · Enlarging the bitmap can means that the image is pixelated · Can be compressed with significant reduction in file size · Suitable for photographs/scanned image · Uses less processing power · Individual elements of a bitmap cannot be grouped · It is possible to change/edit each pixel to change the design |
· Made up of geometric shapes which require definition/attributes · Stores a set of instructions about how to draw the shape · Takes up less memory · Vector graphic image can be enlarged without being pixelated · Do not compress well · Suitable for geometric shape · Individual elements of a vector graphic can be grouped · Vector graphics need to be ‘rasterised’ in order to display or print. · Image is redrawn with small adjustment · It is necessary to change each of the geometric shape to alter the design |
Available formats | .jpeg , .bmp , .png |
.svg , .cgm , .odg |
Defined in XML text files which, therefore, allows them to be compressed. |
Pixel: smallest picture element which can be drawn
Screen resolution: the number of pixels which can be view horizontally and vertically
Image resolution: the number of pixels that make up an image
Resolution: the number of pixels per column and per row
Pixel density: number of pixels per square centimetre.
Sound
Sampling analogue sound:
- Amplitude measured
- At regular time interval
- The value of sample is recorded as binary number.
Increasing sampling resolution:
- More bits used to represent one sample
- Larger file size
- Takes longer to transmit/download the file
- Requires greater processing power
- More accurate representation of sound
- Less sound distortion
- Larger dynamic range
- Better sound quality
Decrease sample rate:
- Fewer samples per unit time
- File size will reduce
- Larger gaps/ space between samples // greater quantization errors
- Sound accuracy will reduce.
Sampling:
- amplitude of sound wave taken at different points in time.
- Measurement the value of the analogue signal at regular time interval.
Sampling rate:
- Number of time that the amplitude of (analogue) sound wave is taken
- Per unit time
- Higher sampling rate results in more accurate digital representation.
Sampling resolution:
- Resolution is the number of distinct value able to encode/represent each sample
- Specified the number of bits used to store each sample
- Also called bit depth
- The higher the sampling resolution, the lower the quantization error
- The higher the sampling, the less sound distortion.
- Usually 8 bits, 16 bits, 24 bits or 32 bits.
- Benefits:
- Allows for larger dynamic ranges
- More accurate representation/ sound quality
- Drawbacks:
- Bigger files / larger memory
- Takes longer to transmit/download
- Greater processing power needed
Sound editing software:
- Edit start time, stop time and duration of any sound/time
- Extract/delete/save part of a clip
- Frequency, amplitude, pitch alteration
- Conversion between different audio file formats
- Use of filters
- Mix/merge multiple sound sources
Sound edit:
- Fading
- Change a volume of a section of sound for it to get louder.
- Removing sound element
- Delete sections of the sound wave.
- Copy
- Repeat elements of the sound wave.
Sound:
- Analogue value
- Use ADC (analogue digital converter)
- To convert to digital value
Compression
Lossy data compression:
- Lossy may result in lost of detail compared to the original file
- Lossy compression make decision about what parts of the file are important and not important.
- Certain parts of the music can be eliminated without significantly degrading the listener’s experience.
- Discards softer sounds if two sounds played together.
- Perceptual music shaping: only keeps sound that human ear can hear
- Reduce to about 10%
- E.g: mp3, jpeg
Method1: Reduce the colour depth
- Reduce the number of bits per colour
- Each pixel has fewer bits
Method2: Reduce the resolution
- Fewer pixels per unit measurement
- Fewer pixels are stored.
Lossless data compression:
- Lose none of the original detail
- Based on some form of replacement: Run line Encoding
- Maximum compression to about 50%.
RLE(Run line encoding):
- Lossless method of compression
- Reduces the size of a string of adjacent, identical characters
- The repeating string is encoded into two values
- One value represent the number of characters in the run
- The other value is the code of the character in the run
- The run value and run count combination may be preceded by a control character
🔗Recommended article(s)
What’s the best lossless image format? Comparing PNG, WebP, AVIF, and JPEG XL
The author first introduced concepts of lossy and lossless compression. Then explained the different image type supported for lossless compression. Finally, the article compares between the effectiveness between different image types’ lossless compression. The article gives quite a deep understanding and is interesting to read.