Algorithms & Educational Resources

How about we share resources for learning about DSP/algorithms? I’ll go first!

  • Musicdsp.org - “A collection of algorithms, thoughts and snippets, gathered for the music dsp community.”

  • Synth Secrets - A 63-part tutorial that goes deeeeeeep on sound design & synthesis, more so than any other blog I’ve found.

  • Coursera’s Audio Signal Processing Course - Haven’t personally taken this yet but it’s on my to-do list. Seems very highly rated and comprehensive.

10 Likes

Trevor Wishart made his book Audible Design free not too long ago – which describes in detail a lot of really cool ideas he’d developed for his compositions: http://www.trevorwishart.co.uk/AuD.html

(The audio examples are linked there too, available to stream or download via bandcamp.)

It’s code-free, but a really inspiring book filled with sonic recipes and ideas.

4 Likes

EQ: https://www.w3.org/2011/audio/audio-eq-cookbook.html

Compressors: https://www.eecs.qmul.ac.uk/~josh/documents/2012/GiannoulisMassbergReiss-dynamicrangecompression-JAES2012.pdf

Filters, FFT, convolution: http://www.dspguide.com/pdfbook.htm

3 Likes

I wrote soundpipe to be a collection of usable DSP algorithms that could be easily dropped into projects. Daisy ported some of them to C++ in their DaisySP library. The code for each DSP algorithm is usually fairly self-contained and I’ve found them to be useful reference implementations.

Julius Smith (one of the co-creators of the coursera DSP course) is a professor at CCRMA and his website has many great audio DSP goodies available online, including his textbooks he uses for his classes.

Mathematics of the DFT is a book all about the DFT (the underlying mathematic process that the FFT algorithm does) and introduction to spectrum analysis. This is the textbook used in the CCRMA 320a course. I found that the first few chapters in this book pair really well with the first few chapters in Musimathics, Vol 2 by Gareth Loy. This book is designed to be an introductory book for STEMy people as well as musicians and artists without a strong STEM background. You don’t really need anything more than highschool trig. Julius has a pretty dense writing style, so it’s easy to get lost, especially in the later chapters. Julius has mentioned that he tries to use as many terms in his book as possible to get students used to the inconsistent terminology used in the literature. The last half of the book is all supplementary material, which can be consumed optionally and out of order. The first half is a relatively linear read. Though it (really really really) may not feel like it at the time, the problem sets at the end of each chapter are there to help you :wink:

Introduction to Digital Filters is well… an introduction to digital filters, filter design, as well as some filter analysis. This is the textbook used in CCRMA’s 320b course. It’s a thicker book than the MDFT, and I’ve heard one person once describe it as a “little more off the rails”. Indeed, I would agree that the organization of this textbook is a bit more jumbled. One of the eariler chapters, either the simplest lowpass filter or Analysis of a Digital Comb Filter used to exist as a standalone thing for musicians learning about audio DSP. This book may have a teeny weeny bit of calculus in it, but I do not remember. I remember this book being more difficult to dive into, but also being way more practical As a musician/composer I use filters way more than FFTs, so there was a lot of helpful information. This book (and the 320b) course was where I learned about things like transfer functions, biquads, and BLTs, which made the filter code in C I was looking at before make a lot more sense. Oh, there’s also a bunch of sample code in here, which is neat to look at.

I attempted to read some of the Physical Audio Digital Signal Processing, and even audited the class, but did not get far. Perhaps I’ll try again at some point. This is a (physically) massive book, intended for an advanced audience (aka not me). Considering that physical modeling is Julius’s speciality, I would not be surprised if this book were the best most comprehensive text on the subject. This book definitely gets into some calculus (solving ODEs + PDEs), and as you’d expect, there’s a fair bit of physics covered in this book as well. Like many of his textbooks, you can split this book in half between the textbook itself (numbered chapters), and a massive amount of supplementary material (alphabetical sections). Lots of interesting tidbits.

I can say the least about Spectral Audio Signal processing, as I don’t own a physical copy and have not tried to read it. I do know that the book builds on the ideas covered in the first MDFT book. Definitely intended for a graduate-level audience. That’s all I can say on this one.

It’s worth noting that Julius is a huge FAUST evangelist, and has contributed a LOT to the FAUST standard library. It’s worth looking around the FAUST library documentation. Not only is there a treasure trove of ready-to-use physical model and filter implementations, but algorithms are usually lovingly commented and full of relevant supplementary links and source citations.

9 Likes

There seem to be a lot of errors in the transcription of the equations on that site, e.g.:

image

