crossing the boundary analogue universe, digital world

58
Crossing the Boundary Analogue Universe, Digital World Unit Three : M150 : AOU By : Mais M. Fatayer

Upload: aquene

Post on 05-Jan-2016

39 views

Category:

Documents


5 download

DESCRIPTION

Crossing the Boundary Analogue Universe, Digital World. Unit Three : M150 : AOU By : Mais M. Fatayer. 1. Introduction. In this unit, we will discuss the way computers represent and handle data. Crossing boundary concept Analogue vs digital Conversion from Analogue world to digital - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Crossing the Boundary Analogue Universe, Digital World

Crossing the BoundaryAnalogue Universe, Digital World

Unit Three : M150 : AOU

By : Mais M. Fatayer

Page 2: Crossing the Boundary Analogue Universe, Digital World

1. Introduction

In this unit, we will discuss the way computers represent and handle data. Crossing boundary concept Analogue vs digital Conversion from Analogue world to digital Ways of data representation and data

manipulation

Page 3: Crossing the Boundary Analogue Universe, Digital World

2. The Worlds We Live InComputers in our world The computer’s job is to acquire , store,

present, control, exchange and manipulate interesting characteristic of the natural world..

Can you think of examples for the above jobs?

Page 4: Crossing the Boundary Analogue Universe, Digital World

Crossing the Boundary

As you know , the world we inhabit and live in is different from the computers world.

We live in Analogue world, but the world of computers is Digital

The previous jobs of the computers need to be moved from the analogue world to the digital world, in other words Crossing the Boundary between the two different territories.

Page 5: Crossing the Boundary Analogue Universe, Digital World

The price to cross the boundary.. The price of using computers must be paid. Not just the money costs, but some problems

like: Quality Privacy, liberty and security Its just a representation of the real world

Page 6: Crossing the Boundary Analogue Universe, Digital World

3. Analogue Information:Digital Representation So what is Analogue?

Analogue quantities are ones that change continuously.

Example: temperature is analogue quantity , where you can find infinite number of temperatures between any two points on the thermometer scale

Another Example:Sound , the intensity of sound goes higher or lower smoothly as you turn the volume control

Page 7: Crossing the Boundary Analogue Universe, Digital World

SAQ 3.2 (page 14)

Name two other analogue quantities ? Brightness of light Color intensity Pitch Pressure Heat

Page 8: Crossing the Boundary Analogue Universe, Digital World

Enhancing the perceptual system Human has five senses , and by use of

computer systems we can improve these senses

Example: Microscopes Telescopes Radar X-rays Hearing aids

Page 9: Crossing the Boundary Analogue Universe, Digital World

Discrete Things

What is discrete ? In contrast to analogue quantities, which change

continuously , discrete quantities change in a series of clear steps

Example: Digital thermometer which has window and you can read

temperature in decimal places Discrete volume control, where you can hear the volume

increases if steps That means, we can treat analogue quantities as if they are

discrete, where sometimes it suites the situation For example , it does not make a big difference if the

thermometer measured you temperature 38.56556767 or 38.56556766 , you still have fever.

Page 10: Crossing the Boundary Analogue Universe, Digital World

Discrete Things cont.

But some quantities are strictly discrete and can not be analogue , can you give an example?

Number of students in class Number of credit cards you have Number of cars in the garage

Page 11: Crossing the Boundary Analogue Universe, Digital World

Digital = Discrete

You have to understand the computer story is based on numbers!

Lets see how computer deals with numbers. But first , lets discuss the number system we are using, then we will go to the number system in the computers world

Page 12: Crossing the Boundary Analogue Universe, Digital World

Decimal System

We deal with the decimal system in our daily life

This system has infinity of numbers But all these numbers are composed of finite

set of digits. Decimal system set={0,1,2,3,4,5,6,7,8,9} 10 digits. Any number can be composed of this finite

set

Page 13: Crossing the Boundary Analogue Universe, Digital World

Decimal System cont.

Lets see it in examples 10 is represented as one group of ten plus zero 37 is represented as three groups of ten (thirty)

plus seven 345 is represented as three groups of one

hundred (three hundred) plus four groups of 4 ( forty) plus five

As you see from the examples above, we added new columns to the left to represent larger numbers

