Configure FFmpeg afftdn Noise Band Levels
This article explains how to configure custom noise band levels using
the FFmpeg afftdn (FFT De-noise) audio filter. You will
learn how to enable the custom noise type parameter and define specific
decibel (dB) offsets for individual frequency bands to target and
eliminate precise background noise profiles in your audio files.
Understanding the afftdn Filter and Noise Bands
The afftdn filter uses Fast Fourier Transform (FFT)
mathematical modeling to reduce noise in audio streams. By default, it
uses pre-configured noise profiles like white, pink, or brown noise.
However, when dealing with complex, non-uniform background noise (such
as drone hums, air conditioning, or specific electrical interference),
configuring custom noise bands is highly effective.
To define your own noise band levels, you must use two key parameters
in your filter string: 1. nt=c: Sets the
noise type (nt) to custom (c). 2.
bn: Defines the band noise
(bn) offsets as a space-separated string of up to 15
values, representing different frequency bands from low to high.
Step-by-Step Configuration
1. Set the Noise Type to Custom
Before your custom band values can be read, you must tell the filter to expect custom input instead of a preset profile:
afftdn=nt=c
2. Define the Band Noise
Offsets (bn)
The bn parameter accepts up to 15 space-separated values
in decibels (dB). These values act as offsets to the main noise floor
parameter (nf, which defaults to -50 dB).
The 15 bands correspond to the frequency spectrum, starting from the lowest frequencies (bass) on the left to the highest frequencies (treble) on the right.
For example, if you want to aggressively target low-frequency rumble while leaving high frequencies untouched, you would set higher offset values at the beginning of the string:
bn="10 8 6 4 2 0 -2 -4 -6 -8 -10 -12 -14 -16 -18"
3. Assemble the FFmpeg Command
Combine these parameters into your FFmpeg audio filter
(-af) argument.
Here is a practical command that applies a custom noise band profile to an audio file:
ffmpeg -i input.mp3 -af "afftdn=nt=c:bn='12 10 8 6 4 2 0 -2 -4 -6 -8 -10 -12 -14 -16'" output.mp3Fine-Tuning Your Custom Profile
To get the best results, you can pair your custom noise bands with
other afftdn parameters:
Noise Floor (
nf): Set the baseline noise floor level in dB (default is -50). The values in yourbnstring will be added to this baseline.afftdn=nt=c:nf=-45:bn='5 5 5 0 0 0 -5 -5 -5 -10 -10 -10 -15 -15 -15'Noise Reduction (
nr): Set the amount of noise reduction in dB (default is 12). If the audio sounds too artificial or “watery,” lower this value (e.g., tonr=10ornr=8).afftdn=nt=c:nr=10:bn='0 -2 -4 -6 -8 -10 -12 -14 -16 -18 -20 -22 -24 -26 -28'