These are my notes from working through the most excellent Telecommunications Breakdown, by Johnson and Sethares.
I worked these problems in IPython, which is really great for this sort of thing. And is a lot less obtuse to look at a few months later than MATLAB/octave.
If you want the original code, please clone the git repo at this URL (right-click, 'Copy URL', and then 'git clone' that URL). (Sorry for the goofy link, but it should be valid in any static archive of this website.)