Low and High Shelf Filters in FFmpeg anequalizer

This guide explains how to approximate and configure low-shelf and high-shelf equalization curves using FFmpeg's anequalizer audio filter. Because anequalizer is an IIR multi-channel parametric equalizer built around high-order Butterworth and Chebyshev band-pass designs, shelving profiles are created by anchoring broad-bandwidth filters at the low and high frequency extremities of the audible spectrum.

Understanding the anequalizer Parameter Structure

The anequalizer filter accepts filter definitions separated by vertical bars (|). Each filter specification targets a channel and sets four primary parameters:

  • c0, c1, ...: The channel index to apply the filter to (c0 for left/mono, c1 for right).
  • f: Center frequency in Hertz.
  • w: Bandwidth/filter width in Hertz.
  • g: Gain boost or cut in decibels (dB).
  • t: Filter type curve:
    • 0: Butterworth (smoothest transition)
    • 1: Chebyshev Type 1
    • 2: Chebyshev Type 2

Configuring a Low-Shelf Response

Standard shelf filters boost or cut everything below a target cutoff frequency flatly. To emulate this in anequalizer, set the center frequency f close to the lowest boundary (typically 0 Hz or 20 Hz) and set the width w sufficiently wide to cover your intended shelf band:

ffmpeg -i input.wav -af "anequalizer=c0 f=20 w=160 g=6 t=0|c1 f=20 w=160 g=6 t=0" output.wav
  • f=20: Anchors the center near the sub-bass floor.
  • w=160: Expands the curve upward to roughly 180–200 Hz before rolling off.
  • g=6: Applies a +6 dB boost across the low-end region.
  • t=0: Uses a Butterworth curve to ensure the flattest passband without resonance ripples.

Configuring a High-Shelf Response

To create a high-shelf response, anchor the center frequency f at or near the upper limit of human hearing (e.g., 18,000 Hz to 20,000 Hz) with a wide bandwidth w expanding downward into the presence region:

ffmpeg -i input.wav -af "anequalizer=c0 f=18000 w=8000 g=-4 t=0|c1 f=18000 w=8000 g=-4 t=0" output.wav
  • f=18000: Centers the filter near the air/treble ceiling.
  • w=8000: Stretches the attenuation curve down toward roughly 10,000 Hz.
  • g=-4: Reduces high-frequency energy by -4 dB.
  • t=0: Provides a gradual, non-resonant slope.

Complete Example: Low-Shelf, Peak, and High-Shelf Chain

You can chain multiple bands together inside a single anequalizer call to build a complete mastering curve with low-shelf, mid-band, and high-shelf shaping for stereo audio:

ffmpeg -i input.mp3 -af "anequalizer=\
c0 f=30 w=150 g=4 t=0|\
c1 f=30 w=150 g=4 t=0|\
c0 f=1000 w=500 g=-2 t=0|\
c1 f=1000 w=500 g=-2 t=0|\
c0 f=16000 w=6000 g=3 t=0|\
c1 f=16000 w=6000 g=3 t=0" output.mp3

Using Dedicated Shelf Filters as an Alternative

If your application requires mathematically standard first- or second-order biquad shelf slopes rather than Butterworth/Chebyshev band approximations, FFmpeg provides dedicated lowshelf and highshelf filters. These can be chained alongside other audio filters:

ffmpeg -i input.wav -af "lowshelf=f=120:g=5:width_type=h,highshelf=f=10000:g=-3:width_type=h" output.wav

Use anequalizer when you need complex high-order slopes or unified channel-specific equalizing within one filter instance, and adjust f and w to define the boundary shelves.