Convert White Noise to Pink Noise with FFmpeg Tilt

This article provides a quick guide on how to generate pink noise from white noise using the FFmpeg tilt audio filter. You will learn the exact command-line syntax to generate white noise and apply a -3 dB per octave spectral tilt to achieve high-quality pink noise for acoustic testing, sound masking, or audio production.

Why Use the Tilt Filter for Pink Noise?

White noise contains equal energy per hertz across the entire frequency spectrum, which can sound harsh to the human ear. Pink noise, on the other hand, contains equal energy per octave, meaning its power spectral density decreases at a rate of 3 dB per octave.

FFmpeg's tilt filter is an efficient tool for this conversion because it allows you to apply a precise spectral slope to an audio signal. By applying a slope of -3 dB/octave to a white noise source, you successfully filter it into pink noise.

The FFmpeg Command

To generate white noise and apply the pinking filter in a single command, run the following:

ffmpeg -f lavfi -i "anoisesrc=color=white:duration=10:sample_rate=48000" -af "tilt=slope=-3" pink_noise.wav

Command Breakdown

  • -f lavfi: Tells FFmpeg to use the Libavfilter input virtual device to generate the source audio.
  • -i "anoisesrc=color=white:duration=10:sample_rate=48000": Generates 10 seconds of white noise at a 48 kHz sample rate.
  • -af "tilt=slope=-3": Applies the audio filter (-af). The tilt filter's slope parameter is set to -3 to reduce the high frequencies by 3 dB per octave, transforming the white noise into pink noise.
  • pink_noise.wav: The resulting high-quality pink noise output file.

Filtering an Existing Audio File

If you already have a white noise audio file and want to apply the pinking filter to it, use this command:

ffmpeg -i white_noise.wav -af "tilt=slope=-3" pink_noise.wav

This reads your existing white_noise.wav file, applies the -3 dB/octave tilt, and exports the processed audio as a new file.