Errata

Corrections to the textbook, Hack Audio: An Introduction to Computer Programming and Digital Signal Processing in MATLAB. Code examples posted to the GitHub repository show the following revisions.

 

Example 6.5: Incorrect variable name. Use this instead:

 

[x,Fs] = audioread(filename);

 

Example 6.7: Missing time vector for plot. Include:

 

Ts = 1/Fs; N=length(sw1); t=[0:N-1]*Ts; t=t(:);

 

Section 7.3.5 Triangle Wave Additive Synth. Every other harmonic should be multiplied by -1:

 

triangle(x) = \frac{8}{{\pi}^{2}} (sin(x) - \frac{1}{9}sin(3\cdot x) + \frac{1}{25}sin(5\cdot x) - \hdots)

triange(x) = \frac{8}{{\pi}^2} \sum\limits_{n=1,3,5,...}^{M} \frac{1}{n^2}sin(n\cdot x) \cdot (-1)^{\frac{(n-1)}{2}}

 

In Section 8.6: The transformation of linear scales should have these paratheses:

 

Let: y = \frac{{m}_{n}}{{m}_{o}}\cdot (x - {\mu}_{o}) + {\mu}_{n}

 

Example 9.6: Arrays should be initialized using zeros(N,1), not size(). Substitute:

 

x = zeros(N,1); y = zeros(N,1); 

 

Figure 11.7: The arrow connecting the multiplication block for -{a}_{W} to the addition block is pointing in the wrong direction. The arrow should point from the multiplication block to the addition block on the feedback path.

 

Table 13.1: Calculation of bi-quad coefficients. For High Shelf coefficient, {b}_{1}, missing parenthesis, change minus sign to plus sign:

 

{b}_{1} = -2 \cdot A((A-1) + (A+1) \cdot cos({w}_{0}))

 

Please submit corrections using the Contact Us tab in the site navigation menu.