0% found this document useful (0 votes)
9 views

Chapter 1 Textimagesound

Uploaded by

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

Chapter 1 Textimagesound

Uploaded by

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

Text, Sound and Image

TEXT SOUND IMAGE


REPRESENTATION REPRESENTATION REPRESENTATION

Usage of Sampling Colour


the ASCII Resolution Depths and
Code and and Sample Image
Unicode Rate Resolution
TEXT
REPRESENTATION

1.Every character entered into a computer must be represented


by binary code, including spaces and punctuation marks.
2.A character set is a list of characters defined by computer
hardware and software, enabling the computer to understand
human characters.
3.Examples of character sets include:
a. ASCII (American Standard Code for Information Interchange)
b. Extended ASCII
c. Unicode
ASCII

1.ASCII CODE USES SEVEN BINARY BITS TO REPRESENT ALL


THE COMMONLY USED CHARACTERS.
2.THIS PROVIDES A CHARACTER SET THAT HAS 128 DIFFERENT
CHARACTERS, MADE UP OF
a. 26 UPPER CASE LETTERS
b. 26 LOWER CASE LETTERS
c. DIGIT
d. PUNCTUATION MARKS
EXTENDED ASCII

1.Extended ASCII was created to allow 256 characters to be


represented. This gives another 128 codes to allow for
characters in non-English alphabets and for some graphical
characters to be included.
Using the ASCII table,
help me to decode this
(00100000 = SPACE)

01001001 00100000
01101100 01101001
01101011 01100101
00100000 01001101
01100011 01000100
UNICODE

1.COMPUTERS BEGAN TO BE PROGRAMMED USING UNICODE TO


REPRESENT TEXT.
2.UNICODE USES 16-BITS TO REPRESENT THE CHARACTERS IN ITS
SET, WHICH ENABLES OVER 65000 CHARACTERS.
SOUND
REPRESENTATION
1.Sound can also be represented by binary.
2.For a computer to process sound, the analog signal input must
be converted into a digital format.
3.A microphone captures the sound, and software converts the
analog signal to digital.
4.This digital recording is called a sample.
SOUND
REPRESENTATION

HOW IS SAMPLING USED TO RECORD A SOUND CLIP


1.The amplitude of the sound wave is measured at specific
time intervals, providing an approximate representation of
the sound wave.
2.Each sample is then encoded as a series of binary digits.
Low
Frequency
Wave

High
Frequency
Wave
SOUND
REPRESENTATION

Sampling resolution =
Sampling resolution =
416
3 15
8 14
13
7 12
11
6 10
9
amplitude 5 amplitude 8
7
4 6

3 5
4
2 3
2
1 1

1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

time time

DEFINITIO
SAMPLING RESOLUTION: THE NUMBER N:
OF BITS USED TO REPRESENT SOUND
AMPLITUDE IN DIGITAL SOUND RECORDING, ALSO KNOWN AS BIT DEPTH
SOUND
REPRESENTATION

1.Recording software can take multiple


samples every second. This is measured in
Hertz (Hz), where 1 Hz equals one sample
per second.

DEFINITIO
SAMPLE RATE: THE NUMBERN:
OF SOUND SAMPLES TAKEN
PER SECOND.
SOUND
REPRESENTATION

What are the Pros and Cons of using a higher sampling


rate or larger resolution
Benefits Drawback
s
Enhanced sound quality Bigger file size

Less sound distortion Need more time to


download / upload music
Greater dynamic range
IMAGE
REPRESENTATION
1.A bitmap essentially represents a collection of bits that, when
displayed on a monitor, forms a specific image.
2.An image consists of a grid of pixels arranged in two
dimensions.
3.Each pixel is stored in a computer as a sequence of binary
numbers.
IMAGE
REPRESENTATION

1.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.

0 0
1 1
IMAGE
REPRESENTATION

1.IF EACH PIXEL IS REPRESENTED BY TWO BITS, THEN


