Exercises
2.5. Exercises#
Exercise 2.1
Imagine you are given a sampled signal
What is the sampling rate
of ?What is the sampling period
of ?How many samples will
have?
Hint
Be sure to consider what happens when
Exercise 2.2
If the sampling rate is
Hz Hz Hz
Exercise 2.3
Imagine that you want to sample a continuous wave
, , .
Which (if any) of these sampling rates satisfy the conditions of the Nyquist-Shannon theorem?
Exercise 2.4
Using the quantize function from this chapter, apply different levels of quantization (varying n_bits
from 1 to 16) to a recording of your choice. For each quantized signal, subtract it from the original signal and listen to the difference:
# We need to normalize the signal to cover the same range
# before and after quantization if we're going to compare them.
x_span = x.max() - x.min()
x_diff = x / x_span - quantize(x, n_bits) / 2**n_bits
What does it sound like for each quantization level?