Also notice that each new column is ten times bigger than the group immediately to its right

Page 14: Crossing the Boundary Analogue Universe, Digital World

Decimal System cont.

From the examples, we can produce the following pattern that will help us to generate any decimal number

Page 15: Crossing the Boundary Analogue Universe, Digital World

How computers work with numbers In contrast to our decimal system (denary)

computers deal with Binary system Binary system , as our digital system, has set

of elements to compose its numbers Binary system set={0,1} Any number in binary system can be

composed of this finite set.

Page 16: Crossing the Boundary Analogue Universe, Digital World

How computers work with numbers cont.

Again, lets see it in examples: 0, represents zero in decimal 1, represents one in decimal ………… how to do 2,3,4,5,…???? We are run

out of digits!! Lets follow the same strategy of decimal system

and add new column to the left

Page 17: Crossing the Boundary Analogue Universe, Digital World

How computers work with numbers cont.

We can have digits to count as far as one, so our new column must count groups of two 1 10 added new column to the left, because we

needed to represent next digit (0,1,2) So three can be represented as

11 group of two plus one Now how do we represent four?

Page 18: Crossing the Boundary Analogue Universe, Digital World

How computers work with numbers cont.

From the examples, we can produce the following pattern that will help us to generate any binary number

Page 19: Crossing the Boundary Analogue Universe, Digital World

Group work

Solve exercise 3.5 page 22

Page 20: Crossing the Boundary Analogue Universe, Digital World

More terms you need to know Bit (binary digit) refers to 0 or 1 stored in

computer memory Byte, group of 8 bits Word, 4 bytes Hard disk capacity is measured in bytes. Like

Kilobytes = 1024 ByteMegabytes = 10242 bytesGigabytes = 10243 bytes

Page 21: Crossing the Boundary Analogue Universe, Digital World

4. Crossing the Boundary

Computer world is a simple world Word processors enable us to enter text into

computer and format that text ,display it on monitor in front of us, and may be print it

But , when text inside the computer boundary , it should have the binary representation

Then how text can be represented inside the computer into numbers?

Page 22: Crossing the Boundary Analogue Universe, Digital World

Crossing the Boundary cont.

The computer assigns a unique number for each letter in the alphabet , so each letter becomes a number inside the computer

Page 23: Crossing the Boundary Analogue Universe, Digital World

Characters not only Letters

What other characters need to be represented? What about ?,!,#,$,%,^,&,*….. What about

We need to include these characters in the character set the computer uses to represent characters( to cross that boundary)

This takes us to a need to have a Standard set of all characters a computer can represent

Page 24: Crossing the Boundary Analogue Universe, Digital World

ASCII Code and Unicode

ASCII set aside 128 numbers, from 0 to 127, for upper and lower-case alphabetic characters, punctuation marks and some ‘invisible’ characters, such as a carriage return (start a new line) and a tab.

Unicode, certified in 1987, preserves the ASCII numbers, but hugely expands the set of numbers available to 65,536.

Page 25: Crossing the Boundary Analogue Universe, Digital World

Graphics and Video

How images can cross the digital boundary? In other words, how images can be represented in the digital world of computers?

Page 26: Crossing the Boundary Analogue Universe, Digital World

Graphics and Video cont.

(a) (b)

Page 27: Crossing the Boundary Analogue Universe, Digital World

Graphics and Video cont.

The artist in painting (a) used all color intensities so you can visualize that light is smooth and analogue

In (b) the artist used the head of his brush to draw the painting as dots, disconnected and discrete

Page 28: Crossing the Boundary Analogue Universe, Digital World

Simpler example

Let’s try a simple example. Let’s take an image, divide it into discrete parts and then transform the result into numbers.

Page 29: Crossing the Boundary Analogue Universe, Digital World

Simpler Example cont.

First :place a border around the picture, to indicate the area we are interested in. Anything outside the border will not be part of the work.

Page 30: Crossing the Boundary Analogue Universe, Digital World

Next , divide the picture up by laying down a grid of equal-sized squares over it,

Simpler Example cont.

Page 31: Crossing the Boundary Analogue Universe, Digital World

Now examine each square of our image. If it contains just the background colour (light grey, in this case) just fill the square

