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

## Chapter 2

**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

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

## Chapter 7

**Simple Classifier**- Implement the following features:
- Spectral Centroid
- Zero Crossing Rate
- Spectral Crest Factor
- Spectral Flux
- RMS

- For each file, compute the subfeatures mean and standard deviation. Normalize the features.
- Download the GTZAN dataset
- Implement a kNN Classifier
- Do a sequential forward selection on the features with k=3, plot the classification accuracy depending on the results
- Evaluate the accuracy with 10-fold cross-validation

- Implement the following features:
**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.

- Run an experiment on a well-known dataset and visualize your clusters: