Programming assignment 3 - MP3 encoder - Subband filtering: Instructions Help Center

In this programming assignment, we will develop an efficient implementation of the MP3 subband filtering by following the steps detailed in the standard. In the standard, the procedure uses a 512-point circular buffer and, at each step, it replaces 32 samples in the buffer with new data and produces 32 subband samples. Here we will not address the updating of the buffer and you will need to write a function that operates on a pre-prepared buffer.

Start by downloading the assignment file available here and place it in the assignments folder (please review the general instructions page if this confuses you). This is the only file you should modify to perform this assignment.



The function you must write will have the following interface:

Input :

  • x, the 512-point buffer, already updated with 32 new samples and time-reversed
  • h, the 512-point prototype FIR impulse response you computed in the previous assignment

Output :
  • s: a 32-point array of subband filter outputs


The efficient subband filter calculation involves the following steps:
  1. the buffer is already updated and time reversed, so the newest samples are first
  2. compute r[k] = h[k]x[k], k = 0, ..., 511
  3. compute c[q] = \sum_{p=0}^7 (-1)^p r[q + 64p], q = 0, ..., 63
  4. compute the subband outputs as s[i] = \sum_{q=0}^{63} \cos \left( \frac{\pi}{64} (2i + 1)(q - 16) \right) c[q] for i = 0, \ldots, 31