Maybe the “- cos(w0)” is supposed to be part of the denominator. I see things like this all over the site, though, so I’d suggest double-checkIng any equation you see there before you use it.

5 Likes

Good catch! The original equation I think you are referencing can be found in the original text file here:

(1 - cos(w0)) is supposed to be in the denominator.

Yeah, I would stick to the original text version.

3 Likes

On the topic of virtual analog filter design here’s the two sources that have been extremely helpful to me.

Will Pirkle’s app note 4 which breaks down the basics of “zero delay feedback” filters in a very digestible way

https://www.willpirkle.com/706-2/

And “The Art of VA Filter Design” by Vadim Zavalashin. This thing is like the Bible which contains not just VA filter knowledge but loads of other great material as well.

Excited to show off my virtual analog filters and distortion patches once I get them running on daisy :slight_smile:

2 Likes

https://www.micromodeler.com/dsp/

LOTS of features for filter design and analysis here. Described as a web-based digital filter IDE.

2 Likes

deluge_96 mentioned one of Will Pirkle’s app notes. The app notes are for his textbooks. I have read the 2014 synthesizer book, and I use it as a reference a lot.

It’s nominally about soft synths, but if you ignore the GUI stuff, it’s equally applicable to embedded synths. It’s a good explanation of the algorithms that make up virtual analog.

He has a more recent book on audio FX processing. I have not read it, though it’s on my list.

The correct link for the RBJ cookbook is:
https://music.columbia.edu/pipermail/music-dsp/1998-October/054185.html

BTW DF1 filters are kind of weak, it’s better to use realizations based on implicit equations especially if you want to modulate the parameters. Andrew Simper has a lot of information about trapezoidal integration:

@Firesledge do you have examples of this?

Yes, the following source code implements a linear 2-pole SVF with trapezoidal integration:

header /// code

There are probably simpler code snippets for educational purpose because the implementation is spread across multiple classes (Svf2p, SvfMixer*) for flexibility and performance reasons and comments are on the rare side, but it should be clear enough. The following source code by Urs Heckmann goes one step further and implements a classic 4-pole filter with nonlinearities:

header

However the code implementation is only the last step of the filter design. It’s almost impossible to understand how it really works without the differential equations from which the filter was derived. The previously quoted Andrew Simper’s documents and the Vadim’s book The art of VA Filter Design are a must-read on this topic. If you can read French I wrote an introductory paper on the topic.

1 Like

If I don’t understand math, am I lost? Is there a primitive form of explanation of DSP algorithms?

Well, at some point you will have to understand math. DSP is mostly math. It’s unavoidable. But, there are certainly core concepts you can learn that require minimal math. Then, you can build on those concepts to learn more math. So on, and so forth.

The first Julius DSP textbook (mathematics of the DFT) only requires knowing highschool trig and algebra. As someone who went through that book and the 320a course AND only had highschool trig/algebra as a math background (no college-level math), I can say that this is true. The second book (digital filter design) is also survivable only knowing trig/algebra.

I was always really self conscious about not really knowing calculus (I think I took pre-calc in highschool?). In my experience, it only became an issue once I started learning about physical modeling.

I will say that not having a formal STEM background made things very slow and difficult compared to my colleagues. But not impossible. It’s only been a few years since I did the dive, and already concepts and things are easier for me.

3 Likes

Don’t think anyone has mentioned this, DAFX: Digital Audio Effects is pretty good.

2 Likes

Yes, I’ll try to look for some literature.

[Dattoro]:Dattoro, Jon, Effect Design, Journal of the Audio Engineering Society, Vol. 45 No. 9, 1997

There actually are 3 papers by Dattoro about filter design and delay lines for musical applications. He aims at implementations with only few parameters that musically make sense (make sense to musicians).

1 Like

I was just about to start a new question asking about this one!

Have read a bit of it already, was wondering if it would help to start writing for Daisy (since the code provided in the book is in Matlab).

Obviously the math would still check out, wondering if anyone would recommend using a different book that is more C based though.

Maybe “Numerical Methods in C” can help you “translate” the Matlab code to C?

1 Like

Computational Music Synthesis by Sean Luke.

I stumbled across this book in early 2020, and it is the perfect textbook for anyone beginning their journey in digital synthesis and music. The textbook is directed at undergraduate CS students, and consists of lecture notes on how to build software synthesizers. Chapters include Fourier Transform, Modulation, Filters, and more.

I am not associated with the text at all, but I highly recommend it. It gives fantastic insight into the different synthesizer components and how they work. I don’t see this textbook talked about much, but it is definitely a hidden gem.

2 Likes