Skip to content

Allpass Filter

Tier: Primitives | ComponentType: 12 | Params: 3

Simple allpass and delay-based Schroeder allpass for phase rotation and reverb diffusion.

Overview

AllpassFilter operates in two modes. With delay < 0.5 samples, it acts as a simple first-order allpass that rotates phase without changing magnitude — useful for phaser effects when the coefficient is modulated. With delay >= 0.5 samples, it switches to a Schroeder allpass topology that combines a delay line with feedback, creating the decorrelated diffusion essential for reverb algorithms.

The Schroeder topology is the fundamental building block of Freeverb-style reverbs. Cascading multiple allpass stages with different delay times creates the dense, colorless decay characteristic of high-quality algorithmic reverb.

File Locations

Path
Header Sources/FolioDSP/include/FolioDSP/Primitives/AllpassFilter.h
Implementation Sources/FolioDSP/src/Primitives/AllpassFilter.cpp
Tests Tests/FolioDSPTests/AllpassFilterTests.swift
Bridge Sources/FolioDSPBridge/src/FolioDSPBridge.mm (AllpassFilterBridge)

Parameters

Index Name Description Min Max Default Min Default Max Default Unit
0 Coefficient Allpass pole location (simple mode) -0.999 0.999 -0.9 0.9 0.5
1 Delay Delay time in samples (>=0.5 enables Schroeder mode) 0.0 44100.0 1.0 5000.0 0.0 smp
2 Gain Feedback/feedforward gain (Schroeder mode) 0.0 0.99 0.0 0.7 0.5

Processing Algorithm

Simple Allpass (delay < 0.5)

\[y = -c \cdot x + \text{buf}\]
\[\text{buf} = x + c \cdot y\]

Transfer function: \(H(z) = \frac{-c + z^{-1}}{1 - c \cdot z^{-1}}\)

Schroeder Allpass (delay >= 0.5)

\[\text{delayed} = \text{buf}[\text{write} - d]\]
\[y = -g \cdot x + \text{delayed}\]
\[\text{buf}[\text{write}] = x + g \cdot y\]

Snapshot Fields

Field Type Range Unit Description
Coefficient Float -0.999–0.999 Current coefficient
Delay Float 0–44100 smp Current delay
Gain Float 0–0.99 Current gain
Input Float 0–1 Input amplitude
Output Float 0–1 Output amplitude

Implementation Notes

  • Delay buffer is 44100 samples (1 second at 44.1 kHz) with linear interpolation
  • Simple mode uses a single sample buffer (no delay line)
  • Coefficient close to +/-1.0 creates strong phase rotation
  • Schroeder topology: |gain| must be < 1.0 for stability

Equation Summary

y = -c·x + buf; buf = x + c·y