Cut Subsonic and Ultrasonic Audio with FFmpeg
Audio files often contain subsonic and ultrasonic frequencies that
are inaudible to human ears but can negatively impact overall sound
quality, headroom, and compression efficiency. This article provides a
straightforward guide on how to use the asupercut filter in
FFmpeg to eliminate these unwanted low- and high-frequency extremes,
helping you clean up your audio tracks using simple command-line
examples.
Understanding the asupercut Filter
The asupercut filter is a specialized FFmpeg audio
filter designed to cut off frequencies at both ends of the human hearing
spectrum. By default, human hearing ranges roughly from 20 Hz to 20,000
Hz (20 kHz). Frequencies below 20 Hz (subsonic) and above 20,000 Hz
(ultrasonic) cannot be heard but still consume digital headroom and
energy. Removing them allows your audible audio to sound cleaner and
compress more efficiently.
Basic Syntax and Parameters
The basic syntax for applying the filter in an FFmpeg command is:
ffmpeg -i input.wav -af asupercut output.wavThe filter accepts several parameters to customize the cutoff thresholds:
cutoff_f(orf): Sets the subsonic cutoff frequency in Hz. The default is 20 Hz. Frequencies below this value will be filtered out.cutoff_f2(orf2): Sets the ultrasonic cutoff frequency in Hz. The default is 20000 Hz. Frequencies above this value will be filtered out.order: Controls the filter order (steepness of the cutoff slope). The default is 10. Higher values create a steeper, more aggressive cut.level: Sets the input level (gain) multiplier. The default is 1.0.
Practical Command Examples
1. Using Default Settings
To quickly clean up an audio file using the standard human hearing limits (20 Hz to 20,000 Hz), run the following command:
ffmpeg -i input.mp3 -af asupercut output.mp32. Customizing Cutoff Frequencies
If you want to apply a more aggressive cut—for example, removing everything below 40 Hz (common for voice recordings to remove low-end rumble) and everything above 18,000 Hz:
ffmpeg -i input.wav -af "asupercut=cutoff_f=40:cutoff_f2=18000" output.wav3. Adjusting the Filter Order (Slope)
If you want a sharper, steeper cutoff at the specified frequency
thresholds, increase the order parameter (e.g., to 16):
ffmpeg -i input.wav -af "asupercut=cutoff_f=30:cutoff_f2=19000:order=16" output.wavUsing these configurations, you can easily optimize your audio files for streaming, broadcasting, or archiving by ensuring no digital bandwidth is wasted on inaudible frequencies.