EACH PIXEL CAN BE ONE OF FOUR COLOURS
(00,01,10,11)

0 0
0
1 1
IMAGE
REPRESENTATION

1.IF EACH PIXEL IS REPRESENTED BY THREE BITS, THEN


EACH PIXEL CAN BE ONE OF EIGHT COLOURS
(000,001,010,011,100,101,110,111)

00 00 01
0 1 0
011 100 101

110 111
DEFINITION:
COLOUR DEPTH: THE NUMBER OF BITS USED TO REPRESENT
EACH COLOUR
IMAGE
REPRESENTATION

ONE BIT - 2 COLOUR (0,1)


TWO BIT - 4 COLOUR (00,01,10,11)
THREE BIT - 8 COLOUR (000,001,010,011,100,101,110,111)

EIGHT BIT - ?

TOTAL NUMBER OF COLOURS: 2 ^(NUMBER OF BITS)

MOST MODERN COMPUTERS HAVE A 24 BIT COLOUR DEPTHS,


WHICH MEANS OVER 16MILLION DIFFERENT COLOURS CAN BE
USED.
IMAGE
REPRESENTATION

DEFINITIO
N:
IMAGE RESOLUTION: THE NUMBER OF PIXELS THAT MAKE UP
AN IMAGE/

PHOTOGRAPHS WITH A LOWER RESOLUTION HAVE LESS DETAIL


THAN THOSE
WITH A HIGHER RESOLUTION.
IMAGE
REPRESENTATION

100x10 600x60
0 0
IMAGE
REPRESENTATION

What are the Cons of using a higher resolution image

