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:
In Section 8.6: The transformation of linear scales should have these paratheses:
Let:
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 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, , missing parenthesis, change minus sign to plus sign:
Please submit corrections using the Contact Us tab in the site navigation menu.

