About allpass filter algorithms

Algorithm development and general DSP issues

Moderator: frank

Post Reply
tkamogashira
Posts: 1
Joined: Sun Jan 09, 2011 9:19 pm

About allpass filter algorithms

Post by tkamogashira »

Hi,

I am now developing dsp libraries (called freeverb3) and coding some dsp processings.
Some allpass algorithms in some implementations are different from each other.
It seems that the figure on the SpimSemi's site
Image
is the corrent signal flow, but some figures on some sites draw strange pictures like this.
Image

http://www.gersic.com/dspwiki/index.php ... erberation
shows the same strange allpass filter figure.
Image
In addition, the original freeverb's allpass filter's code looks strage

Code: Select all

inline float allpass::process(float input)
{
        float output;
        float bufout;
        bufout = buffer[bufidx];
        undenormalise(bufout);
        output = -input + bufout;
        buffer[bufidx] = input + (bufout*feedback);
        if(++bufidx>=bufsize) bufidx = 0;
        return output;
}
I think that the correct algorithm is like this:

Code: Select all

inline float process(float input)
{
  float output;
  float bufout = buffer[bufidx];
  undenormalise(bufout);
  buffer[bufidx] = input + bufout * feedback;
  output = bufout - buffer[bufidx] * feedback;
  bufidx ++; if(bufidx >= bufsize) bufidx = 0;
  return output;
}
The original code in the freeverb source seems to be just an 1st order IIR plus minus feedforward loop.

The site on NATIONAL INSTRUMENTS shows some optimized version of allpass filter.
http://zone.ni.com/reference/en-XX/help ... e_allpass/

I would like to know why there are so many implementations, some of which seems strange.

Thank you.

Teru
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Not sure why there are different versions. Maybe the way people solved for the transform to z domain? Will have to try to look into it.
Frank Thomson
Experimental Noize
seancostello
Posts: 74
Joined: Mon Sep 11, 2006 10:04 pm

Post by seancostello »

The drawing from the Spin Semi site is a Direct Form II allpass filter, while the figure from the sites you cite is a Transposed Direct Form II allpass topology:

https://ccrma.stanford.edu/~jos/filters ... Forms.html

The Transposed Direct Form II topology has much better performance in fixed point. This is due to the feedforward path being computed first, which results in lower internal gains, and thus less distortion. However, it takes 5 cycles on the FV-1, as opposed to 2 cycles for the standard allpass delays.

On the same CCRMA site, Julius Smith claims that the Freeverb allpasses are not really allpass. I haven't done research into this myself, as I prefer other reverb topologies, but Julius Smith tends to be pretty correct about this sort of thing.

The lattice allpasses from the National Semiconductor site are the same as nested allpasses - again, Julius Smith's website at CCRMA has useful information about these. The standard lattice topology corresponds to Direct Form II, but you can rearrange things for Transposed Direct Form II without too much of a problem.

This in no way encompasses the wide variety of allpass topologies that can be used in reverbs. You can have allpass feedback delay networks, allpasses with filters inside, allpasses with filters in the feedback and feedforward loops that are conjugates of each other, parallel allpasses where the feedback and feedforward loops are coupled together...

Sean Costello
Post Reply