SynthMaker

RBJ Filters - Audio Biquad - GreenMaths in Excel

Archive · 2008 5 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

steph_tsf ·

Hello,

This is about Audio IIRs (Biquads) written in SynthMaker CodeModule.

It is about calculating the coefficients "by hand" using Excel, providing :

- Fs (sampling frequency) - F0 (filter frequency) - Q (call it resonance if you want)

I don't want to waste your time. There are already excellent CodeModules from Shifrin, calculating the coefficients from Fs, F0 and Q without needing Excel. If you are looking for this, go straight to : RBJ Filters ported UPDATED... Three pages. Read carefully. You will be able to download RBJ-Filters.osm One million thanks to Shifrin !

But there are special cases, special requirements, and relaxed requirements also.

Like calculating more outputs from one input like in universal complementary filters. What I have done is to put the resonating cell at the beginning, so one reuses their values (z0,z1,z2) when calculating the various summation outputs (named "combiners" in Excel spreadsheet).

Like not needing fast updates of the IIR coefficients. Watch out zipping however : strong noise when you make big changes on IIR coefficients. This is the reason why Shifrin is always re-calculating the IIR coefficients inside the IIR CodeModule : usually you would put an external de-zipper that smooths the IIR coefficients variations even if from the application you make a fast big change. The external de-zipper smooths and damps the IIR coefficients variations over hundreds of milliseconds in order to keep the artifact below the noise floor. So, here, in this special case, with the IIR coefficients being not calculated inside the DSP loop, one may save lots of CPU cycles.

Like centralizing the calculation of the IIR coefficients. As an example, if you need variations on the IIR coefficients, you may centralize the de-zipper using a dedicated DSP CodeModule. So, if you see what I mean, you'll realize that if you are in stereo, with both channels driven the same, again, you will save CPU cycles. I agree the Schematic will be conveying many parallel lines (all the coefficients) but one should see this as a control bus. Do we have busses in SynthMaker ?

Please note also this is a "true" universal scheme, when d0 can be different than one. Using RBJ GeenMath on Excel, this d0 coefficient is of course always equal to 1.

If you want to save more CPU cycles, go into the CodeModule, delete the calculations of the outputs you don't need (as you can see there are four outputs here), and if you are always using RBJ GreenMaths, ignore the d0 coefficient at the input (delete that input) and make the corresponding simplification in the resonating cell calculation. After having done that you'll be proud : no mysteries anymore about Audio Biquads and no mysteries anymore about 2nd-order IIRs in general !

Here are the links : http://shup.com/Shup/30155/RBJ-Filters- ... okbook.osm http://shup.com/Shup/30156/RBJ-Filters- ... okbook.mht http://shup.com/Shup/30157/RBJ-Filters- ... -Excel.xls

Surely you will ask about the infamous de-normalization issue and associated trick. More info about here : DSP, MMX registers and floating point de-normalization

Now if we open the Excel spreadsheet, if we look to the BPF combiner (Band Pass Filter), we can see that the mid coefficient (n1) is always equal to zero. Does it mean that we are now systematically generating the infamous de-normalization exception within that DSP code ? Should we rewrite (simplify) the BPF combiner, avoiding referring to the variable (n1) that we have set to zero ?

Enjoy !

Steph

aliasant ·

This is very well put together.

Unfortunatly I dont have Office installed. Is there any freeware app that can replace Excel?

Andrew J ·

aliasant wrote: This is very well put together.

Unfortunatly I dont have Office installed. Is there any freeware app that can replace Excel?

Martin, try out OpenOffice. I don't think it would cope with any VB code in Excel spreadsheets, but it should be fine with ordinary formulas.

infuzion ·

I keep trying OpenOffice, & the long download, bloated install inc Java, & the extra Windows-startups weren't worth the occasional usage to me. So I use Google docs: http://docs.google.com I've even built wavetables for SM in it!

There are more better online office apps, most better at collaboration.

aliasant ·

I would never use a google app for anything. Misstrust them way to much for that. Guess Ill try that open office. Thanx both of yous =)

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.