Cut Subsonic and Ultrasonic Audio with FFmpeg
This guide explains how to remove inaudible high and low frequencies
from audio streams using FFmpeg's dedicated cut filters. It covers the
syntax and parameters for the asupercut filter to eliminate
ultrasonic frequencies, demonstrates how to combine it with
asubcut for complete subsonic removal, and provides
ready-to-use commands for optimizing audio quality and encoding
headroom.
Understanding asupercut and asubcut
Human hearing generally spans from 20 Hz to 20,000 Hz. Frequencies above 20 kHz (ultrasonic) and below 20 Hz (subsonic/infrasonic) can introduce unnecessary energy into audio files, causing headroom loss, intermodulation distortion, or inefficient compression.
In FFmpeg, frequency isolation at the extremes of the spectrum is split into two specialized Butterworth-style filters:
asupercut: A steep low-pass filter designed to attenuate ultrasonic frequencies above a specified threshold (default: 20,000 Hz).asubcut: A steep high-pass filter designed to attenuate subsonic frequencies below a specified threshold (default: 20 Hz).
To remove both subsonic and ultrasonic frequencies simultaneously,
you chain asubcut and asupercut together in
the audio filter graph.
Filter Parameters
The asupercut filter accepts the following options:
cutoff: Sets the cutoff frequency in Hertz. The default value is20000.order: Sets the filter order (steepness of the slope). Higher values produce a steeper attenuation curve. Values typically range from3to20, with the default set to10.level: Sets the input gain level (default is1.0).
The asubcut filter uses the identical parameter
structure, with its cutoff defaulting to 20
Hz.
Basic Command: Removing Subsonic and Ultrasonic Bands
To clean an audio file using the default thresholds (cutting below 20 Hz and above 20,000 Hz):
ffmpeg -i input.wav -af "asubcut,asupercut" -c:a flac output.flacCustomizing Cutoff Frequencies and Filter Steepness
You can explicitly set the cutoff frequency and filter order for tighter control over the spectrum. For example, to cut below 30 Hz and above 18,000 Hz with a steep 12th-order roll-off:
ffmpeg -i input.mp3 -af "asubcut=cutoff=30:order=12,asupercut=cutoff=18000:order=12" output.mp3Applying the Filters to Video Files
When processing a video file, pass the video stream untouched using
stream copying (-c:v copy) while filtering and re-encoding
the audio track:
ffmpeg -i input.mp4 -c:v copy -af "asubcut=cutoff=20:order=10,asupercut=cutoff=20000:order=10" -c:a aac -b:a 256k output.mp4