CSwithZain
WhatsApp Join a class

AS Level 9618 · Paper 1 · 1.2

Multimedia

How images and sound are stored as data, and what changes their size and quality. Read the notes, try the past-paper questions, then check the mark scheme.

Past papers from June 2021 to June 202630 questions · 142 marks

    In this subtopic

    • How a bitmap image is encoded, and working out its file size
    • What changing the resolution or colour depth does
    • How a vector graphic is encoded, and when to use bitmap or vector
    • How sound is sampled, and what the sampling rate and resolution change

    1.2 · 1 of 17Book pages Contents

    Bitmap images and pixels

    A bitmapped graphic (also called a bitmap image) is made up of a grid of pixels. A pixel (short for "picture element") is the smallest element in an image, and it is one single colour. If you magnify a bitmap image, you can see that it is made up of these tiny squares.

    All data in a computer is stored as 1s and 0s, so each colour is given its own binary code. This black-and-grey image needs only two colours, so it can be stored using just one bit per pixel: a 0 for each black pixel and a 1 for each grey pixel.

    A 10 by 10 grid of pixels showing a smiling face. Every grey pixel holds the bit 1 and every black pixel holds the bit 0.
    Two colours: one bit per pixel

    In a photo taken with a digital camera, each pixel stores the colour that was detected by one part of the camera’s sensor.

    Any image that needs only two colours can be stored with one bit per pixel. This image has been made by giving a 0 to each orange pixel and a 1 to each pink pixel:

    A grid of pink and orange pixels, 11 wide and 10 high, forming a cat’s face. Each orange pixel holds 0 and each pink pixel holds 1.
    0 = orange, 1 = pink
    BinaryColour
    0Orange
    1Pink

    How the data for a bitmap image is encoded

    • The image is made of pixels, and each pixel is one colour.
    • Each colour has its own unique binary code.
    • The binary code for the colour of each pixel is stored in sequence, pixel by pixel.

    1.2 · 2 of 17Book pages Contents

    Colour depth

    If an image needs more than two colours, it needs more bits per pixel. With 2 bits there are 2 × 2 = 4 different bit patterns, so four different colours can be shown. Each bit pattern is given a colour:

    BinaryColour
    00Black
    01White
    10Blue
    11Red

    Using 3 bits gives more colours, because there are more bit patterns: 2 × 2 × 2 = 8 colours, as in this image.

    A pixel picture of two cherries on a stalk with leaves, next to a key of eight colours: black 000, light green 001, dark green 010, light brown 011, dark brown 100, red 101, pink 110 and white 111.
    Three bits per pixel give 8 colours

    The number of bits used for each pixel is called the colour depth (or bit depth). Instead of writing 2 × 2 × 2 = 8 colours, you can use a power: 23 = 8 colours. So with n bits per pixel, 2n different colours can be shown.

    Bits per pixelNumber of colours
    121 = 2
    222 = 4
    323 = 8
    424 = 16
    828 = 256
    24224 = 16 777 216 (about 16.7 million)

    The greater the colour depth, the more colours are available for the image. To find the smallest colour depth for an image, count its colours and find the smallest power of 2 that is at least that number. For example, an image with five colours needs 3 bits, because 22 = 4 is too few and 23 = 8 is enough.

    1.2 · 3 of 17Book pages Contents

    Image resolution

    Image resolution is about how clear an image is on a screen or on paper. When you zoom in to a bitmap image, its pixels are stretched into larger blocks. That is why a bitmap image looks poor when it is enlarged too much. In the pictures below, A has the most pixels and E has the fewest.

    Five copies of the same photo of a red car’s wheel, labelled A to E. A is sharp; each copy after it has fewer pixels, so E is blocky and blurred.
    The same image at five resolutions, from A (most pixels) to E (fewest)

    Image resolution can be given as the number of pixels the image has per inch, for example 300 ppi (pixels per inch). In this course, image resolution usually means the size of a bitmap image in pixels: the number of pixels wide by the number of pixels high, for example 1920 × 1080. The total number of pixels is the width (in pixels) multiplied by the height (in pixels).

    1.2 · 4 of 17Book page Contents

    Screen resolution

    Image resolution should not be confused with screen resolution (or display resolution). Screen resolution is the number of pixels that a screen is set to display, given as the width of the screen in pixels by its height in pixels, for example 1920 × 1080. Screens with a large number of pixels (1280 × 720 and above) are called "high definition", because they show images and video more clearly.

    If you view an image with a low resolution (for example 300 × 240 pixels) full screen on a screen with a higher resolution (for example 1280 × 720 pixels), the computer has to rescale the image to fit the screen, and the image looks pixelated.

    Image resolution compared with screen resolution

    • Image resolution is the number of pixels wide by the number of pixels high that make up the image.
    • Screen resolution is the number of pixels wide by the number of pixels high that a screen can display.
    • If the screen resolution is lower than the image resolution, the image is shown with less detail. Image resolution can be changed, but a screen has a fixed physical limit.
    • Changing the screen resolution does not change the size of the image file.

    Note One mark scheme has also accepted "screen resolution" as the term for the dots per inch (dpi) when an image is displayed.

    1.2 · 5 of 17Book pages Contents

    Calculating the file size of a bitmap image

    To estimate the size of an image file, multiply the number of pixels by the colour depth:

    file size in bits =
       width × height × colour depth

    Here the width and height are in pixels and the colour depth is in bits per pixel.

    So the file gets bigger if either the colour depth or the image resolution goes up.

    Worked example

    An image is 8 pixels wide and 8 pixels high, with a colour depth of 4 bits. Calculate its size.

    1. Step 1
      Calculate the total number of bits: 8 × 8 × 4 = 256 bits.

    As the number of bits grows, it makes sense to use bigger units: 1 byte (B) = 8 bits (b), 1 kilobyte (kB) = 1 000 bytes and 1 megabyte (MB) = 1 000 kilobytes.

    Worked example

    An image is 240 pixels wide and 300 pixels high, with a colour depth of 4 bits. Calculate its size in kilobytes.

    1. Step 1
      Calculate the total number of bits: 240 × 300 × 4 = 288 000 bits.
    2. Step 2
      Change bits into bytes: 288 000 / 8 = 36 000 bytes.
    3. Step 3
      Change bytes into kilobytes: 36 000 / 1 000 = 36 kB.

    Worked example

    An image is 1920 pixels wide and 1080 pixels high, with a colour depth of 24 bits. Calculate its size in megabytes.

    1. Step 1
      Calculate the total number of bits: 1920 × 1080 × 24 = 49 766 400 bits.
    2. Step 2
      Change bits into bytes: 49 766 400 / 8 = 6 220 800 bytes.
    3. Step 3
      Change bytes into kilobytes: 6 220 800 / 1 000 = 6220.8 kB.
    4. Step 4
      Change kilobytes into megabytes: 6220.8 / 1 000 = 6.2208 MB, about 6.2 MB.

    Exam questions often ask for the answer in kibibytes (KiB) or mebibytes (MiB) instead. Then divide by 1024 at each step instead of 1 000: 1 KiB = 1024 bytes and 1 MiB = 1024 KiB.

    Worked example (binary units)

    A bitmap image is 2048 pixels wide and 1536 pixels high, with a colour depth of 24 bits. Estimate its file size in mebibytes.

    1. Step 1
      Calculate the total number of bits: 2048 × 1536 × 24 = 75 497 472 bits.
    2. Step 2
      Change bits into bytes: 75 497 472 / 8 = 9 437 184 bytes.
    3. Step 3
      Change bytes into kibibytes: 9 437 184 / 1024 = 9216 KiB.
    4. Step 4
      Change kibibytes into mebibytes: 9216 / 1024 = 9 MiB.

    Note This only estimates the size. The real file is a little bigger, because it also stores the file header.

    Practise this: past-paper questions

    Show 7 more

    1.2 · 6 of 17Book pages Contents

    Effects of changing resolution and colour depth

    The picture on the left has a colour depth of 24 bits and the one on the right has a colour depth of 8 bits. Which one looks worse?

    Two halves of a photo of the Eiffel Tower at sunset. The left half, in 24-bit colour, has smooth colours. The right half, in 8-bit colour, has a speckled sky and rough colours.
    Left: 24-bit colour (about 16.7 million colours). Right: 8-bit colour (256 colours).

    The 8-bit image can only show 256 different colours, but the 24-bit image can show about 16.7 million. Humans can see far more than 256 colours, so the 8-bit image looks poorer.

    The file size of an image depends on its colour depth. These four copies of the same picture show how much the file size grows as the colour depth goes up:

    Four strips of the same photo of a hot-air balloon: 24-bit colour, 8-bit colour, 8-bit greyscale and 1-bit black and white. The 1-bit strip is rough and grainy.
    The same picture at four colour depths
    Colour depthColoursFile size
    24-bit colourabout 16.7 millionabout 70 KB
    8-bit colour25623.4 KB
    8-bit greyscale256 shades of grey23.4 KB
    1-bit black and white22.9 KB

    Colour depth and image quality. In real life we can see a huge range of colours, so the more colours a bitmap image uses, the closer it looks to reality. But not every image needs a high colour depth. Some images are not meant to look like real life, and even for real-life images a lower colour depth is not always noticeable. Finding a suitable colour depth is often a matter of trial and error.

    Colour depth and file size. The main reason for reducing the colour depth is to make the file smaller. The more bits used for each colour, the more storage space the image needs. Smaller image files download more quickly on a web page and take less time to send by email.

    Effects of changing a bitmap image

    • Higher image resolution: more pixels, so the image is more detailed, sharper and less pixelated, but the file is bigger because more pixels are stored.
    • Lower image resolution: fewer pixels, so detail is lost, but the file is smaller.
    • Higher colour depth: more bits per pixel, so a greater range of colours and a more realistic image, but a bigger file.
    • Lower colour depth: fewer bits per pixel, so fewer colours, the image is less like the original, but the file is smaller.
    • Changing the colour of a shape, or the screen resolution, does not change the file size.

    1.2 · 7 of 17Book page Contents

    Metadata and the file header

    The real size of an uncompressed bitmap file is always greater than the simple file size calculation. As well as the pixel data, the file must store extra information so that the image can be shown correctly. This extra data is called metadata, which means data about data. Examples of metadata are:

    • the image dimensions (width and height in pixels)
    • the colour depth
    • the file format (file type)
    • the type of compression used
    • the date and time it was created
    • where it was created
    • details of the device that created it
    • camera settings

    The metadata must be in a fixed position in the image file, so that any software that displays or uses the image can find and read it. It is usually at the start of the file, in an area called the file header.

    One way to organise image metadata is the Exif (exchangeable image file format) standard, which has a wide range of metadata tags, such as detailed camera settings and the time and date.

    File header

    • Stores data about the image file (metadata), for example the file type, file size, image dimensions, colour depth and compression type.
    • It is why the actual file size is larger than the estimate from width × height × colour depth.

    1.2 · 8 of 17Book pages Contents

    Bitmap file formats and how bitmaps are made

    Common file formats for bitmap images are:

    • Bitmap: the file extension is .bmp
    • PNG (Portable Network Graphic): the file extension is .png
    • JPEG (Joint Photographic Experts Group): the file extension is .jpg or .jpeg
    • GIF (Graphics Interchange Format): the file extension is .gif

    Bitmap images are most often made by taking a photo with a digital camera or a phone camera. The image is stored as a grid of pixels, where each pixel is a digital record of a colour captured by the camera’s sensors. Most flatbed scanners also save the scanned image as a bitmap.

    You can also make a bitmap yourself with bitmap editing software. This is slow for anything but the simplest images, but it is useful for small pictures such as the sprites in a computer game.

    1.2 · 9 of 17Book pages Contents

    Vector graphics

    A vector graphic is an image made up of a list of drawing objects and their properties. A drawing object is a shape defined mathematically or geometrically, such as a rectangle, a line, a polygon or a circle. Each object has properties that set its:

    • dimensions, for example its width and height
    • appearance, for example its line colour, fill colour and line thickness
    • position, for example its x and y coordinates

    The objects and their properties are stored in a list called the drawing list. When the image is shown, the computer works through the drawing list and draws each object.

    A common file format for vector graphics is SVG (Scalable Vector Graphics), which is used for vector graphics on the web. All popular web browsers can display SVG images. Here are the drawing lists for three simple vector graphics, written in SVG:

    <circle cx="100" cy="100" r="50"
      fill="lightgreen" stroke="black"
      stroke-width="5" />
    
    <ellipse cx="80" cy="60"
      rx="70" ry="50"
      fill="orange" stroke="black"
      stroke-width="3" />
    
    <rect x="10" y="10"
      width="140" height="100"
      fill="yellow" stroke="black"
      stroke-width="1" />
    ObjectWhat its properties mean
    Circlecx and cy give the coordinates of the centre; r gives the radius.
    Ellipsecx and cy give the coordinates of the centre; rx and ry give the horizontal and vertical radii.
    Rectanglex and y give the position of the top left-hand corner; width and height give its size.
    All threefill is the fill colour, stroke is the line colour and stroke-width is the line thickness.
    The three shapes drawn from the drawing lists: a light green circle with a thick black outline, an orange ellipse with a black outline, and a yellow rectangle with a thin black outline.
    The circle, ellipse and rectangle drawn from these drawing lists

    Vector graphic terms

    • Drawing object: one individual element of the image, such as a line, a square or a circle, created using a formula.
    • Property: one attribute of a drawing object, such as its line colour, line width or fill colour.
    • Drawing list: all the drawing objects in the image, with the commands (and properties) needed to draw each one.

    1.2 · 10 of 17Book pages Contents

    Vector graphics compared with bitmap images

    Advantages of vector graphics

    Vectors can be resized without distortion. Vector graphics are scalable: they can be made bigger or smaller without distorting the image, because the computer redraws each object at the new size from its properties. A bitmap image can look pixelated when its size changes, especially when it is enlarged: the computer has to stretch the existing pixels over a larger area, so the shapes look rough and blurry.

    Two grey circles, labelled vector and bitmap, each with a magnified view of its edge. The vector edge is a smooth curve; the bitmap edge is a staircase of square pixels.
    Enlarged, a vector edge stays smooth but a bitmap edge shows its pixels

    To resize a bitmap image without losing much quality, pixels have to be added to spread the colours over a larger area, so a bigger bitmap means a bigger file. Some photo editing programs can do this, but because a bitmap has no instructions for the exact shapes in the image, the result is less sharp than the original. A vector graphic can be scaled without any change to its file size: the size of a vector file only changes when objects are added or removed.

    File size. Vector graphics usually have smaller files than bitmap images, especially when they do not have many detailed shapes. For example, the colour of an object in a vector graphic is stored once, as one property, but in an uncompressed bitmap image the colour has to be stored for every pixel, even if the whole shape is one colour.

    Image editing. It is much simpler to create and edit vector graphics. Each object can be changed on its own by changing its properties, and objects can easily be added or removed. Changing a bitmap image often needs specialist photo editing software.

    Resolution. Vector graphics stay good quality whatever the resolution of the screen or printer they are shown on. The quality of a bitmap image depends on its own image resolution and colour depth, so a low-resolution bitmap will not look good on a high-resolution screen or when it is printed.

    Advantages of bitmap images

    Vector graphics are built from a limited number of shapes, so the kinds of image they can show are limited. This is why they are mostly used for illustrations, cartoons, logos and web designs. Bitmap images can show almost any level of detail and complexity. Photographs are always stored as bitmaps.

    Choosing a bitmap image or a vector graphic

    • Choose a vector graphic for logos, diagrams, cartoons and other images made of simple shapes: it can be resized without pixelation, so it can be used at any size (on a letter or on a banner) without losing quality, each object can be edited separately, and the file is usually smaller.
    • Choose a bitmap image for photographs and other detailed, realistic images: it can store any colour for every pixel, so it shows fine detail, shading and texture that shapes cannot.

    1.2 · 11 of 17Book page Contents

    Sound waves and analogue data

    Sound is caused by vibration. To make a sound, something has to vibrate, such as the string of a guitar, a person’s voice box or the loudspeaker of a radio. The vibrating particles knock into other particles, which vibrate and knock into more particles, and so on. This is how sound waves travel away from their source. We hear sounds because the vibrations in the air make our eardrums vibrate. In the same way, a microphone picks up vibrations in the air and turns them into electrical signals.

    A sound wave is usually drawn as a graph that looks a bit like a water wave. This is not exactly how the particles move (they move backwards and forwards in the direction the wave travels), but it lets us show the sound wave on a graph.

    A graph of a sound wave: air pressure on the vertical axis against distance on the horizontal axis. The line rises and falls smoothly in peaks of different heights.
    A sound wave drawn as a graph of air pressure

    A sound wave is analogue. This means that the value on the graph (here, the air pressure as the sound passes) can be any value, not just certain fixed (discrete) values. Over time it changes smoothly, instead of jumping from one value to the next.

    Analogue and digital data

    • Analogue data changes continuously and can take any value in a range, such as a sound wave before it is recorded.
    • Digital data can only take certain fixed (discrete) values. A computer stores it in binary.
    • Sound must be changed from analogue to digital before a computer can store or process it.

    1.2 · 12 of 17Book pages Contents

    Amplitude and frequency

    A graph of a sound wave over time shows two features that change how the sound sounds to us: the amplitude and the frequency.

    The amplitude is the height of the wave on the graph, from the middle to its highest point. It shows how loud the sound is: sound waves with a higher amplitude are louder. For example, an actor speaking to a whole theatre makes a sound wave with a higher amplitude than someone in the audience whispering to a friend.

    A smooth wave plotted against time. An arrow from one peak to the next is labelled time period; an arrow from the middle line up to a peak is labelled amplitude.
    The time period and the amplitude of a wave

    The time period of a sound wave is the time between two peaks of the wave. The frequency is 1 divided by the time period, and it is measured in hertz (Hz). The frequency shows the pitch of the sound: a higher frequency gives a higher pitch. For example, the graph of the shrill sound of a whistle is much more bunched up than the graph of the deep sound of a double bass. In the graph below, the sound shown by the pink dotted line has a higher pitch than the sound shown by the orange line.

    Two waves against time. The orange line has long, slow waves; the pink dotted line has about twice as many peaks in the same time.
    The pink dotted wave has the higher frequency, so the higher pitch

    1.2 · 13 of 17Book pages Contents

    Sampling: turning sound into digital data

    To make a digital sound file that can closely recreate the original sound, the computer has to change the analogue sound wave into a digital form. To record a sound:

    1. A microphone picks up the sound waves and turns them into analogue electrical signals.
    2. An analogue to digital converter (ADC) changes the electrical signals into digital values that can be stored on a computer. This process is called sampling: the level (amplitude) of the analogue signal is measured at regular time intervals. Each measurement is called a sample.
    3. Each sample is given a binary pattern and stored in the computer’s memory.

    Once the sound is digital, it can be edited with sound processing software. To play a digital sound file, it has to be changed back into analogue sound waves:

    1. A digital to analogue converter (DAC) changes the digital values stored on the computer into analogue electrical signals.
    2. The signals are passed to a speaker. The speaker cone vibrates and moves the air, making analogue sound waves.
    A chain from left to right: sound (air pressure), microphone, analogue-to-digital converter, memory storing numbers, digital-to-analogue converter, speaker, sound (air pressure). Small graphs show voltage after the microphone and numbers after the ADC.
    Recording and playing back sound: ADC to store it, DAC to play it

    The sound waves that come out of the speaker may be quite different from the original sound waves. How close they are depends on the sampling rate and the sampling resolution.

    How sound is represented in a computer

    • The amplitude (height) of the analogue sound wave is measured at set time intervals, a set number of times each second. This is sampling.
    • Each measurement (sample) is given a binary number.
    • The binary numbers are stored in sequence.

    1.2 · 14 of 17Book pages Contents

    Sampling rate

    How often should the ADC sample the sound wave? If it takes samples only rarely, the digital sound will sound very different from the original. If it takes samples very often, the digital sound will be close to the original, but the file will be very large, because it stores a large number of samples.

    The sampling rate is the number of samples taken per second. It is measured in hertz (one hertz is one sample per second). A sampling rate of 44.1 kHz means the sound wave is measured 44 100 times every second. The higher the sampling rate, the better the quality of the recording, and the bigger the file.

    To rebuild the original sound accurately from its samples, a high sampling rate is needed. The graphs below show the same sound sampled at a high rate, at half that rate and at a third of that rate:

    Four graphs of the same sound wave. Original sound: the analogue wave. High sampling rate: many samples, and the digital wave looks like the original. Half the rate: the digital wave loses sharpness. A third of the rate: the digital wave loses its peaks.
    Fewer samples per second: the digital wave loses sharpness, then its peaks

    This graph shows a very low sampling rate of 1 sample per second. The sound recreated from the samples is very different from the original:

    Left: the original smooth sound wave with six sample points marked. Right: the recreated sound, made by joining the six samples with straight lines, which looks quite different.
    A very low sampling rate gives an inaccurate copy of the sound

    Raising the sampling rate makes the copy more accurate, because the gaps between samples are smaller. 44 100 Hz (44.1 kHz) is a common sampling rate for digital audio: the sound is sampled 44 100 times per second, and these samples are used to rebuild the sound when it is played back.

    The Nyquist theorem. The human ear can hear frequencies from about 20 Hz up to about 20 kHz (at most about 22 000 Hz). The Nyquist theorem says that, to reproduce a recording accurately, the sampling rate must be at least double the highest frequency. So music for a CD is recorded with a sampling rate of 44 100 Hz. Recording only the human voice needs a lower sampling rate, around 8000 Hz.

    Increasing the sampling rate

    • Samples are taken more often, so the time gaps between samples are smaller.
    • The digital sound wave is closer to the original analogue wave, so the recording is more accurate, with smaller quantisation errors.
    • More samples are stored each second, so more bits are stored and the file is larger.

    1.2 · 15 of 17Book pages Contents

    Sampling resolution

    Each sample measures the level of the signal, which stands for the height of the sound wave at one moment. The sampling resolution (or sample resolution) is the number of bits used to store each sample. It sets how many different values a sample can take.

    With a low sampling resolution (very few bits per sample) there are only a few binary patterns, so the changes in the analogue signal cannot be stored accurately. Each value has to be stored as the nearest digital value available. The difference between the real analogue value and the value stored is called the quantisation error. In the top graph below, with only 2 bits per sample, measurements at different levels have to be stored with the same binary pattern. With 3 bits per sample (bottom graph) each sample is stored more accurately.

    Two graphs of the same sound wave sampled at the same times. Top: a 2-bit scale with levels 00 to 11, so several samples are rounded to the same level. Bottom: a 3-bit scale with levels 000 to 111, so the samples sit much closer to the wave.
    2 bits per sample (top) against 3 bits per sample (bottom)

    In this example, with 2 bits each sample can only be one of 4 levels (0 to 3), but with 4 bits there are 16 levels (0 to 15), so the stepped digital wave follows the real wave much more closely:

    Two graphs of amplitude against time. Left: 2-bit sample resolution, levels 0 to 3, the stepped line only roughly follows the wave. Right: 4-bit sample resolution, levels 0 to 15, the stepped line follows the wave closely.
    More bits per sample give a more accurate copy of the wave

    A high sampling resolution makes the file larger, so it takes up more storage space. This may not be practical, depending on what the recording is for. Digital audio usually uses one of two resolutions:

    • 8-bit audio, when lower-quality sound is good enough, for example in devices that only need simple sounds.
    • 16-bit audio, the standard for CDs and sound cards. With 16 bits per sample there are 216 = 65 536 possible values.

    Increasing the sampling resolution

    • More bits are used for each sample, so more different amplitudes can be stored.
    • Each stored amplitude is closer to the real analogue amplitude, so quantisation errors are smaller and the digital sound is more accurate.
    • Each sample takes more bits, so the file is larger.
    • Decreasing the sampling resolution does the opposite: fewer bits per sample, a smaller file and a less accurate recording.

    1.2 · 16 of 17Book pages Contents

    Calculating the size of a sound file

    To find how much storage a sound file needs, in bits:

    1. work out the number of samples: multiply the sampling rate in Hz (samples per second) by the length of the recording in seconds;
    2. work out the number of bits: multiply the number of samples by the sampling resolution (bits per sample).
    storage in bits =
       sampling rate × seconds
       × sampling resolution

    To give the answer in other units, divide by 8 to get bytes, then by 1 000 for kilobytes and again for megabytes (or by 1024 for kibibytes and mebibytes).

    Mono and stereo. One more thing changes the file size: whether the sound is monophonic or stereophonic (mono or stereo). Mono sound is one track of sound. Stereo sound has two different tracks (channels), which give an impression of position and direction. Two tracks need twice the storage, so a stereo recording is twice the size of a mono recording with the same length, sampling rate and sampling resolution:

    stereo storage in bits =
       sampling rate × seconds
       × sampling resolution × 2

    Worked example

    A stereo recording lasts 3 minutes. It has a sampling rate of 44.1 kHz and a sampling resolution of 16 bits. Calculate its size in megabytes.

    1. Step 1
      Change the length into seconds: 3 × 60 = 180 seconds.
    2. Step 2
      Calculate the bits for one track: 44 100 × 180 × 16 = 127 008 000 bits.
    3. Step 3
      There are two tracks: 127 008 000 × 2 = 254 016 000 bits.
    4. Step 4
      Change into bytes: 254 016 000 / 8 = 31 752 000 bytes, which is 31.752 MB, about 31.8 MB.

    1.2 · 17 of 17Book pages Contents

    Changing the sampling rate and resolution

    When you record digital sound you often have to choose between accuracy and file size. Increasing either the sampling rate or the sampling resolution improves the quality of the sound, but makes the file larger. Decreasing either one makes the file smaller, but the sound quality is worse.

    These examples start with a sound file in standard CD quality: a sampling rate of 44.1 kHz (44 100 Hz) and a sampling resolution of 16 bits.

    Worked example

    Calculate the size of a 3-minute (180-second) mono sound file recorded at 44.1 kHz with 16 bits per sample.

    1. Step 1
      Storage = 44 100 (hertz) × 180 (seconds) × 16 (bits) = 127 008 000 bits.
    2. Step 2
      Change into bytes: 127 008 000 / 8 = 15 876 000 bytes.
    3. Step 3
      Taking 1 kB as 1 000 bytes and 1 MB as 1 000 kB, the size is 15.876 MB, about 15.9 MB.

    Increasing the sampling rate. 44.1 kHz is the standard rate for CDs and MP3s, but the most common sampling rate for the sound in films and on DVDs is 48 kHz. Raising the rate from 44.1 kHz to 48 kHz gives 48 000 × 180 × 16 = 138 240 000 bits = 17 280 000 bytes = 17.28 MB. The file is about 1.4 MB, or 9%, bigger.

    Decreasing the sampling rate. FM radio usually uses a sampling rate of 32 kHz, and some digital video uses it too, because it allows four channels of sound to be recorded. Lowering the rate from 44.1 kHz to 32 kHz gives 32 000 × 180 × 16 = 92 160 000 bits = 11 520 000 bytes = 11.52 MB. The file is about 4.4 MB, or 27%, smaller.

    Increasing the sampling resolution. More bits per sample give a greater dynamic range (the range between the quietest and loudest sounds that can be stored). For example, Blu-ray discs, used for high-definition video, support a 24-bit sampling resolution. This gives 44 100 × 180 × 24 = 190 512 000 bits = 23 814 000 bytes, about 23.8 MB. The file is about 7.9 MB, or 50%, bigger.

    Decreasing the sampling resolution. Some digital audio files use 12 bits per sample instead of 16. This gives 44 100 × 180 × 12 = 95 256 000 bits = 11 907 000 bytes, about 11.9 MB. The file is about 4.0 MB, or 25%, smaller.

    Settings (180 seconds, mono)SizeChange from 15.9 MB
    44.1 kHz, 16 bits (CD quality)15.9 MBnone
    48 kHz, 16 bits17.3 MBabout 9% bigger
    32 kHz, 16 bits11.5 MBabout 27% smaller
    44.1 kHz, 24 bits23.8 MB50% bigger
    44.1 kHz, 12 bits11.9 MB25% smaller

    Effects of changes on a sound recording

    • Increase the sampling rate: the file gets bigger and the recording is more accurate.
    • Increase the sampling resolution: the file gets bigger and the recording is more accurate.
    • Decrease either one: the file gets smaller and the recording is less accurate.
    • Increase the length of the recording: the file gets bigger, but the accuracy does not change.
    • A bigger file takes longer to send and fills storage faster.

    1.2

    Concepts in 1.2

    Every idea explained in 1.2, and where else in the notes it is used.

    ConceptIn one lineAlso used in
    amplitudeThe height of a sound wave from the middle to its peak; it sets how loud the sound is.1.2 Sampling: turning sound into digital data, 1.2 Sampling resolution, 1.3 Compressing sound files
    analogue dataData that changes continuously and can take any value, such as a sound wave.1.2 Sampling: turning sound into digital data, 1.2 Sampling resolution, 3.1 Input devices, 3.1 How a speaker works, 3.1 Monitoring and control systems, 3.1 Sensors and actuators
    analogue to digital converterA device that turns analogue electrical signals into digital values a computer can store.1.2 Sampling rate, 3.1 How a microphone works, 3.1 Monitoring and control systems
    bitmap imageAn image made of a grid of pixels, with the colour of each pixel stored as a binary code.1.2 Image resolution, 1.2 Calculating the file size of a bitmap image, 1.2 Effects of changing resolution and colour depth, 1.2 Bitmap file formats and how bitmaps are made, 1.2 Vector graphics compared with bitmap images, 1.3 What compression is, 1.3 Run-length encoding, 1.3 Compressing vector graphics, 3.1 Input devices
    colour depthThe number of bits used to store the colour of each pixel; n bits give 2 to the power n colours.1.2 Calculating the file size of a bitmap image, 1.2 Effects of changing resolution and colour depth, 1.2 Metadata and the file header, 1.2 Vector graphics compared with bitmap images, 1.3 Why files are compressed, 1.3 Run-length encoding, 1.3 Compressing bitmap images
    digital dataData that can only take certain fixed (discrete) values, stored in binary.3.1 How a speaker works, 3.1 Monitoring and control systems
    digital to analogue converterA device that turns stored digital values back into analogue electrical signals.3.1 How a speaker works
    drawing listAll the drawing objects in a vector graphic, with the commands and properties to draw each.1.3 Compressing vector graphics
    drawing objectOne element of a vector graphic, such as a line or circle, created using a formula.1.3 Compressing vector graphics
    file headerThe area at the start of a file that stores its metadata, such as size and colour depth.1.2 Calculating the file size of a bitmap image
    frequencyHow many waves pass each second (1 divided by the time period); it sets the pitch.only here
    image resolutionThe number of pixels wide by the number of pixels high that make up an image.1.2 Screen resolution, 1.2 Calculating the file size of a bitmap image, 1.2 Effects of changing resolution and colour depth, 1.2 Vector graphics compared with bitmap images, 1.3 Compressing bitmap images
    metadataData about data, such as a file’s type, size, dimensions and date of creation.8.2 The data dictionary
    mono soundSound recorded as one track (channel).1.2 Changing the sampling rate and resolution
    Nyquist theoremThe sampling rate must be at least double the highest frequency to reproduce a sound accurately.only here
    pixelThe smallest element of an image, which can be one colour.1.2 Colour depth, 1.2 Image resolution, 1.2 Screen resolution, 1.2 Calculating the file size of a bitmap image, 1.2 Effects of changing resolution and colour depth, 1.2 Metadata and the file header, 1.2 Bitmap file formats and how bitmaps are made, 1.2 Vector graphics compared with bitmap images, 1.3 Why files are compressed, 1.3 Run-length encoding, 1.3 Compressing bitmap images, 1.3 Compressing vector graphics, 4.1 VGA and HDMI ports
    pixelationWhen the pixels of an enlarged bitmap image become visible, so it looks blocky.1.2 Effects of changing resolution and colour depth, 1.2 Vector graphics compared with bitmap images
    propertyOne attribute of a drawing object, such as its line colour, line width or position.only here
    quantisation errorThe difference between a real analogue value and the nearest digital value stored for it.1.2 Sampling rate
    samplingMeasuring the amplitude of an analogue signal at regular time intervals and storing each value in binary.1.3 Compressing sound files
    sampling rateThe number of samples taken per second, measured in hertz.1.2 Sampling: turning sound into digital data, 1.2 Calculating the size of a sound file, 1.2 Changing the sampling rate and resolution, 1.3 Compressing sound files
    sampling resolutionThe number of bits used to store each sample.1.2 Sampling: turning sound into digital data, 1.2 Calculating the size of a sound file, 1.2 Changing the sampling rate and resolution, 1.3 Compressing sound files
    screen resolutionThe number of pixels wide by the number of pixels high that a screen can display.1.2 Effects of changing resolution and colour depth
    stereo soundSound recorded as two tracks, giving a sense of direction; it doubles the file size.only here
    SVGScalable Vector Graphics, a common file format for vector graphics on the web.1.3 Compressing vector graphics
    vector graphicAn image stored as a list of drawing objects and their properties, drawn from formulas.1.2 Vector graphics compared with bitmap images, 1.3 Compressing vector graphics

    When you want more than reading

    The notes are the front door. The class is where it clicks.

    Join a class →Ask on WhatsApp