7.4. Exercises

  1. 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.

  2. Including Frequency.

    1. For the same program as in the previous exercise display the frequency in Hz in the Fourier magnitude plot.

    2. 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.

    3. Instead of plotting the Fourier magnitude as a function plot make it into a bar plot like a familiar frequency plot for audio.

  3. 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:

    1. A 2nd order low-pass filter. Start with an analog prototype and use the bilinear transform (with frequency prewarping) to derive the biquad coeffients.

    2. 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.

    3. 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).