1.Increase in file size (this occurs when the number of


pixel increases.
2.Greater the size, the longer it is needed to download
the image.
3.A certain amount of reduction in resolution of an
image is possible before the loss of quality become
noticeable/
Chapter 1.7

Measurement of
Data Storage and
Calculation of file
size
Measurement
of Data
Storage

• A bit is the basic unit of all computing


memory storage terms and is either 1 or
0.
• The byte is the smallest unit of memory
in a computer.

8 bits = 1 byte
4 bits = 1 nibble
Memory
Size
System
Converting Bytes into KiB, MiB and GiB

68719476736 Bytes
= 68719476736 Bytes / 1024 = 67108864
= 67108864 KiB / 1024 =
KiB65536 MiB
= 65536 MiB / 1024 = 64 GiB
Memory
Size
System
Converting Gib, Mib, Kib into bytes

64 GiB
= 64 x 1024 = 65536 MiB
= 65536 x 1024 = 67108864 KiB
= 67108864 x 1024 = 68719476736 Bytes
DIY

Convert the size of GTA-V to bytes

72 GiB
= 72 x 1024 = 73728 MiB
= 65536 x 1024 = 75497472 KiB
= 75497472 x 1024 = 77309411328 Bytes
Calculation
of file
size

Ima Aud
ge io
Calculation
of file
size - Image

Image Resolution - The number


of pixels that make up an
image.
The higher the image resolution,
the higher the quality of the
image.
Calculation
of file
size - Image

Formula

image resolution (pixels) x colour


depths (bits)
Calculation Example 1
of file
size - Image

2px

2px
00 0
1 1
Total pixels = 2 x 2 Colour depth
=4
0
=2 1
Calculation = (2x2)
x2 = 8 bits = 1 byte
Calculation Example 2
of file
size - Image
Formula : image resolution (pixels) x colour
depths (bits)
Question:
Image Resolution = 1024 x 1080
Colour depth = 32

Calculate the size of this image in Bytes.


Workings:

1024 x 1080 = 1105920 pixels


1105920 x 32 = 35389440 bits
Answer in byte: 35389440/8 = 4423680
Calculation Example 2
of file
size - Image
Question:
Image Resolution = 1024 x 1080
Colour depth = 32

Calculate the size of this image in Bytes. How many


photograph of this size would fit onto a memory
stick of 64Gib.
Each image = 4423680
First convert 64 Gib
bytes
into
64 xbytes:
1024 = 65536
65536 xMiB
1024 = 67108864
67108864
KiB x 1024 = 68719476736
bytes
Calculation Example 2
of file
size - Image
Question:
Image Resolution = 1024 x 1080
Colour depth = 32

Calculate the size of this image in Bytes. How many


photograph of this size would fit onto a memory
Each image = 4423680
stick of 64Gib.
First convert 64 Gib into bytes =
bytes
68719476736 bytes
68719476736/4423680 = 15534 photos.
DI
Y
Question:
Image Resolution = 2048 x 2048
Colour depth = 16

Calculate the size of this image in Bytes.


DANSWE
R
Question:
Image Resolution = 2048 x 2048
Colour depth = 16

Calculate the size of this image in Bytes.


Answer:

2048 x 2048 x 16 = 67108864 bits


= 67108864/8
= 8388608 bytes
DIY
Question:
Image Resolution = 2048 x 2048
Colour depth = 16

Calculate the size of this image in Bytes (Answer:


8388608 bytes).
What is the size of the image in MiB.
DANSWE
Question:
R
Image Resolution = 2048 x 2048
Colour depth = 16

Calculate the size of this image in Bytes (Answer:


8388608 bytes).
What is the/ size
8388608 1024 of=
the image
8192 KiBin MiB.
8192 / 1024 = 8 MiB
Calculation Formula
of file
size - Sound

Sample Rate (in Hz) x Sample Resolution (in bits) x length of sample
(in seconds)
Calculation
of file
size - Sound

Mono Sound vs Stereo


Sound
Comparison
Calculation Example 1 - Mono Sound
of file
size - Sound
Question:
Sample Rate: 44100
Sample Resolution: 8 bits
Length of the music: 20 seconds

Calculate the size of the audio in KiB.


44100 x 8 x 20 = 7056000 bits
7056000/8 = 882000 bytes
882000 / 1024 = 861.328 KiB
Calculation
of file
Example 1 - Stereo
size - Sound
Sound

An audio CD has a sample rate of 44100 and a sample


resolution of 16 bits. The music being sampled uses two
channels to allow for stereo recording. Calculate the file size
for a 60-minute recording.
44100 x 16 x 3600 = 2540160000 bits
2540160000 x 2 = 5080320000 bits
5080320000 / 8 = 635040000 bytes

635040000 / 1024 = 620156.25 KiB

620156.25 / 1024 = 605.62 MiB


DI
Y
An audio CD has a sample rate of 44100 and a sample
resolution of 8 bits. The music being sampled uses two
channels to allow for stereo recording. Calculate the file size
for a 25-minute recording.
DI
Y
An audio CD has a sample rate of 44100 and a sample
resolution of 8 bits. The music being sampled uses two
channels to allow for stereo recording. Calculate the file size
for a 25-minute44100
recording in MiB.
x 8 x 1500 = 529200000 bits
529200000 x 2 = 1058400000 bits
1058400000 / 8 = 132300000 bytes

132300000 / 1024 = 129199.218 KiB

129199.218 / 1024 = 126.17 MiB


PA S T Y E A R Q U E S T I O N
ANSWER
DATA
C OM P R E SS I O N
DATA
COMPRESSION
DATA
COMPRESSION
1.FILE SIZE OF IMAGES AND SOUND CAN BE
VERY LARGE.
2.THEREFORE, DATA COMPRESSION IS
NEEDED TO REDUCE THE SIZE OF A FILE.
WHAT ARE SOME BENEFITS OF
REDUCING THE FILE SIZE?
REDUCE
STREAMIN
G TIME REDUCE
COST

SAVE
STORAGE REDUCE
SPACE TIME
TAKEN TO
UPLOAD
AND
DOWNLOA
D MEDIA
LOSSY LOSSLESS
FILE FILE
COMPRESS COMPRESS
ION ION
LOSSY FILE
COMPRESSI
ON

1. FILE COMPRESSION ALGORITHM ELIMINATES


UNNECESSARY DATAS FROM THE FILE.
2.ORIGINAL FILE CANNOT BE RECONSTRUCTED
ONCE IT HAS BEEN COMPRESSED.
3.IMAGE - REDUCE THE RESOLUTION // COLOUR
DEPTH
4.SOUND - REDUCE THE SAMPLING RATE //
SAMPLING RESOLUTION
5.SOME LOSSY FILE COMPRESSION ALGORITHMS
ARE:
MPEG-3 MPEG-4 JPEG
LOSSY FILE
COMPRESSI
ON
A COMPRESSION TECHNOLOGY
THAT REDUCES THE SIZE OF A
NORMAL MUSIC FILE BY ABOUT
90%.

MPEG-3 1.REMOVE
SOUNDS
OUTSIDE THE
HUMAN EAR
RANGE
2.ELIMINATE
THE SOFTER
SOUND -
PERCEPTUAL
MUSIC
SHAPING
LOSSY FILE
COMPRESSI
ON ALLOWS STORAGE OF
MULTIMEDIA FILES RATHER THAN
JUST SOUND.

MPEG-4 MOVIES CAN


BE
STREAMED
USING THE
MP4 FORMAT
WITHOUT
LOSING ANY
REAL
DISCERNIBLE
QUALITY
LOSSY FILE
COMPRESSI
ON
A LOSSY COMPRESSION
ALGORITHM USED FOR BITMAP
IMAGES. ORIGINAL FILE CAN NO
LONGER BE CONSTRUCTED.

JPEG
REMOVE
COLOUR
SHADES
(HUMAN
CAN'T
NOTICE
THEM)
DATA
COMPRESSI
ON

1.ALL THE DATA FROM THE


ORIGINAL UNCOMPRESSED
FILE CAN BE RECONSTRUCTED
2.THIS IS IMPORTANT FOR FILES
LOSSLESS WHERE LOSS OF DATA WOULD
FILE BE DISASTROUS (COMPLEX
COMPRESSI SPREADSHEET).
3.LOSSLESS FILE COMPRESSION
ON IS DESIGNED SO THAT NONE
OF THE ORIGNAL DETAIL FROM
THE FILE IS LOST.
LOSSLESS FILE
COMPRESSION

1.CAN BE USED FOR LOSSLESS COMPRESSION OF


A NUMBER OF DIFFERENT FILE FORMATS.
RUN-
LENGTH 2. IT REDUCES THE SIZE OF A STRING OF
ENCODIN
G ADJACENT, IDENTICAL DATA.

3. A REPEATED STRING IS ENCODED INTO TWO


VALUES.

NUMBER DATA ITEM


OF
IDENTICAL
DATA
LOSSLESS FILE
COMPRESSION
RUN-
LENGTH
ENCODIN
G
IN
ACTION

s s s s r r r r k k k j j j j j

16
bytes
LOSSLESS FILE
COMPRESSION
Does not work well when there is RUN-
no repeated data! LENGTH
ENCODIN
G
IN
ACTION

s s s s r r r r k k k j j j j j

4 S 4 R 3 k 5 j

Each digit - 1 byte


Total size = 8 bytes (50% reduction in size)
LOSSLESS FILE
COMPRESSION
A compression method that encodes repeated byte values by
specifying their count and value. Eg. It works well with a bitmap file.

Before RLE

10101101 10101101 10101101


10101101
10111101 10111101 10111101
10101101 10101101 10101101 10101101 10111101
10101100 10101100 10101100
10101100
10111101 10111101 10111101 10111101
After RLE
10101100 10101100 10101100 10101100
10101101 00000100
(4)
10111101 00000100
(4)
10101100 00000100
(4)
PA S T Y E A R Q U E S T I O N
ANSWER
PA S T Y E A R Q U E S T I O N
ANSWER

You might also like