Text, Audio, images representation and compression O Level & IGCSE Computer Science by Inqilab Patel
Автор: CompSci
Загружено: 2021-08-01
Просмотров: 458
Описание:
Representation of Text and Numbers in Computer
Text and numbers can be represented in computer as patterns of binary digits. To represent each character (letter, digit or symbol) a character set is used. Character set is a set of characters can be understood by computer.
ASCII and Unicode are important character sets that are used as standard.
ASCII (American Standard Code for Information Interchange)
The ASCII character set is a 7-bit set of codes that allows 128 different characters. That is enough for every upper-case letter, lower-case letter, digit and punctuation mark on most keyboards. ASCII is only used for the English language.
This table shows some examples of letters represented using the ASCII character set:
How to capture a sound:
To record a sound microphone is used.
Microphone has a diaphragm. When sound waves strike it, causes vibration in it. Electrical circuits produce electrical signals due to this vibration. And in this way sound is captured.
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.
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.
File Compression
Compression is a useful tool for reducing file sizes. When images, sounds or videos are compressed, data is removed to reduce the file size.
Image File Compression
Images are all around us, from application icons to animated GIFs to photos. Image files can take up a lot of space, so computers employ a range of algorithms to compress image files.
Lossy File Compression for Images
For lossy file compression of image file following steps are taken:
A lossy file compression algorithm is used
Bit Depth (bits per pixel) is reduced resulting in reduction in colour depth (number of available colour) as well as file size (lesser number of bits lesser file size)
Pixel density (pixel per inch) is decreased resulting decrease in image resolution it too reduce file size (lesser pixel lesser bits means lesser file size).
Reducing bit depth and pixel density reduces the file size but the removed data cannot be put back so original image cannot be recreated.
Lossless File Compression of Images
One of the simplest examples of lossless compression is RLE. To perform lossless compression of image following steps are taken:
A lossless file compression algorithm RLE is used
Consecutive pattern on images are identified.
Consecutive identical values converted into a code consisting of the image pattern and the number marking the length of the run.
The more similar values there are, the more values can be compressed.
The sequence of data is stored as a single value and count.
For example a Here's a simple image, a 16x11 black cup saucer icon with white background.
Advantage of File Compression
Compressed file occupies lesser storage space
Compressed file occupies lesser space in memory
File can be uploaded and download quickly
Lesser internet data is used in transmission of compressed file.
This is very helpful when streaming and downloading files.
Streamed music and downloadable files, such as MP3s, are usually between 128 kbps and 320 kbps - much lower than the 1,411 kbps of an uncompressed file.
Videos are also compressed when they are streamed over a network. Streaming HD video requires a high-speed internet connection. Without it, the user would experience buffering and regular drops in quality. HD video is usually around 3 mbps. SD is around 1,500 kbps.
Lossy and lossless compression
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: