i’ve been trying to denoise a clip using the afftdn filter using the band_noise argument since if a microphone always has the same noise pattern, then i should be able to run the sn start; sn stop commands only once, grab their band noise output from ffmpeg stdout, and then use it as input when denoising a clip from the same microphone.
I’m running ffmpeg through WSL installed with apt, here is the bash code:
# Grab noise bands config
ffmpeg -hide_banner -loglevel info -i noise_sample_mono.opus
-af "asendcmd=c='0.0 afftdn@n sn start; 8.0 afftdn@n sn stop',afftdn@n"
-b:a 224k test-$(date -u +%s).opus 2>&1 | grep -P "bn=[.d- ]+"
# bn=16.286351 18.080845 17.608579 15.503724 12.311549 8.488413 4.401767 0.330158 -3.536777 -7.098305 -10.342602 -13.346751 -16.276741 -19.387470 -23.022740
# Remove noise based on extracted band noise
audio_filter="afftdn=noise_type=custom
:band_noise=16.286351 18.080845 17.608579 15.503724 12.311549 8.488413 4.401767 0.330158 -3.536777 -7.098305 -10.342602 -13.346751 -16.276741 -19.387470 -23.022740
:noise_reduction=80
:adaptivity=0.5
:noise_floor=-20
:output_mode=output
"
echo;
echo "Applying audio filter: $audio_filter";
echo;
ffmpeg -hide_banner -loglevel info -i noise_sample_mono.wav -af "$audio_filter" -b:a 224k test-$(date -u +%s).wav;
No matter what parameters I give to the afftdn filter, it seems to make at most only a very small difference, if i give noise_type=white, i get much better results, which is odd, since these band noise values should describe the exact noise in this clip much better than a generic white noise algorithm.
I don’t know what I’m doing wrong, any help would be appreciated.
The 10 second noise clip: google drive link