Chapter 1, Part 3
Chapter 1, Part 3
Representation of Sound
Used 3 denary digit as code
‘A’ represents as
binary :
01000001 128 64 32 16 8 4 2 1
‘A’ represents as 0 1 0 0 0 0 0 1
denary number:
65
Character Set- ASCII code and Unicode
ASCII code (American Standard Code for Information Interchange)
The ASCII code consisted of 7 bits and so 128 characters could be represented.
All of the lower and upper case English characters, punctuation marks and control
actions (backspace, shift an so on) were represented.
ASCII code
Table
0 to 32 control
Action
Character Set- ASCII code and Unicode
Extended ASCII code
Extended ASCII uses eight bits, giving a character set of 256 characters.
This allows for special characters such as © ě and those with accents in languages
such as French and Spanish.
To overcome the problem of ASCII code, the Unicode was founded to develop and
promote a Unicode system
Unicode uses 16 bits or 32 bits per character, so it can represent characters from
languages from all around the world.
As it is larger than ASCII, it might take up more storage space when saving
documents.
The txt file contains 200 characters and use 7 bits to represent each
characters. Calculate the txt file size in bit and byte.
= 200* 7
= 1400 bits
= 1400 bits / 8
= 175 bytes
Representation of Image
Representation of Bitmap Image
The bitmap image are made up of pixels
An image is made up of two dimension matrix of pixels
Each pixel is represented as a binary number and so a bit map image is stored in a
computer as a series of binary number
Pixels
Short for picture
element, the
smallest single point
of color in an image
Representation of Bitmap Image
The number of different colors that can be decided by the number of bits used to encode
color.
Binary representation of bitmap
For example image
if 1 bits is used for each pixel 1 1 0 1 1 0 1 1
1 1 0 1 1 0 1 1
21 = 2 (two color) Black and white 1 1 0 1 1 0 1 1
1 1 0 1 1 0 1 1
0 Black 1 1 0 0 0 0 1 1
1 White
1 1 0 0 0 0 1 1
1 1 0 1 1 0 1 1
1 1 0 1 1 0 1 1
1 1 0 1 1 0 1 1
Representation of Bitmap Image
Many images need to use colors.
To add color, more bits are required for each pixel.
Color depth
The number of bits used to represent/encode the
color of each pixel is called color depth.
• There are 256 variations of each primary colors( RGB) and that give 16 millions different
color.
True Color
True color is the specification of the color of a pixel using a 24 bit value for
the RGB color which allows the possibility of 16 million colors.
Representation of Bitmap Image
Image size and resolution
Image size is usually written as two number , for example 100 * 66 , 4288 * 2824
The first number indicates the number of pixels along the width of the image and the second
number is the number in the height.
Resolution
The number of pixel
per inch when the
image is displayed
= 921600 byte
Representation of Bitmap Image
Example
Create expressions and calculate the file size of the following images
Express the sizes in bits and bytes
(b ) A 256 color image with a size of 640 * 480 pixels
= 307200 byte
Representation of Bitmap Image
Exercise
Create expressions and calculate the file size of the following images
Express the sizes in bits and bytes
(a) A photograph is 1024 * 1080 pixels and use a color depth of 32 bit
(b) The image with 2048 * 2048 pixel and use a color depth of 4 bit
(c) A 32 color image with a size of 240 * 480
Representation of Bitmap Image
What is metadata of image?
• Files contain extra data called metadata. Metadata includes data about the
file itself, such as:
file type
date created
Author
The height and width of the image
Resolution
Color depth
• Without this metadata, the image data would not be correctly displayed.
Exercise
• An image is 2322 pixels high and 4128 pixels wide. The image is stored with a 16-bit colour depth.
The metadata for the image is 975 bytes. Construct an expression to show how the file size, in
bytes, is calculated.
File size = File size of image + The metadata of image
Digital Recording
Computer cannot work with
analogue so the sound wave need
to be sampled in order to be stored
in computer.
Sampling means measuring the
amplitude of the sound at regular
time interval.
Benefits
The sampling are done by Analogue Equipment to record and process digital sound is
to Digital converter (ADC) to convert relatively cheap and has allowed people to record
analogue to digital. music at home
1 2 3 4 5 6 7 8 9 10
Sample (denary) 8 3 7 6 9 7 2 6 6 6
Sample (Binary) 1000 0011 0111 0110 1001 0111 0010 0110 0110 0110
File size of digital audio file = sample rate(Hz) * bit depth * duration(in seconds ) * number of channels
Representation of Sound
What is the file size of a stereo recording of three minutes duration with a sample rate of
44100 and a bit depth of 24 bits? Give your answer in bit and bytes
Number of channels = 2
Duration = 3 min and 35 s
= (3*60)+35
Duration = 3 min = 3* 60 = 180
4 kHZ per second chage Hz
Sample rate per second = 44100 per second = 4000 hz per
second
Bit Depth = 24 bit
= (44.1*1000) * 16 * (2*60)* 1 /8
better sound quality or
Larger file size
3 bits
1. Explain the term image resolution
2. The software developer is using 16-colour bitmap image.How many bits would be used
to encode data for one pixel of his image
3. The image is 512 pixel wide and 382 pixel height. He decide 256 color bitmap image.
Calculate the file size in byte.