with white. If it contains any other image colour (mauve), then colour it

black. Looking at the grid, you can see that some squares contain

both background and image colour. In such cases colour a square black if roughly a third or more of it is image colour, white otherwise.

Page 32: Crossing the Boundary Analogue Universe, Digital World

Let’s take the final step. For each square on the image, I assign the number 0 to it if it is coloured white and 1 if it is coloured black.

this is called mapping the square’s colour to a number. And gives the following pattern:

Page 33: Crossing the Boundary Analogue Universe, Digital World

Since each number is only either 0 or 1, and computers use bits to store 0s and 1s, this sort of encoding is usually referred to as a bitmap.

Each square that we have mapped to a 0 or a 1 is called a pixel (short for picture element).

Page 34: Crossing the Boundary Analogue Universe, Digital World

SAQ 4.5

What do you think could be done to improve the quality of the image?

One obvious way is to increase the number of squares and to make each square smaller.

Page 35: Crossing the Boundary Analogue Universe, Digital World

Suppose we double the number of the gridlines in each direction, This is called increasing the resolution of the picture. we can get an image like this

Page 36: Crossing the Boundary Analogue Universe, Digital World

Mapping each square in previous image will result:

More and more resolution will reach better appearance of an image each time

Page 37: Crossing the Boundary Analogue Universe, Digital World

Work in Groups

Work out how many bits would be needed to store (62 pixels wide by 44 pixels high) image. How many bytes?

Page 38: Crossing the Boundary Analogue Universe, Digital World

Colored Images

Why is the simple strategy used above not satisfactory for colored images?

The most obvious point is that we have as yet no way of handling colour.The plain black and white won’t allow us to represent intensities of light and shade.

Page 39: Crossing the Boundary Analogue Universe, Digital World

Colored Images cont.

In our previous example, we dedicated one bit to each pixel in our image. All we need to do now is devote more bits to each pixel to accommodate a greater range of shades.

Let’s allocate two bits per pixel with binary 11 representing black and binary 00 standing for white.

Page 40: Crossing the Boundary Analogue Universe, Digital World

Colored Images cont.

How many shades can we represent using two bits per pixel?

Counting black as 11 and white as 00, we can have two shades of grey in between - 01 (light grey) and 10 (dark grey). So, four shades in all.

What about using more bits per pixel.?

Page 41: Crossing the Boundary Analogue Universe, Digital World

Colored Images cont.

This mapping of shades of grey between black and white in a black and white bitmap is known as grayscale.

The range of numbers to which a pixel can be mapped is termed the pixel amplitude

Page 42: Crossing the Boundary Analogue Universe, Digital World

6 shades needed to represent this picture.

Picture of aircraft divided into pixels A grayscale image of the aircraft

Page 43: Crossing the Boundary Analogue Universe, Digital World

More Colored Images

Color is an example of an analogue property. We are trying to map infinite number of colors to a finite number Colors are represented in a different way. Any color can be made out of a mixture of three basic shades

Red, Green and Blue (R, G, B). RGB model Each shade is represented by a byte (8 bits), giving values

ranging from 0 to 255. As a total we have 256 x 256 x 256 shades of color (16,777,216)

Red is (255, 0, 0) since it is all Red and 0 Green and 0 Blue.

Green is (0, 255, 255). Blue is (0, 0, 255). White is (255, 255, 255), all the color spectrum. Black is (0, 0, 0), no color what so ever.

Page 44: Crossing the Boundary Analogue Universe, Digital World

More Colored Images cont.

When dealing with images, sometimes large amounts of memory are required

Two Important model RGB model

The primary are colors red, green and blue CMYK model (other model)

The primary colors that are reflected off paper are not red, green and blue – but cyan (blue-green), magenta and yellow.

The K stands for a special black ink used to add crispness.

Page 45: Crossing the Boundary Analogue Universe, Digital World

Interlude – diagrams

Some types of visual information can be represented more economically than in a bitmap (less waste of memory).

The huge majority of the pixels will just be white, the background to the picture. The only information all these white pixels give us is the simple fact that the background color is white

To reconstruct the diagram we need information about what sort of object it is (line, square), the size, the position and the color of them

Shapes, line thickness, coordinates, all have their numerical representations in a computer.

Page 46: Crossing the Boundary Analogue Universe, Digital World

Interlude – diagrams cont.

First: assign a number to each type of object (rectangle, circle, arrow, line and the text)

Second: record the size and position (Cartesian coordinates – x, y axes) of each object

Third: Identify the color Finally: put all information together and

produce a final set of numbers

Page 47: Crossing the Boundary Analogue Universe, Digital World

example A circle is defined by its radius and the coordinates

of its center. A rectangle by the coordinates of its upper left and

lower right corners. Lines and arrows by their starting and ending points. The text area by the coordinates of its top left corner

x

y

o

Page 48: Crossing the Boundary Analogue Universe, Digital World

Example cont.

Vector graphics: The way (sort) of encoding of visual information Opposed to the bitmap approach (raster graphics) Very compact form of encoding The resulting image is scalable: we can easily shrink or

stretch the size of it without any loss of information. Works with fairly simple images

Drawing packages: the programs that allow us to draw and display vector graphics, like Adobe Illustrator

Painting packages: the systems for constructing and displaying raster graphics (bitmap) , like Adobe Photoshop

Page 49: Crossing the Boundary Analogue Universe, Digital World

Image format

Several formats exist for image digitizing, depending on the allowed loss of precision (ex: bmp, jpg, gif, etc…)

Page 50: Crossing the Boundary Analogue Universe, Digital World

Making Image Move

Making image move A Video or a movie, is a series of images that slightly

differ one from another, passing them one after the other at a certain speed will give the illusion of movement.

A picture would be called a frame.

The speed of flipping the frames one after the other is called frame rate (fps).

Transferring such an enormous amount of digital information over a network would be slow.

Page 51: Crossing the Boundary Analogue Universe, Digital World

Making Image Move cont.

We have to find some way of reducing the amount of storage that moving images. The vector graphics approach will not work for complex image, so we must look for a way of compressing bitmapped visual information

There are many standards for image and film compression. Standards for image compression:

JPEG (Joint Photographic Experts Group) GIF (Graphics Interchange Format) standards. (Both standards reduce the number of bits used to store

each pixel) For video, the dominant standard is MPEG (Moving Picture

Experts Group), which is now used in most digital camcorders.

Page 52: Crossing the Boundary Analogue Universe, Digital World

Sound and music

Hearing is the second most relied on sense for a human being (another analogue feature of the world).

A sound consists of a waveform How sound waves can be represented in computer?

The best way into the problem is to consider in a little more detail what sound is. Probably the purest sound you can make is by vibrating a tuning fork. As the prongs of the fork vibrate backwards and forwards, particles of air move in sympathy with them. One way to visualize this movement is to draw a graph of how far an air particle moves backwards and forwards (we call this its displacement) as time passes.

Page 53: Crossing the Boundary Analogue Universe, Digital World

Sound and music cont.

Displacement of air particles over time by vibrating a tuning fork

Page 54: Crossing the Boundary Analogue Universe, Digital World

Sound and music cont.

Displacement: how far an air moves backwards and forwards

Cycle: represent the time between adjacent peaks Frequency: the number of

cycles completed in a fixed time Amplitude: maximum displacement

(how loud the sound is)

Page 55: Crossing the Boundary Analogue Universe, Digital World

Sound to Numbers!! E.x. 4.7 page 48

Write down a few ideas about how we might go about transforming a waveform into numbers. It might help to think back to the methods we used for encoding images

Answer: We have to find some way to split up the waveform. We split up images by dividing them into very small spaces (pixels). We can split a sound wave up by dividing it into very small time intervals.

Page 56: Crossing the Boundary Analogue Universe, Digital World

Sampling

Sampling every 0.5 second

Improve the sampling process bySampling every 0.1 second

Page 57: Crossing the Boundary Analogue Universe, Digital World

Quantization SAQ 4.13 page 50

Now we’ve sampled the waveform, what do we need to do next to encode the image?

Remember that after we had divided an image into pixels, we then mapped each pixel to a number. We need to carry out the same process in the case of the waveform.

This mapping of samples (or pixels) to numbers is known as quantization.

sound wave samples are generally mapped to 16-bit numbers.

Page 58: Crossing the Boundary Analogue Universe, Digital World

Thank you