Daniel Jacobson's MATH 447 Webpage | Class Page | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Home
≫
Project 5
≫
Problem 1
Project 5: Discrete Cosine Transform & Audio Compression | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For the first problem, we used the Modified Discrete Cosine Transform (MDCT) directly on the data and used it to compress audio signals with frequency \( 64f \) Hz, for small integers \( f \). For the below examples, a sample rate of 8192Hz (intensity values per second) and a window size of \( n=32 \) data points, with coefficients compressed to \( b=4 \) bits (i.e. rounded to the nearest of \( 2^4=16 \) possible values). The original/decoded signals were plotted and compared. Each audio recording contains three 1.5-second clips: one of the original signal, one of the decoded signal, and one of the difference (error) between the two.
Relevant files:
prob1codec.m,
question1.m, and
prob1.txt.
Clearly there is a significant difference in output between odd and even values of \(f\): for even values, the error is far more pronounced and an audible buzzing can be heard over the decoded signal. The reason for this becomes apparent when comparing the first seven coefficients of each transformation with the root mean squared error (RMSE):
For odd numbered values of \(f\), the model only needs a single coefficient to encode the signal, and as a result, RMSE is lower - whatever quantization error exists affects merely the amplitude of the signal. For even numbered values of \(f\), since a combination of multiple coefficients is needed to approximate the correct signal, quantization error accumulates more easily and creates more unpredictable patterns. The mathematical explanation for this is fairly straightforward. The signal is computed as \( f(x) = cos(x * 2 * \pi * (64*f) / 8192) \) (\(period = 128/f\)), while the MDCT is a linear combination of \( f_i(x) = cos((i+0.5)*(x+16.5)*pi / 32) \) (\(period = 64/(i+0.5)\)) for \( i \in [1,32] \). To get the two to line up, we would want the periods to be equal, so \( 128/f = 64/(i+0.5) \) which simplifies to \( i = (f - 1)/2 \) so to get an integer \(i\), \( f \) must be odd. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|