Skip to content

Formant Filters, Part II

March 13, 2012

A few days ago, I posted  a pair of bandpass/stop filters to the Downloads page. Today I’ll show how several of these filters can be used to make a proper formant filter.

A formant filter is simply a series of bandpass filters that can be used to shape an input into a vowel-like sound. The first thing I did was to search for a table with the frequencies to use in this type of filter. The web is full of such documents – I chose this one because it has 5 formants for each sound, whereas many charts have only 3. The filters can either be parallel or serial, but making a serial filter is both easier and more efficient so I went that route – using parallel filters requires each filter to have an amplitude control, and you have to mix the signals together at the end.

Serial filter configuration

Since we’re going the serial filter route, we can actually ignore the Amp settings from the table altogether and simply use the Freq and Bandwidth values. I entered all of these values into core tables to be controlled by a knob. Thus, you can use a single knob to control all 10 parameters (5 Frequency and 5 Bandwidth controls). Simply select a vowel with the knob and it loads up the correct values.

I duplicated this value loading macro, so you can choose two vowels, and added a position knob to morph between them. This sounded good while the vowel knobs were stationary, but if you moved one while a sound was playing the Freq and BW values could change drastically, making a terrible squealing sound. To solve this problem I gutted the filters and moved the bulk of the math to an Event Core Cell, and streamed the values into the filters with the use of a smoother like so:

Smoothing the coefficients

The filter works best with sounds containing a lot of harmonics – a saw wave seems ideal to my ears. To get a good sound you want to be automating at least one parameter, here’s a quick sample of a saw wave running thru this filter (no other processing done to the signal).

Download the filter here.

3 Comments leave one →
  1. meter maid permalink
    March 13, 2012 12:28 pm

    Fantastic. This will get plenty of use.

  2. October 12, 2012 5:40 pm


    I’ve undone the consolidation of your filter design so that it isn’t arranged between two stationary Gender/Vowel pairs with a crossfader between them anymore; I’ve attempted what it sounds like your original thinking was in terms of the interface:

    Vowels and Genders are now broken apart into two faders, A/E/I/O/U, and SOPRANO/ALTO/COUNTERTENOR/TENOR/BASS, respectively. The idea is that they’ll eventually be an XY or something of the sort.

    The array tables of the values for the formant frequencies and their respective bandwidths have been replaced with a Selector with five constants as its inputs, controlled by a knob, since you can’t knob-interpolate a table of integers. Switching Vowels within any stable Gender fader position (whole integers) sounds fine, but any intercalary stage between Genders (i.e. 0.5, halfway between SOPRANO and ALTO) is horrendously resonant.

    The current configuration of my Instrument has employed most of the alternative ideas I could think of to try and subvert this effect, but it appears to be the byproduct of the output of the Klatt resonator/antiresonator biquad filter design. I generally left the “coefficient generation” part of the Instrument structure as a black box, since that’s hardcore DSP/Core stuff. So, I have no further insight into the problem.

    Do you agree that the formant-purpose-built serial Klatt filter design is the reason that this interface arrangement isn’t possible? Do you have any ideas for hacky workarounds? My current idea is basically just to shelve the crap out of everything above maybe 1KHz the further the slider of the Gender fader is away from an integer… but that will probably sound even poopier. You used the Csound Formant table because of its high precision, and that fix would be throwing that away entirely.

    • October 12, 2012 6:18 pm

      Hi Nick, I’ll be happy to take a quick look at your code if you like.
      If you don’t want to post it here you can find my e-mail address on the ‘About’ page.
      It doesn’t seem like your way of generating formants should be substantially different than the one I made, but I can’t tell for sure without taking a look. Also I should point out that my design occasionally suffers from terribly loud resonance as well.
      Good luck.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: