1.2 Text, Sound, and Images

Question Bank · 19 Questions

Objectives: Students should be able to —

  • 1 Describe how and why a computer represents text.
  • 2 Identify and describe the use of character sets including ASCII and Unicode.
  • 3 Describe how and why a computer represents an image.
  • 4 Give the effects of the resolution and colour depth on images.
  • 5 Describe how and why a computer represents sound.
  • 6 Identify and describe sound sample rate and sample resolution.

Representation of Text in computer

  • File format is a standard way that information is encoded for storage in a computer file.
  • It specifies how bits are used to encode information in a digital storage medium.
  • It tells the computer how to display, process, save and print the data by the application program which created the file.

File name contains two parts — the first part is the name of the file and the second part is its extension (suffix) separated by a dot. The extension name of the file indicates its data format.

Example:

Filename Extension Description
filename.txt.txtSpecifies that it is a Text file.
filename.pdf.pdfSpecifies that it is a Portable Document File.
filename.bmp.bmpSpecifies that it is a Bitmap Image file.
filename.mp3.mp3Specifies that it is an Audio (sound/music) file.
filename.mp4.mp4Specifies that it is a Video file.
  • Computer is made up of silicon chips that contain millions of transistors or switches which could be in either 'ON' or 'OFF' state.
  • A switch in 'ON' state is represented by '1' and 'OFF' state is represented by '0'.
  • Computer can only understand these binary digits called Bits (1s and 0s).
  • Hence, everything that needs to be processed by a computer has to be converted into Binary format.

(a) Describe what is meant by Character set:

  • A set of characters and symbols that can be represented by a computer system.
  • Each character and symbol is assigned a unique numerical value to represent it digitally in computers.

(b) Why do computers need a character set?

  • To store textual characters used by humans in computers.
  • To communicate and exchange text between different computer systems.

(a) How Text, Numbers and Symbols are stored in a computer:

  • Each character is assigned an internationally accepted numerical value called ASCII code or UNICODE.
  • These values are stored in binary format to represent each character in computer.

(b) Describe ASCII code and its use:

  • ASCII stands for American Standard Code for Information Interchange.
  • It is an internationally accepted 7-bit binary code (0 to 127 in denary or 00 to 7F in hexadecimal) to represent English alphabets, numbers and symbols found on a standard keyboard.
  • It could represent 128 possible characters including 32 control codes for control keys.
  • It provides the most common text file format like .txt and .html.
⚠ Note: Extended ASCII uses 8-bit code (0 to 255 in denary or 00 to FF in hexadecimal). It gives another 128 codes to allow for characters in non-English alphabets and for some graphical characters to be included.

(c) Describe UNICODE and its use:

  • UNICODE is a Universal Character encoding standard, designed to represent characters of all languages around the world.
  • It uses 16-bit or 32-bit binary code which could represent 216 or 232 possible characters.
  • It is more efficient character encoding system than ASCII, used to store text files, web-pages and other types of documents.
  • It contains reserved part of code for private use to enable a user to assign codes for their own characters and symbols.

(d) Difference between ASCII and UNICODE:

ASCII code UNICODE
Stands for American Standard Code for Information Interchange.Stands for Universal Character Encoding.
A character encoding standard for electronic communication, designed to represent English alphabets, numbers and symbols.A computing industry character encoding standard, designed to represent characters of all languages around the world.
Supports 128 characters.Supports a wide range of 216 to 232 possible characters.
Uses 7 bits to represent a character.Uses 16-bit or 32-bit depending on the encoding type.
Requires less space.Requires more space.

Representation of Images in computer

  • Bitmap image is made up of tiny dots arranged in rows and columns called Pixel.
  • A Pixel is the smallest addressable area of an image which is assigned a colour.
  • Each pixel can be represented as a binary number, and is stored in a series of binary codes.
  • A black and white image requires only one bit to represent a pixel, which could be either '1' for black or '0' for white colour.
  • An image with 256 colours requires 8 bits to represent each pixel.

(a) State what is meant by Pixel:

  • A Pixel is a Picture element.
  • It is the smallest addressable area of an image.
  • The basic unit used to define colour on a computer display or printed digital image.

(b) Describe pixel dimension of an image:

  • Pixel dimension refers to the total number of pixels along an image's width and height.
  • Example: 640 × 480.

(c) Describe resolution of an image:

  • Resolution refers to the density of pixels in an image.
  • The greater the density, the greater the image sharpness and clarity.
  • It is measured in pixels per inch (ppi) or dots per inch (dpi).

(d) Describe Colour Depth of an image:

  • Colour depth is the number of bits used to represent the colour of a single pixel of an image.
  • If an image contains 2N colours, then 'N' will give the colour depth.

(e) Bits per pixel for 256 colours:

256 = 2N = 28
∴ N = 8

Hence, colour depth is 8 (number of bits required to represent a pixel).

(a) Describe why image-A looks better than image-B:

  • The resolution of image-A is higher than image-B which contains fewer pixels to represent the image.
  • Image-A contains a large number of pixels, smaller in size and tightly packed, so it looks better.
  • Whereas image-B contains fewer pixels, larger in size and loosely packed, so it looks blurred or fuzzy or pixelated.

(b) How does increasing the image resolution affect the file size:

⇒ Increase in resolution means increase in number of pixels or the density of pixel. As the number of pixels used to represent the image is increased, the size of the file will also increase.

(c) Relationship between image quality and file size:

  • Image quality depends on the resolution of an image.
  • A higher resolution image has more pixels or more picture information.
  • Hence increase in quality of image increases the size of file.

(d) Two factors that affect the file size of a bitmap image:

  1. Image Resolution (or Pixel dimension): Increase in number of pixels, increases the file size.
  2. Bit depth (or Colour depth): Increase in number of bits to represent a pixel, increases the file size.

(a) Describe why the enlarged image-B appears blurred:

  • The resolution of image-B is decreased, because the number of pixels per inch (PPI) has decreased.
  • Less number of pixels is made to occupy more space, which increases the size of pixel to make it look blurred or fuzzy.

(b) Calculate the file size of image-A (250 × 400 pixels, 24-bit):

⇒ To find the size of an image file, you multiply the resolution of the image by the colour depth:

Size of image file (in bits)
= width (in pixels) × height (in pixels) × colour depth
= 250 × 400 × 24 bits
Size of image file (in bytes)
= (250 × 400 × 24) / 8 [since 1 byte = 8 bits]
Size of image file (in KB)
= (250 × 400 × 24) / (8 × 1024) [since 1 KB = 1024 bytes]
= 292.97 KB
(or ≈ 300 KB approximately)

(a) File size of 256-colour photo (50 × 50 pixels):

256 colour = 28 colour ⇒ N = 8 bits
Size of image file (in bits)
= Image resolution × colour depth
= 50 × 50 × 8 bits
Size of image file (in bytes)
= (50 × 50 × 8) / 8 [Divide by 8, since 1 byte = 8 bits]
= 2500 bytes
Size of image file (in KB)
= (50 × 50 × 8) / (8 × 1024) [since 1 KB = 1024 bytes]
= 2.44 KB
(or ≈ 2.5 KB approximately)

(b) File size if converted to Black and White:

Black and White means 2 colour = 21 colour ⇒ N = 1 bit
Size of image file (in bits)
= Image resolution × colour depth
= 50 × 50 × 1 bits
Size of image file (in bytes)
= (50 × 50 × 1) / 8 [Divide by 8, since 1 byte = 8 bits]
= 312.5 bytes

(a) Describe what is meant by Metadata:

  • Metadata is a set of data that provides information about the contents of the file (like file headers, its profile, technical details, and copyright).
  • It is embedded with the file in a way that can be understood by other software, hardware, and end users, regardless of the format.

(b) Four examples of metadata:

  1. File header — like title, subject, author, and creation date/time.
  2. File profile — like dimension, resolution, colour depth, etc.
  3. Technical details — like file types, size, and type of compression.
  4. Copyright information about the file or copyright holder.
  • A JPEG file is a bitmap image saved in a compressed graphic format standardized by the Joint Photographic Experts Group (JPEG).
  • It is commonly used for storing digital photos and used by most digital cameras to save images.
  • It supports up to 24-bit colour and is compressed using lossy compression.

★ Bitmap (or Raster) Image:

  • Bitmap image is made up of tiny dots arranged in rows and columns called Pixel.
  • It stores the details of each pixel, like its location, colour depth, etc. Hence, its size is much larger than Vector image.
  • When enlarged, it loses its quality due to increase in distance between the pixels (i.e. reduced resolution).

★ Vector Image:

  • Vector image uses geometrical formulas to represent shapes and images.
  • It stores the details of lines to be drawn from one node to another, hence its file size is much smaller than Bitmap image.
  • When enlarged, it does not lose its quality.

Representation of Sounds in computer

Analogue Signal:

  • Analogue signal is a continuous value that keeps on changing over a time period, like temperature, pressure, wall clock etc.
  • Analogue is a real value which cannot be read accurately.
  • It is represented by a sine wave.

