KEMBAR78
Data Representation | PDF | Character Encoding | Pixel
0% found this document useful (0 votes)
6 views9 pages

Data Representation

Uploaded by

rithika.school30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

Data Representation

Uploaded by

rithika.school30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

IGCSE Computer Science

0478

Digitized Notes
1.2 Text, Sound, and Images

Character Sets

What is a character set?

• A character set is all the characters and symbols that can be represented by a computer system

• Each character is given a unique binary code

• Character sets are ordered logically, the code for ‘B’ is one more than the code for ‘A’

• A character set provides a standard for computers to communicate and send/receive


information

• Without a character set, one system might interpret 01000001 differently from another

• The number of characters that can be represented is determined by the number of bits used by
the character set

• Two common character sets are:

o American Standard Code for Information Interchange (ASCII)

o Universal Character Encoding (UNICODE)

ASCII

What is ASCII?

• ASCII is a character set and was an accepted standard for information interchange

• ASCII uses 7 bits, providing 27 unique codes (128) or a maximum of 128 characters it can
represent

• ASCII only represents basic characters needed for English, limiting its use for other languages

Extended ASCII

• Extended ASCII uses 8 bits, providing 256 unique codes (28 = 256) or a maximum of 256
characters it can represent

• Extended ASCII provides essential characters such as mathematical operators and more recent
symbols such as ©

Limitations of ASCII & extended ASCII

• ASCII has a limited number of characters which means it can only represent the English
alphabet, numbers and some special characters

o A, B, C, ………, Z
o a, b, c ,.............,z

o 0, 1, 2,........, 9

o !, @, #, …..

• ASCII cannot represent characters from languages other than English

• ASCII does not include modern symbols or emojis common in today's digital communication

UNICODE

What is UNICODE?

• UNICODE is a character set and was created as a solution to the limitations of ASCII

• UNICODE uses a minimum of 16 bits, providing 216 unique codes (65,536) or a minimum
of 65,536 characters it can represent

• UNICODE can represent characters from all the major languages around the world
1. Representing Text

• How and Why Computers Represent Text:


o Computers store and process text as numbers. Each character is assigned a unique
numeric code using a character set.
o Character sets standardize the representation of text, ensuring consistent encoding
and decoding.
• Character Sets:
1. ASCII (American Standard Code for Information Interchange):
▪ Uses 7 or 8 bits per character.
▪ Supports 128 or 256 characters (including English letters, numbers, and
symbols).
▪ Example: 'A' = 65, 'a' = 97 in ASCII.
2. Unicode:
▪ Designed to support a wider range of characters from multiple languages
and scripts.
▪ Uses 16 bits or more, allowing for over a million unique codes.
▪ Ensures compatibility and representation of text in diverse languages (e.g.,
Chinese, Arabic).

2. Representing Sound

• How and Why Computers Represent Sound:


o Computers convert sound (analog) into digital data through a process called
sampling.
o Sound is represented as a series of binary numbers that describe the sound wave.

Representation of sound
Soundwaves are vibrations in the air. The human ear senses these vibrations and interprets them as
sound. Each sound wave has a frequency, wavelength and amplitude. The amplitude specifies the
loudness of the sound.
Sound waves vary continuously. This means that sound is analogue. Computers cannot work with
analogue data, so sound waves need to be sampled in order to be stored in a computer. Sampling means
measuring the amplitude of the sound wave. This is done using an analogue to digital converter (ADC).
To convert the analogue data to digital, the sound waves are sampled at regular time intervals. The
amplitude of the sound cannot be measured precisely, so approximate values are stored.

Conversion of Analogue Sound into Digital Format:


• Sound waves are analogue values, these analogue values are converted into
digital values to manipulate and to store in computer.
• ADC (Analogue to Digital Converter) is used to convert analogue sound waves
into digital values.
This conversion is done in following steps.
1. Firstly, a filter removes non-audible sound waves. Humans can hear sounds in a
frequency range from about 20 Hz to 20 kHz.
2. Then sound waves are sampled at a given time rate (Sound waves are broken
down thousands of smaller parts (samples) per second.)
3. The height/amplitude of each sound wave is determined.
4. Approximation is used when necessary.
5. At last sound wave values are stored in binary digits, depending upon number of
bits per sample.

Sampling rate is the number of sound samples taken per second. This is measured in hertz (Hz),
where 1 Hz means ‘one sample per second’.
So how is sampling used to record a sound clip?

