exercises

This page will provide a growing list of exercises and assignments.

Chapter 2

  1. Spectrogram

    Write a function that plots a spectrogram-representation of an audio file (hint: use Matlab’s image function). Use a von-Hann window and allow a user-definable block length and hop length. Make sure the axes are showing correct time and frequency scales in seconds and frequency, respectively.

Chapter 4

  1. Peak Program Meter

    1. Implement the PPM as shown in Fig. 4.5
    2. Choose an attack time of 10ms and a release time of 1.5s and compute the coefficients according to Eq. (4.10).
    3. Choose a step function as the input signal and compute the output signal to verify proper implementation.
    4. Implement a peak envelope feature by taking the absolute maximum of each block.
    5. Compute the two outputs for an audio file. Discuss the differences.

Chapter 7

  1. Simple Classifier

    1. Implement the following features:
      • Spectral Centroid
      • Zero Crossing Rate
      • Spectral Crest Factor
      • Spectral Flux
      • RMS
    2. For each file, compute the subfeatures mean and standard deviation. Normalize the features.
    3. Download the GTZAN dataset
    4. Implement a kNN Classifier
    5. Do a sequential forward selection on the features with k=3, plot the classification accuracy depending on the results
    6. Evaluate the accuracy with 10-fold cross-validation
  2. KMeans

    Implement a matlab function: (clusterIdx, centroids) = myKMeans(X, K) in which X is the input data matrix, K is the parameter k, clusterIdx is the clustering labels for all samples, and centroids are the k centroids after the clustering.

    • Run an experiment on a well-known dataset and visualize your clusters:
      • in the matlab command window, use load fisheriris.mat. ‘meas’ is a 150 by 4 feature matrix. ‘species’ is a 150 by 1 feature vector, and it is also the ground truth of the data
      • perform k-means on the data
      • select two features, visualize your result using scatter(). Make sure that you use different colors for different clusters.
    • Evaluation: use the ground truth compute Precision and Recall for each cluster.

Leave a Reply

Your email address will not be published. Required fields are marked *