Digital Signal:

  • Digital signal is a discrete fixed set of values like 1, 2, 3, 4, ... etc.
  • Digital is discrete in nature which can be read accurately, like digital clock, calculator etc.
  • It is represented by a square wave.
⚠ Note: Sound is in Analogue form, which is converted to Digital using an ADC (Analogue to Digital Converter) because computers don't understand Analogue. To play back, a DAC (Digital to Analogue Converter) converts the digital data back to analogue sound.

(a) Describe what is meant by Sampling:

  • Sampling is the process of recording the amplitude of sound digitally at a regular interval of time.
  • Each measurement is then saved in binary format, converting analogue signal to digital data.
  • Number of samples per second is called sample rate, measured in hertz (1 hertz equals 1 sample per second).
  • Higher sample rate means the samples will be closer together and will not miss the peaks and troughs of sound wave.

(b) Describe Sample rate, Sample resolution and Bit rate:

Term Definition
Sample RateNumber of samples of sound that are recorded per second to represent an audio performance. It is measured in Hz or kHz.
Sample resolutionNumber of bits needed to store each sample of sound. The higher the sample resolution, the better the quality of sound recording, because more levels of signal or sound details can be captured.
Bit rateNumber of bits that need to be processed every second. It is measured in kilobits per seconds (kbps).

(c) Explain how the quality of sound recording could be improved:

  • ⇒ The increase in Sample rate increases the sound quality, because the sound samples will be closer together and will not miss the peaks and troughs of sound wave.
  • ⇒ The higher the Sample resolution, the better the sound quality, because more levels of sound details can be captured.
⚠ Note: CDs have a 16-bit sampling resolution and a 44.1 kHz sample rate — that is 44100 samples every second. This gives high-quality sound reproduction.
Benefits Drawbacks
Provide more accurate mean values.Produces larger file size.
Better sound quality.Takes longer to transmit / download music files.
Less sound distortion (imperfect sound).Requires greater processing power.

Method: Size of sound file = Sample rate × Sound resolution × Time in seconds.

Size of sound file (in bits)
= Sample rate × Sound resolution × Time in seconds
= 1600 × 8 × 32 bits
Size of sound file (in bytes)
= (1600 × 8 × 32) / 8 [Divide by 8, since 1 byte = 8 bits]
= 512000 bytes
Size of sound file (in KB)
= (1600 × 8 × 32) / (8 × 1024) [since 1 KB = 1024 bytes]
= 500 KB

(a) Calculate the bit rate of the audio file:

Bit rate (in bps)
= Sample rate × Sound resolution × Channels
= 44100 × 16 × 2
= 1411200 bps
Bit rate (in kbps)
= (44100 × 16 × 2) / 1000 [since 1 kbps = 1000 bits/sec]
= 1411.2 kbps

(b) Calculate the file size of a 4-minute song in megabytes:

Size of sound file (in bits)
= Bit rate (bps) × Length of sound in seconds
= 1411200 × (4 × 60)
Size of sound file (in bytes)
= (1411200 × 4 × 60) / 8 [since 1 Byte = 8 bits]
= 42336000 bytes
Size of sound file (in MB)
= (1411200 × 4 × 60) / (8 × 1024 × 1024) [since 1 MB = 1024 × 1024 bytes]
= 40.37 MB
  • MP3 stands for MPEG (Motion Picture Experts Group) Layer-III.
  • It uses lossy compression to reduce the original sound by 90% without losing its quality; by eliminating the sounds which human ears cannot hear.
  • It is the most common audio file format that most digital players use.

Revision: Statements and its key computing terms

Statement / Definition Key Computing Term
A list of characters that have been defined by computer hardware and software. The character set is necessary so that the computer can understand human characters.Character set
A character set for all the characters on a standard keyboard and control codes.ASCII code
A character set which represents all the languages of the world (the first 128 characters are the same as ASCII code).Unicode
The term derived from 'picture element'; the smallest addressable area of an image; arranged in matrix of rows and columns to make up an image.Pixel
An image made up of pixels.Bitmap (or Raster) Image
The number of pixels in the X-Y direction of an image, for example, 4096 × 3192 pixels.Image resolution
The number of bits used to represent the colours of a pixel.Colour depth
The number of pixels per square inch.Pixel density
The number of bits used to represent sound amplitude in digital sound recording (also known as Bit depth).Sample resolution
The number of bits used to represent the smallest unit in a sound file.Bit depth
The number of sound samples taken per second in digital sound recording.Sampling rate
Number of bits that need to be processed every second. It is measured in kilobits per seconds.Bit Rate