7.4. Exercises¶
Including Time.
Consider the Python program in which both the audio signal and its Fourier transform amplitude is visualized.
Adapt the program to display the time of the buffers being displayed. Set the first buffer to start at time \(t=0\). Display the time in milliseconds.
Including Frequency.
For the same program as in the previous exercise display the frequency in Hz in the Fourier magnitude plot.
Change the axis for the Fourier magnitude plot into a logarithmic scale (ticks along the axis should be 10, 100, 1000, 10000 and 100000 Hz.
Instead of plotting the Fourier magnitude as a function plot make it into a bar plot like a familiar frequency plot for audio.
Biquad Filtering.
In this exercise you have to implement changes in the play_process_sound.py file.
Instead of the Butterworth filter you have to implement:
A 2nd order low-pass filter. Start with an analog prototype and use the bilinear transform (with frequency prewarping) to derive the biquad coeffients.
Use the transformation from low to high-pass filter to transform your low-pass filter into a high-pass filter with the same cut off frequency.
The same but now transform the low-pass filter into a band-pass filter.
For each of the filters also display the frequency response (magnitude and phase).