3

I've recently become very interested in learning how to implement various audio filters in AS3. By intuitive guessing (and inspired by capacitors), I've managed to create what seems to be a 1st order high-pass filter, but I have no idea how to set its frequency (or Q) in a controlled way.

So I'd like to learn how to write parametric 2nd/4th order low-pass, hi-pass, bandpass filters from scratch. And I'm not very mathsy. Any practical, straightforward tutorials or textbooks out there which could help with this?

Partial credit for readable source code (in as3/c,etc), in lieu of a tutorial... (!)

Edit: Found a great site, www.musicdsp.org, with heaps of awesome code snippets, mostly in c/c++.

aaaidan
  • 7,093
  • 8
  • 66
  • 102
  • Just my $0.02: I love Flash, and work as an AS3 programmer now, but I've done DSP audio work in the past in C/C++ and asm for TMS320 chips, and I would suggest that you consider moving to C++ or another equally lower-level language for your experimentation with digital audio. AS3 just isn't the best environment, you need better access to audio data, more speed and better control over memory management to really play with audio. – Adam Smith Apr 03 '11 at 03:07

7 Answers7

6

The link you really want from MusicDSP is http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt

I also recommend getting Lyon's Understanding Digital Signal Processing. I am a bit biased, though, since I was a reviewer for the second edition (but I think a third edition came out recently).

Also check out Digital Audio Signal Processing and DAFX:Digital Audio Effects, both by Udo Zölzer.

mpdonadio
  • 2,891
  • 3
  • 35
  • 54
3

In addition to the great books and resources that others have mentioned, I also recommend some experimentation.

DSP is really a form of applied math. But if you are not the "mathsy" type, one thing you can do is write lots of unit tests for your filters. Feed your filters impulses, step functions, long sine waves at various frequencies, frequency sweeps, etc., and see what comes out the other end, what the filter actually does to these different types of signals. You can experimentally test formulas that might seem fairly opaque (at first) to you.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • Excellent idea with the unit tests! I imagine that will speed up experimentation and learning no end. – aaaidan Mar 10 '11 at 23:12
3

This is a great book to start with, especially considering that the entire text is online for free:

Introduction To Digital Filters With Audio Applications

Here are a couple links from the book that will probably help the most with understanding/applying the Audio EQ Cookbook that MPD posted: The BiQuad Section, Biquad Software Implementations

datageist
  • 999
  • 6
  • 17
2

I've just started reading MIT's The Audio Programming Book. I can't vouch for it yet, but it may be of interest.

Eric Brotto
  • 53,471
  • 32
  • 129
  • 174
1

There is no substitute for good text books on the subject of DSP. A classic is Hal Chamberlin's "Musical Applications of Microprocessors". See my answer to Where can I find low level Sound Programming Theory Tutorials for links to this and a couple of other useful books which are oriented more towards practical applications of DSP rather than the usual undergraduate DSP books which lean more towards theory.

Community
  • 1
  • 1
Paul R
  • 208,748
  • 37
  • 389
  • 560
0

Also, an excellent course of university lectures here, which take you from the basics of dsp. https://ccrma.stanford.edu/~jos/filters/

aaaidan
  • 7,093
  • 8
  • 66
  • 102
0

Another really great book that also is available online for free is the DSP Guide. It goes all the way from sampling theory to designing filters with arbitrary frequency response (and tons of other stuff). It's also written in a very clear way with good examples including example code to understand the concepts.

Thies Heidecke
  • 2,497
  • 1
  • 23
  • 25