Distance-Based Amplitude Panning (DBAP) — User Guide

Applies Distance-Based Amplitude Panning (DBAP) to a multi-channel Sound object by calculating gain for each channel based on the spatial relationship between an audio source and multiple speaker positions.

Category: Spatialization / Processing Praat Script: Distance-Based Amplitude Panning (DBAP).praat
Contents:

What this does

This Praat script implements Distance-Based Amplitude Panning (DBAP), a common spatial audio technique. DBAP determines the gain for each channel (speaker) by calculating the inverse distance between the virtual audio source position and each virtual speaker position. This process simulates the natural decay of sound amplitude over distance.

The core process involves:

DBAP Theory

DBAP is a technique for positioning virtual sound sources in a loudspeaker array by calculating amplitude gains. It is highly flexible and works well with non-standard or irregular speaker setups, unlike traditional vector-based amplitude panning (VBAP).

The key parameters are:

Quick start

  1. In Praat, select exactly one multi-channel Sound object. The number of channels must match the number of speakers in the chosen preset.
  2. Run script…Distance-Based Amplitude Panning (DBAP).praat.
  3. Select a Preset (e.g., "Quad Setup").
  4. Set the Source X and Source Y coordinates (if using "Custom Coordinates" or if the preset allows modification).
  5. Click OK.
  6. The output object, named [OriginalName]_DBAP_[PresetName], is created and plays automatically.

Parameters (form fields)

Name (GUI)TypeDefaultDescription
presetoptionmenuDefault MidpointSelects a predefined speaker configuration, source position, and number of speakers.
normalize\_gainsboolean1 (checked)If checked, the gains are normalized so the total acoustic power is preserved. Highly recommended.
distance\_exponentreal1.0Controls the rate of amplitude decay over distance. A value of 1.0 (linear inverse distance) or 2.0 (inverse square law) are common values.
minimum\_distancereal0.01A small value used to prevent a division-by-zero error if the source is exactly on top of a speaker.
show\_gain\_valuesboolean0 (unchecked)If checked, prints the calculated gain for each speaker to the Info window.
source\_x / source\_yreal0.5 / 0.5The virtual X and Y coordinates of the sound source. Used with the 'Custom Coordinates' preset.
number\_of\_speakersnatural2The number of channels/speakers to process. This value is overwritten by the chosen preset unless 'Custom Coordinates' is selected.
speaker\_1\_x... speaker\_6\_yrealVariousThe virtual X and Y coordinates for up to 6 speakers. These values are overwritten by the chosen preset.

Presets and Channel Requirements

The script includes several presets that pre-configure the source and speaker coordinates. It is critical that the number of channels in the selected Sound object matches the channel requirement of the chosen preset.

Preset NameChannelsDescription
Default Midpoint2Source positioned centrally (0.5, 0.5) between two speakers at (0, 0) and (1, 0).
Close to Speaker 12Source slightly off-center near speaker 1, with speakers at (0, 0) and (2, 0).
Triangle Setup3Source centered inside a triangular array of speakers.
Quad Setup4Source centered inside a rectangular quad array of speakers.
Surround 5.16Simulates a standard 5.1-like layout (6 speakers).
Hexagon Array6Speakers arranged in a hexagonal pattern around the source.
Custom Coordinates2-6Allows manual input of source and speaker coordinates. The number of speakers (up to 6) is set by the number_of_speakers field.
Hard Left / Hard Right2Extreme source positions for hard panning effects in stereo.
Ultra Wide2Stereo panning where the speakers are virtually placed outside the standard range.
Nearfield Center2Source placed centrally (0.5, 0.2) in a close-range stereo setup.

Outputs