Data representation · A level · AQA 7517 4.5.6.7, Eduqas A500QS 2.3 · about 30 min
Sample rate, sample resolution, the Nyquist theorem and aliasing, and MIDI events played on the robot's piezo.
[1 mark]How many bytes does a 30 second mono recording take at a sampling rate of 8,000 Hz and a sample resolution of 8 bits?
[1 mark]A recording must keep frequencies up to 5,000 Hz. What is the lowest sampling rate, in Hz, the Nyquist theorem allows?
[1 mark]A 440 Hz tone is sampled at 600 Hz. What happens?
[1 mark]Which of these are MIDI event messages or data carried in them?
Tick every answer that is true.
[1 mark]Which is a disadvantage of MIDI compared with sampled sound?
[1 mark]What does this program print?
for note in [57, 69, 81]:
print(note, round(440 * 2 ** ((note - 69) / 12)))events is a list of (note, seconds) pairs: note is a MIDI note number (0 to 127) and seconds is how long to play it.
1. Write frequency(note), which returns 440 × 2^((note - 69) / 12) rounded to the nearest whole number with round, as an int.
2. For each event in order, print note <note> = <frequency> Hz and play it on the piezo with tone(frequency, seconds).
3. After the last note, print minimum sample rate: <n> Hz, where n is twice the highest frequency you played: the Nyquist rate for recording those notes' fundamental frequencies.
Calculate every frequency; do not type them in.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
events = [(60, 0.25), (64, 0.25), (67, 0.25), (72, 0.5)]
def frequency(note):
return 440Plan your program here, then type it in and press Run.