Ch. 1 — Data Representation
1.1 Number Systems 1.2 Text, Sound & Images 1.3 Data Storage & Compression
Ch. 2 — Data Transmission
2.1 Data Transmission 2.2 Error Checking 2.3 Encryption
Ch. 3 — Hardware
3.1 Computer Architecture 3.2 Input & Output Devices 3.3 Data Storage 3.4 Network Hardware
Ch. 4 — Software
4.1 Types of Software & Interrupts 4.2 Programming Languages & IDE
Ch. 5 — The Internet
5.1 Internet & World Wide Web 5.2 Digital Currency 5.3 Cyber Security
Ch. 6 — Emerging Tech
6.1 Automated Systems 6.2 Robotics 6.3 Artificial Intelligence
// All Chapters
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Home/ Paper 1/ 1.3 Data Storage & Compression
1.3

1.3 Data Storage & Compression

How computers store and compress data.

Data is measured in the following units

  • Bit
  • Nibble
  • Byte (1 byte = 2 nibbles)
  • Kibibyte
  • Mebibyte
  • Gibibyte
  • Tebibyte
  • Pebibyte
  • Exbibyte

Calculating File Sizes

  • Calculating the size of an image file: resolution × colour depth (answer is in bits)
  • Calculating the size of a sound file: sample rate (Hz) × sample resolution × length (seconds)

What is Compression?

  • The reduction of FILE size

Why should we compress a file?

  • Less bandwidth will be required
  • Less storage will be required on the device
  • Shorter transmission time (less time to download/upload)
  • To make it small enough to attach to an email

Difference between Lossy and Lossless Compression

  • Lossy compression is permanent, lossless can be recovered to its original form
  • Lossy compression reduces the file size more than lossless compression

When to use Lossless or Lossy Compression?

Lossless

  • Used when file quality is more important than file size
  • Used when file needs to be recoverable to original form (eg. text file or source code)

Why would a musician choose to compress a file with lossless?

  • They want to be able to edit the original sound file
  • They want the highest sound quality for the 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 // no data will be permanently removed with lossless

Lossy

  • Used when file size is more important than quality
  • Considerably smaller file size than lossless, quality may be adequate
  • Used for streaming as transmission of smaller files is faster
Explain why lossy compression is not suitable for compressing a text file

Data will be permanently removed

…and that could be important/necessary data

Lossy is not suitable for text files

…as it will damage/corrupt the file

Lossless Compression of Files

How is a text file compressed with lossless?

  • Compression algorithm is used
  • …such as RLE (run length encoding)
  • Repeating words/characters/phrases are identified
  • …and indexed
  • …with the number of occurrences
  • …with their position

How is a video file compressed with lossless?

  • Compression algorithm is used
  • …such as RLE (run length encoding)
  • Repeating frames/pixels are identified
  • …and indexed
  • It records the changes between frames/pixels
  • No data is permanently removed

How is a sound file compressed with lossless?

  • Compression algorithm is used
  • …such as RLE
  • Repeating patterns in the music are identified (or repeated sounds/notes)
  • …and indexed
  • No data is permanently removed

How is an image file compressed with lossless?

  • Compression algorithm is used
  • …such as RLE
  • Repeating colours are identified
  • …and indexed
  • …with the number of occurrences
  • No data is permanently removed

Lossy Compression of Files

Video file

  • Compression algorithm is used
  • Reduce colour depth
  • Reduce image resolution
  • Reduce frame rate

Image file

  • Compression algorithm is used
  • Reduce colour depth
  • Reduce image resolution
  • Data is permanently removed

Sound file

  • Compression algorithm is used
  • Reduce sampling rate
  • Reduce sound resolution
  • Data is permanently removed