190 likes | 334 Views
Session 4. Teaching Computing to KS3. Topics today. Processing sound and images Kodu Next week – no session (half-term) After half-term – we start Python programming. Images. Images are created and stored as: bit-mapped graphics vector-based graphics. CS Inside activity.
E N D
Session 4 Teaching Computing to KS3
Topics today Processing sound and images Kodu Next week – no session (half-term) After half-term – we start Python programming
Images • Images are created and stored as: • bit-mapped graphics • vector-based graphics
Bit-mapped graphics • Binary patterns are used to store graphics. • In a bit-mapped system the image is divided up into a grid. • Each cell in the grid is called a PIXEL (picture element). • A pixel is the smallest addressable area or smallest solid block of colour of an image.
Zoom in Resolution The resolution of an image or screen is expressed as the number of pixels by row by the number of pixels per column. For example, an image with a resolution of 1024 by 798 pixels has 1024 798 pixels (817,152 pixels)
Colour Depth The number of bits used to represent the colour of a single pixel in a bitmapped image. 1-bit colour A black and white image is known as a monochrome image. One bit is allocated to each pixel. This means that we can only have TWO colours. The colours will be allocated to 0 or 1e.g. 0 for whiteand 1 forblack
Colour Depth 2-bit colour If 2 bits are used for each pixel then four colours can be stored for example: 00 - White 01 - Blue 10 - Red 11 - Black
What is sound? • Sound is energy that travels through the air (or any other medium other than a vacuum) as a pattern of changing (air) pressure. • Sound is an air pressure wave that is sensed by our ears.
Digitisation http://www.morethanyouthink.com/entertainment/digitisation.html
Temperature/°C 30 20 10 0 1 2 3 4 5 6 7 8 9 10 11 12 Time/h Analogue and Digital Data • Analogue data • Data that varies in a continuous manner • Digital data • Data that takes the form of discrete values
Analogue to Digital Conversion • Analogue signals representing text, speech, images, or measurements must be converted into binary digital signals for storage, processing or transmission in a digital network • This process of conversion of analogue signals to digital ones is called Analogue to Digital Conversion or digitisation • An analogue to digital convertor is a hardware device which converts an analogue signal into an equivalent digital signal
Voltage Analogue signal Time Voltage 15 14 Signal samples 13 12 11 10 9 8 7 6 6 5 4 3 2 1 0 Time Quantised samples (rounded down) Binary codes forming digital signal Analogue to Digital Conversion 8 14 14 9 8 11 12 10 4 2 1 0 2 9 15 1000 1110 1110 1001 1000 1011 1100 1010 0100 0010 0001 0000 0010 1001 1111
When you sample the wave with an analogue-to-digital converter, you have control over two variables: The SAMPLING RATEControls how many samples are taken per second The SAMPLING RESOLUTION (PRECISION)Controls how many different gradations (quantization levels) are possible when taking the sample WORKSHEET Digital Data
Saving sound in files • There are several formats for storing digitised sound, e.g. Wav, MPEG. • WAV is used when storing audio on a CD • MPEG has extensions .mp3 and .mp4 amongst others • MPEG is a compression algorithm which is based on psychoacoustic modelling that removes frequencies the brain and ear will not miss. • One minute of CD audio can be cut down from 2.5mb as a WAV to 0.25mb as an MP3 file
MP3 sound files Using a bit rate of 128 Kbps usually results in a sound quality equivalent to what you'd hear on the radio. Many music sites and blogs urge people to use a bit rate of 160 Kbps or higher if they want the MP3 file to have the same sound quality as a CD.
Royal Institution lectures http://www.rigb.org/christmaslectures08/
Audacity Similar activity to the one before • Record a sound in Audacity • Compress it with different frequencies • Compare the resultant sound
Summary Images and sound need to be represented in a way that they can be understood by the computer Images can be stored as bitmaps or vector files The smallest unit of a bitmap is a pixel Sound waves are converted from analogue to digital to be stored in the computer The sampling rate and resolution used affect the size of the file and the quality Compression methods can be used to make files smaller