• the amplitude of the sound wave is first determined at set time intervals (the sampling
rate)
• this gives an approximate representation of the sound wave
• each sample of the sound wave is then encoded as a series of binary digits.

Using a higher sampling rate or larger resolution will result in a more faithful representation of
the original sound source. However, the higher the sampling rate and/or sampling resolution,
the greater the file size.

The benefits and drawbacks of using a larger sampling resolution when


recording sound

Note
Representation of Sound Files
Sampling: A sound wave is broken down into smaller pieces at a regular interval of time. These smaller
pieces are known as Sample and this process is known as Sampling. In sampling amplitude of sound
wave is taken at different intervals of time.

Sampling resolution – number of bits used to represent sound amplitude (also known as bit depth).

Sampling rate – number of sound samples taken per second.

Factors Affecting Sound Representation:

1. Sample rate
The sample rate is how many samples, or measurements, of the sound are taken each
second. The more samples that are taken, the more detail about where the waves rise
and fall is recorded and the higher the quality of the audio. Also, the shape of the sound
wave is captured more accurately. Each sample represents the amplitude of the digital
signal at a specific point in time.

2. Bit depth/Sampling Resolution


Bit depth is the number of bits available for each sample. The higher the bit depth, the
higher the quality of the audio. Bit depth is usually 16 bits on a CD and 24 bits on a
DVD. A bit depth of 16 has a resolution of 65,536 possible values (ranging from 0 to
65,535), and a bit depth of 24 has over 16 million possible values (ranging from 0 to
16,777, 216).

3. Bit rate
The bit rate of a file tells us how many bits of data are processed every second. Bit
rates are usually measured in kilobits per second (kbps). A common audio sample rate
for music is 44,100 samples per second.
Representing Images

Representation of (bitmap) images


Bitmap images are made up of pixels (picture elements); an image is made up of
a two-dimensional matrix of pixels. Pixels can take different shapes such as:

Each pixel can be represented as a binary number, and so a bitmap image is


stored in a computer as a series of binary numbers, so that:
• a black and white image only requires 1 bit per pixel – this means that each pixel
can be one of two colours, corresponding to either 1 or 0
• if each pixel is represented by 2 bits, then each pixel can be one of four colours
(22 = 4), corresponding to 00, 01, 10, or 11
• if each pixel is represented by 3 bits then each pixel can be one of eight colours
(23 = 8), corresponding to 000, 001, 010, 011, 100, 101, 110, 111. The number of
bits used to represent each colour is called the colour depth. An 8 bit colour
depth means that each pixel can be one of 256 colours (because 28 = 256).
Modern computers have a 24 bit colour depth, which means over 16 million
different colours can be represented With x pixels, 2x colours can be represented
as a generalisation. Increasing colour depth also increases the size of the file
when storing an image.

Image resolution refers to the number of pixels that make up an image; for example, an
image could contain 4096 × 3072 pixels (12 582 912 pixels in total). The resolution can
be varied on many cameras before taking, for example, a digital photograph.
Photographs with a lower resolution have less detail than those with a higher resolution.
Bit-map image – system that uses pixels to make up an image.
Pixel – smallest picture element that makes up an image.
Bit depth – number of bits used to represent the smallest unit in, for example, a sound
or image file – the larger the bit depth, the better the quality of the sound or colour
image.
Colour depth – number of colours available in a pixel, e.g. 8 bit depth has colour depth
of 256 (28 = 256).
Image resolution – number of pixels that make up an image, for example, an image
could contain 4096 ×3192 pixels (12 738 656 pixels in total).
Screen resolution – number of horizontal and vertical pixels that make up a screen
display. If the screen resolution is smaller than the image resolution, the whole image
cannot be shown on the screen, or the original image will become lower quality.
Resolution – number of pixels per column and per row on a monitor or television
screen.
Pixel density – number of pixels per square centimetre.

Vector graphics – images that use 2D points to describe lines and curves and their
properties that are grouped to form geometric shapes. The images that are made up of
small picture elements (pixels) are called bitmap image.

How images are stored in computer:


• The images are stored in computer as bitmaps
• Each image is made up of tiny elements known as Pixel (Picture Element)
• Each pixel is of a single colour. The number of available colours in a pixel is known
as Colour Depth.
• The Colour depth of the image is determined by Bit Depth i.e. number of bits per
pixel
• The image quality is also determined by Pixel Density i.e. number of pixels per inch.
• The total number of pixels in an image is known as Image Resolution.
• The values of each pixel of the image is stored in binary numbers.

You might also like