File Size Factors & Compression (SQA National 5 Computing Science): Revision Note
Exam code: X816 75
Sampling rate
How is sound sampled & stored?
Measurements of the original sound wave are captured and stored as binary on secondary storage
Sound waves begin as analogue and for a computer system to understand them they must be converted into a digital form
This process is called Analogue to Digital conversion (A2D)
The process begins by measuring the amplitude of the analogue sound wave at a point in time
Each measurement (sample) generates a value which can be represented in binary and stored
Using the samples, a computer is able to create a digital version of the original analogue wave
The digital wave is stored on secondary storage and can be played back at any time by reversing the process

In this example, the grey line represents the digital wave that has been created by taking samples of the original analogue wave
In order for the digital wave to look more like the analogue wave the sampling rate can be changed
What is sampling rate?
Sampling rate is the number of samples taken each second from an analogue sound wave
Measured in Hertz (Hz), where 1 Hz = 1 sample per second
A higher sampling rate produces better sound quality because the digital recording is closer to the original analogue wave
However, higher sampling rates increase file size because more data is stored per second
Common examples:
Telephone audio: 8 kHz
CD audio: 44.1 kHz
DVD audio: 48 kHz

In this example you can see that the higher the sampling rate, the closer to the original sound wave the digital version looks
Need for compression
What is compression?
Compression is reducing the size of a file so that it takes up less space on secondary storage
The impact of compression is:
Less storage space required
Less bandwidth required
Shorter transmission time
Compression can be achieved using two methods, lossy and lossless
What is lossy compression?
Lossy compression is when data is lost in order to reduce the size on secondary storage
Lossy compression is irreversible
Lossy can greatly reduce the size of a file but at the expense of losing quality
Lossy is only suitable for data where reducing quality is acceptable, for example images, video and sound
In photographs, lossy compression will try to group similar colours together, reducing the amount of colours in the image without compromising the overall quality of the image

In the images above, lossy compression is applied to a photograph and dramatically reduces the file size
Data has been removed and the overall quality has been reduced, however it is acceptable as it is difficult to visually see a difference
Lossy compressed photographs take up less storage space which means you can store more and they are quicker to share across a network
What is lossless compression?
Lossless compression is when data is encoded in order to reduce the size on secondary storage
Lossless compression is reversible, the file can be returned to its original state
Lossless can reduce the size of a file but not as dramatically as lossy
Lossless can be used on all data but is more suitable for data where a loss in quality is unacceptable, for example documents
Lossless file formats

In the image above, lossless compression is automatically applied to document formats such as DOCX and PDF with a different rate of success
When you open a lossless compressed document the decompression process reverses the algorithms and returns the data back to its original state
Lossless compressed documents take up less storage space which means you can store more and they are quicker to share across a network
Worked Example
Scenario: The Wildlife Sanctuary Website
A wildlife sanctuary is updating its website and uploading new media content. They must ensure the website loads quickly and efficiently for users.
State why the size of the image file must be reduced before it is uploaded, referencing the impact on the website or the user
[1]
Answer
To ensure the web page will
Load faster/download quickly OR not load too slowly [1 mark]
Unlock more, it's free!
Was this revision note helpful?