0478 Computer Science
Chpater 1 Number System
1.1 Number systems
1.2 Text, sound and images
1.3 Data storage and compression
Chapter 2 Data transmission
2.1 Types and methods of data transmission
2.2 Methods of error detection
2.3 Encryption
Chapter 3 Hardware
3.1 Computer architecture
3.2 Input and output devices
3.3 Data storage
3.4 Network hardware
Chapter 4 Software
4.1 Types of software and interrupts
4.2 Types of programming language, translators and integrated development environments (IDEs)
Chapter 5 The internet and its uses
5.1 The internet and the World Wide Web (WWW)
5.2 Digital currency
5.3 Cyber security
Chapter 6 Automated and emerging technologies
6.1 Automated systems
6.2 Robotics
6.3 Artificial intelligence (AI)
Chapter 7 Algorithm design and problem solving
7.1 The program development life cycle
7.2 Computer systems, sub-systems anddecomposition
未命名
未命名
Chapter 8 Programming
8.1 Programming concepts
8.2 Arrays
Mr. Theo
-
+
首页
1.3 Data storage and compression
## Measurement of the Size of Computer Memories - A binary digit is referred to as a **BIT** - 8 bits is a **byte** - 4 bits is a **nibble** - Byte is used to measure memory size **IECB System (more commonly used):** | Name of memory size | No. of Bytes | Equivalent Denary Value | | ------------------- | -------------- | --------------------------- | | 1 kibibyte (1KB) | 2<sup>10</sup> | 1 024 bytes | | 1 mibibyte (1MB) | 2<sup>20</sup> | 1 048 576 bytes | | 1 gibibyte (1GB) | 2<sup>30</sup> | 1 073 741 824 bytes | | 1 tibibyte (1TB) | 2<sup>40</sup> | 1 099 511 627 776 bytes | | 1 pibibyte (1PB) | 2<sup>50</sup> | 1 125 899 906 842 624 bytes | **Conventional System:** | Name of memory size | No. of Bytes | Equivalent Denary Value | | ------------------- | --------------- | --------------------------- | | 1 kilobyte (1KB) | 10<sup>3</sup> | 1 000 bytes | | 1 megabyte (1MB) | 10<sup>6</sup> | 1 000 000 bytes | | 1 gigabyte (1GB) | 10<sup>9</sup> | 1 000 000 000 bytes | | 1 terabyte (1TB) | 10<sup>12</sup> | 1 000 000 000 000 bytes | | 1 petabyte (1PB) | 10<sup>15</sup> | 1 000 000 000 000 000 bytes | ### Calculation of File Size - The file size of an image is calculated as: image resolution (in pixels) × colour depth (in bits) - The size of a mono sound file is calculated as: sample rate (in Hz) × sample resolution (in bits) × length of sample (in seconds). `(For a stereo sound file, you would then multiply the result by two.)` ## File Types **Musical Instrument Digital Format (MIDI)** - Storage of music files - A communications protocol that allows electronic musical instruments to interact with each other - Stored as a series of demands but no actual music notes - Uses 8-bit serial transmission (asynchronous) - Each MIDI command has a sequence of bytes: - The first byte is the status byte – which informs the MIDI device what function to perform - Encoded in the status byte is the MIDI channel (operates on 16 different channels) - Examples of MIDI commands: - Note on/off: indicates that a key has been pressed - Key pressure: indicates how hard it has been pressed (loudness of music) - Needs a lot of memory storage **MP3** - Uses technology known as Audio Compression to convert music and other sounds into an MP3 file format - This compression reduces the normal file size by 90% - Done using file compression algorithms which use Perceptual Music Shaping - Removes sounds that the human ear cannot hear properly - Certain sounds are removed without affecting the quality too much - CD files are converted using File Compression Software - Use lossy format as the original file is lost following the compression algorithm **MP4** - This format allows the storage of multimedia files rather than just sound - Music, videos, photos and animations can be stored - Videos could be streamed without losing any real discernible quality **Joint Photographic Experts Group (JPEG)** - JPEG is a file format used to reduce photographic file sizes - Reducing picture resolution is changing the number of pixels per centimetre - When a photographic file undergoes compression, file size is reduced - JPEG will reduce the raw bitmap image by a factor between 5 and 15 ## Lossless and Lossy File Compression ### State what is meant by data compression - Reducing the file size ### Lossless File Compression - All the data bits from the original file are reconstructed when the file again is uncompressed - Important for files where the loss of data would be disastrous (spreadsheet) - An algorithm is used to compress data - No data is lost - Repeated patterns/text are grouped together in indexes ### Run-Length Encoding - It reduces the size of a string of adjacent, identical data (e.g. repeated colours in an image) - A repeating string is encoded into two values: the first value represents the number of identical data items (e.g. characters), and the second value represents the code of the data item (such as ASCII code if it is a keyboard character), e.g. ‘aaaaabbbbccddddd’ becomes “05 97 04 98 02 99 05 100” - RLE is only effective where there is a long run of repeated units/bits - One difficulty is that RLE compression isn't very good for strings like "cdcdcdcdcd". We use a flag to solve this; e.g. 255 can be made the flag. Now 255 will be put before every repeating value, e.g. our previous example becomes `255 05 97 255 04 98 255 02 99 255 05 100` where 255 now indicates that the next character/set of characters is approaching #### How lossless compression compresses the text file - A compression algorithm is used such as RLE/run length encoding - Repeating words/characters/phrases are identified and indexed - … with number of occurrences - … with their position ### Lossy File Compression - A compression algorithm is used - Data will be lost/deleted permanently // original file cannot be recreated * Reduce the range of colours used / colour depth / bits per pixel * Reduce the number of pixels / image resolution removes data that will not be noticed by the user #### Describe how lossy compression reduces the size of the sound file - A compression algorithm is used Discards any unnecessary sounds ... - ... using perceptual musical shaping - .... such as removing background noise / sounds humans can't hear // or other suitable example Reduces sample size / resolution // by example - Reduces sample rate // by example - Sound is clipped - The data is permanently removed ##### Why use Compression - To save storage space - To make it quicker to transmit - To make it small enough to attach to an email - To reduce the bandwidth needed to transmit - Reduces the size of the file - Takes up less storage space - Quicker to transmit to device - Less buffering #### Explain why the musician would choose to use lossless compression instead of lossy compression. - They want to be able to edit the original sound file - They want the sound to be closest to the original recording - ... using lossy would reduce the sound quality - ... using lossy will permanently remove some of the data
Theo
2025年9月15日 08:22
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
Word文件
PDF文档
PDF文档(打印)
分享
链接
类型
密码
更新密码
有效期