Data representation · GCSE · OCR J277 1.2.4, AQA 8525 3.3.7, Edexcel 1CP2 2.2.3 · about 15 min
Sampling, sample rate, bit depth and file size, and finding a note from its samples.
[1 mark]A sound is sampled at 8,000 Hz with an 8-bit depth for 2 seconds. How many bits is it?
[1 mark]What is the sample rate?
[1 mark]What does increasing the bit depth do?
[1 mark]A 440 Hz wave crosses the middle going upwards how many times in half a second?
[1 mark]How many levels can a 2-bit sample take?
Sample a note of 659 Hz for half a second at a sample rate of 8,000 Hz. Print samples: <n> and 8-bit size: <n> bits, worked out from the rate and duration. Then count the upward crossings, print note: <freq> Hz, and play that frequency on the buzzer for half a second.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() import math rate = 8000 seconds = 0.5
Plan your program here, then type it in and press Run.