<commit_before>% Template: LaTeX file for ICMC 2009 papers, with hyper-references
%
% derived from the DAFx-06 templates
%
% 1) Please compile using latex or pdflatex.
% 2) Please use figures in vectorial format (.pdf); .png or .jpg are working otherwise 
% 3) Please use the "papertitle" and "pdfauthor" commands defined below

%------------------------------------------------------------------------------------------
\documentclass[twoside,10pt]{article}
\usepackage{icmc2009,amssymb,amsmath} 
%\setcounter{page}{1}

\usepackage{mathptmx} 

%____________________________________________________________
%  !  !  !  !  !  !  !  !  !  !  !  ! user defined variables  !  !  !  !  !  !  !  !  !  !  !  !  !  !
%==== set the title ====
\def\papertitle{DBAP - Distance-based amplitude panning}
%\def\papertitle{}	%-- should be empty for the submission anyway!

%==== 1st submission: author name and affiliation are empty for anonymous submission ====
%\def\paperauthorA{} 
%\affiliation{}{}


%==== final submission: author name and affiliation ====
%---- uncomment 1 to 4 lines, for 1 to 4 authors
\def\paperauthorA{<NAME>}
\def\paperauthorB{<NAME>}
\def\paperauthorC{<NAME>}
%\def\paperauthorD{Fourth Author}

%%---- set correspnding affiliation data for...
%%-- 1 author
%\affiliation{\paperauthorA}
%  {School\\ Department, City, Country \\ {\tt \href{mailto:<EMAIL>}{<EMAIL>}}}

%%-- 2 authors with same affiliation
%\affiliation{\paperauthorA, \paperauthorB}
%  {School\\ Department, City, Country \\ {\tt \href{mailto:<EMAIL>}{<EMAIL>}}}

%-- 2 authors with different affiliations
%\twoaffiliations{\paperauthorA}{School\\ Department}
%  {\paperauthorB}{Company\\ Address}

%%-- 3 authors with different affiliations
\threeaffiliations{\paperauthorA}{BEK\\C. Sundtsgt. 55\\5004 Bergen\\Norway\\<EMAIL>}
  {\paperauthorB}{GMEA\\4 rue <NAME>\\81000 Albi\\France\\<EMAIL>}
  {\paperauthorC}{GMEA\\4 r<NAME>\\81000 Albi\\France\\<EMAIL>}

%%-- 4 authors with different affiliations
%\fouraffiliations{\paperauthorA}{School A\\ Department X}
%  {\paperauthorB}{Company\\ Address}
%  {\paperauthorC}{School B\\ Department Y}
%  {\paperauthorD}{School C\\ Department Z}

%  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^ user defined variables  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^ 
%------------------------------------------------------------------------------------------

%%-- if using .ps or .eps figure files, they will be converted on the fly
%%-- RMK: for faster LaTeX runs, use it only once after adding new \includegraphics[]{} cmds
%\usepackage{epstopdf}	 

%---- the hyperref package must be last to properly work
\usepackage[pdftex,
       pdftitle={\papertitle},
	pdfauthor={\paperauthorA},
	colorlinks=false,bookmarksnumbered,pdfstartview=XYZ]{hyperref}
%\pdfcompresslevel=9
\usepackage[pdftex]{graphicx}	% for compatible graphics with hyperref
\usepackage[figure,table]{hypcap}	% corrects the hyper-anchor of figures/tables

\title{\papertitle}

%------------------------------------------------------------------------------------------
\begin{document}

\DeclareGraphicsExtensions{.png,.jpg,.pdf} % used graphic file format for pdflatex
    
\maketitle




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Abstract
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



% TODO: Write abstract!
% TODO: Tim notes the spelling of spatialisation, instead of spatialization -- probably the latter is preferred?
% TODO: Tim notes the use of the phrase "in terms of" a lot in this paper.  Too much.  This terminology should be limited to mathematical descriptions, and not aesthetic or perceptual issues.

\begin{abstract}
The abstract should be placed at the top left column and should contain
about 150 words.
\end{abstract}








%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Introduction
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\section{Introduction}\label{sec:introduction}

Multichannel and surround sound reproduction is becoming more common, both for consumer applications as well as for musical and artistic purposes. A number of techniques exist for virtual positioning of sound sources using an array of loudspeakers.  Techniques for spatialisation commonly assume that the position of a listener is known and fixed, and that the speakers are surrounding the listener either on a two-dimensional ring or a three-dimensional sphere. Examples of such speaker layouts and spatialisation techniques are stereo panning, 5.1-channel surround \cite{ITU:1993_surround_5:1}, further extended industrial multichannel configurations \cite{Rumsey:2001spatial_audio}, vector-based amplitude panning (VBAP) \cite{Pulkki:1997vbap}, as well as both first-order and higher-order ambisonics \cite{Gerzon:1974surround, Poletti:2000holographic_sound}.

Wave field synthesis (WFS) is a noticeable exception to the aforementioned ``sweet spot'' restriction, reproducing signals resulting in a large listening area. The spatial properties of the acoustical scene can be perceived correctly by an arbitrarily large number of listeners regardless of their position inside this area \cite{Spors:2004sound_field_synthesis}.

A number of practical limitations tend to restrict what spatialisation techniques are feasible for musical and artistic use.

% TODO: Tim thinks this is sentence is very awkward.
Unless working on a site providing a permanent setup for wave field synthesis, the high number of loudspeakers required might render WFS impractical for financial reasons as well as time constraints.

% TODO: Tim asks " do you always need to say 'first and higher order ambisonics'? " -- it seems strange and is grammatically awkward.  Can you just use "ambisonics" ?  You already said first and higher once before...
For real-time music and sound purposes, the relatively low CPU requirements of matrix-based spatialisation techniques seem to make them popular choices. 
VBAP as well as first and higher order ambisonics are readily available for use in common software environments for real-time processing such as Max/MSP \cite{Pulkki:2000vbap_max, Schacher:2006ambi_max, Neukom:2008ambipan}.

Among the requirements imposed by VBAP and ambisonics, are that the listeners are restricted to a relatively small listening area surrounded by loudspeakers.  These requirements might be unfeasible or undesired in practical applications.  In the ideal concert situation the entire audience should have a detailed impression of the spatial content of the music, not limiting the impression to those sitting in the middle of the concert hall. In a sound installation context one might want the audience to be able to move around the space \cite{lossius:2008installations}.  Finally, for pragmatic and/or artistic reasons it might not be possible or desired to have loudspeakers arranged in a ring or a sphere.

% CHANGED: Tim capitalized the DBAP words -- if not desired, feel free to undo it
Distance-Based Amplitude Panning (DBAP) is a matrix-based spatialisation technique that takes the actual positions of the speakers in space as the point of departure, while making no assumptions as to where the listeners are situated. This makes DBAP useful for a number of real-world situations including music for concerts, works for stage, installations, and museum sound design where predefined geometric speaker layouts might not apply.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Fundamentals
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Distance-based amplitude panning}

\subsection{Fundamentals}

% TODO: Tim changed the capitalization above -- but here it is again.  They should be the same, so what should it be?
% CHANGED: Tim changed a couple of places where the word 'setup' was used.  This is a bit colloquial.  I replaced it with the word 'model'.  Discard or consider as appropriate. 

\textit{Distance-based amplitude panning (DBAP)} extends the principle of equal intensity panning from a pair of speakers to a loudspeaker array of any size, with no \textit{a priori} assumptions about their positions in space or relative to each other.
For simplicity, the method will be discussed in terms of a two-dimensional model with speakers and sources all positioned in the same horizontal plane. This can be readily extended to three dimensions.

The position of a virtual source will be described in terms of Cartesian coordinates $(x_{s}, y_{s})$. For a model with $N$ speakers, the position of the $i$th speaker is given as $(x_{i}, y_{i})$. The distance from a source to each of the speakers can then be calculated as

\begin{equation} \label{eq:distance}
d_{i} = \sqrt{ {(x_{i} - x_{s})}^2 + {(y_{i} - y_{s})}^2 } \qquad \textrm{for } 1 \leq i \leq N \textrm{ .}
\end{equation}

For simplicity, the source is presumed as having unity amplitude. DBAP then makes two assumptions. The first is that intensity is to be constant regardless of the position of the virtual source. This can be considered an extension of the principle of constant intensity panning for stereo to multichannel setups. If the amplitude of the $i$th speaker is $v_{i}$, this implies

\begin{equation} \label{eq:constant_intensity}
I = \sum_{i=1}^{N} {v_{i}}^2 = 1
\end{equation}

Secondly, it is assumed that all speakers are active at all times, and the relative amplitude of the $i$th speaker depends on the distance from the virtual source as 

\begin{equation} \label{eq:inverse_distance}
v_{i} = \frac{k}{2 d_{i} a} 
\end{equation}

% TODO: Tim notes that 'depending' isn't quite the right word in this sentence.  In both places it should be a different word (not certain about the replacement yet)
% TODO: Maybe the correct work is 'calculated from' ?
where $k$ is a coefficient depending on the position of the source and all speakers, while $a$ is a coefficient depending on the rolloff $R$ in decibels per doubling of distance:

\begin{equation} \label{eq:rolloff}
	a = 10^{\frac{-R}{20}}
\end{equation}

A rolloff of $R = 6$ dB equals the inverse distance law for sound propagating in a free field. For closed or semiclosed environments $R$ will generally be lower, in the range 3-5 dB, and depending on reflections and reverberation \cite{Everest:2000handbook_acoustics} (pp. 84-88). In these circumstances (\ref{eq:rolloff}) represents a simplified description of attenuation with distance, but simulation of reflections and reverberation is anyway beyond the scope of an amplitude-panning based spatialisation method.

%The second is based on the inverse distance law for sound pressure for sound propagating in free field as discussed in section \ref{distance_hearing}. DBAP applies an adaption of this by assuming that the relative amplitude for each speaker is inversely proportional to the distance from source to speaker:

Combining equations (\ref{eq:constant_intensity}) and (\ref{eq:inverse_distance}) $k$ can be found as:

\begin{equation} \label{eq:calculate_k}
k = \frac{2a}{\sqrt{\sum_{i=1}^{N} \frac{1}{{d_{i}}^2}}}
\end{equation}




\subsection{Spatial blur}

If the virtual source is located at the exact position of one of the loudspeakers, (\ref{eq:calculate_k}) will cause a division by zero. Combining equations (\ref{eq:inverse_distance}) and (\ref{eq:calculate_k}) we get

\begin{equation}
v_{j} = \frac{1}{\sum_{i=0}^{N} \frac{{d_{j}}^2}{{d_{i}}^2}}
\end{equation}

From this it can be shown that

\begin{equation} \label{eq:distance_zero}
\lim_{d_{j} \rightarrow 0} v_{i} = 
\left\{ \begin{array}{ll} 
1 & \textrm{if $i=j$}\\ 
0 & \textrm{if $i \ne j$}
\end{array} \right.
\end{equation}

When the virtual source is located at the exact position of one of the loudspeakers, only that speaker will be emitting sound. This may cause unwanted changes in spatial spread and coloration of a virtual source in a similar way as observed for VBAP \cite{Pulkki:1999vbap}. To adjust for this a similar solution can be provided by introduction of a degree of \textit{spatial blur} $r_{s} \ge 0$ in equation (\ref{eq:distance}):

\begin{equation} \label{eq:mod_distance}
d_{i} = \sqrt{ {(x_{i} - x_{s})}^2 + {(y_{i} - y_{s})}^2 + {r_{s}}^2}
\end{equation}

The blur coefficient $r_{s}$ can be understood as a displacement in vertical position introduced between the source and the speakers, as if the speakers are positioned at $z_{i}=0$ while the vertical position of the source is $z_{s}=r_{s}$. The larger $r$ gets, the less the source will be able to gravitate towards one speaker only. There should be a potential for using this artistically to create contrasts between highly articulated or diffuse spatial positioning of sources.  There is a limitation, however, to how blurred the sources can be perceived.  While all speakers will approach the same level as $ r_{s} \rightarrow \infty $, practical experience indicates that the precedence effect will come into play, causing the perceived direction of the source to gravitate towards the speaker(s) closest to the listener \cite{Litovsky:1999precedence_effect}.

% TODO: Discuss variance



\subsection{Sources positioned beyond the field of speakers}

%TODO: Tim asks "should you be saying speaker or loudspeaker?"

The presuppositions upon which DBAP is based do not hold true when sources move outside of the field of speakers. As the distance of a source position from a speaker increases, the relative difference in distance from source to each of the speakers diminishes, resulting in progressively less difference in levels between the speakers.  This occurs in much the same manner as discussed for spatial blur in the previous subsection. To compensate for this, additional steps needs to be taken when the source moves outside the field of speakers.

From the description of loudspeaker positions the \emph{convex hull} of the field of speakers is calculated. In two dimensions the convex hull ``is the shape taken by a rubber band stretched around nails bounded into the plane at each point'' \cite{Rourke:1998_geometry}.

For each source position it is first determined if the source is outside the hull or not. If it is inside or on the boundary no additional steps needs to be taken. If the source is positioned outside the convex hull, the projection of the point onto the boundary of the hull is calculated, defined as the point on the boundary with the shortest possible distance to the source. The source position is then substituted for the projected point on the hull in subsequent DBAP calculations. In addition, the distance from the source position to the convex hull is returned. This value can be used for optional added spatial processing such as gain attenuation, air filtering, doppler effect, or gradual introduction of reverb with increasing distance from the hull.




\subsection{Extending DBAP by introducing spatial weights}

In the discussions so far the DBAP algorithm has dealt with the speakers in a transparent way, aiming at reproducing virtual sound sources in the best way possible without any further considerations for any loudspeaker properties apart from position.

The extension of DBAP by introduction of a spatial weight $w_{i}$ in equation \ref{eq:inverse_distance} enables a source to be restricted to use a subset of speakers:

\begin{equation} \label{eq:inverse_distance_weighed}
v_{i} = \frac{k w_{i}}{2 d_{i} a} 
\end{equation}

Equation \ref{eq:calculate_k} will now be modified to:

\begin{equation} \label{eq:calculate_k_weighted}
k = \frac{2a}{\sqrt{\sum_{i=1}^{N} \frac{{w_{i}}^2}{{d_{i}}^2}}}
\end{equation}

This might offer several artistic possibilities. Within the tradition of the acousmonium \cite{Bayle:1993MusiqueAcousmatique} a large number of speakers are used, sorted in several groups with different qualities and characteristics, thus allowing a scripting of sound space according to the spectral content of the projected music \cite{Prager:2002acousmatique}. If the loudspeaker setup consists of different kinds of speakers with differing spectral properties, they can be thought of as an orchestra of speakers and be organized into different instrumental groups. Spatial weights can then be used to ensure that a source is spatialised among members of one group only. This allow a timbral and spatial orchestration to be prepared or composed prior to performance, and then be adjusted to the specific room used for playback \cite{Lyon:2008spatial_orchestration}. 

In installations or museum spaces spatial weights can also be used to confine sources to restricted areas. For instance one source can be diffused in one room only while another source with a different set of spatial weights might be permitted to move between several or all rooms.

Spatial weights can be changed dynamically, thus allowing smooth transitions from one state to another. 

This weight parameter, after being submitted to listening tests and visualization (as described below in \ref{sec:visual_representation}), showed up as being more of a spatial weight for each loudspeaker, or rather a spatial ``sharpness'' of the localization of each loudspeaker. This parameter, though, needs further research and listening tests, in laboratory and artistic contexts for a better understanding of its perceptual effect.

The authors are also looking forward to obtaining a better numerical representation of this parameter, in particular of its range and transfer function, as well as to achieve a management of the interdependence of all weights, in order to make its manipulation more intuitive for the user.



<commit_msg>initial proofing of 2.4<commit_after>% Template: LaTeX file for ICMC 2009 papers, with hyper-references
%
% derived from the DAFx-06 templates
%
% 1) Please compile using latex or pdflatex.
% 2) Please use figures in vectorial format (.pdf); .png or .jpg are working otherwise 
% 3) Please use the "papertitle" and "pdfauthor" commands defined below

%------------------------------------------------------------------------------------------
\documentclass[twoside,10pt]{article}
\usepackage{icmc2009,amssymb,amsmath} 
%\setcounter{page}{1}

\usepackage{mathptmx} 

%____________________________________________________________
%  !  !  !  !  !  !  !  !  !  !  !  ! user defined variables  !  !  !  !  !  !  !  !  !  !  !  !  !  !
%==== set the title ====
\def\papertitle{DBAP - Distance-based amplitude panning}
%\def\papertitle{}	%-- should be empty for the submission anyway!

%==== 1st submission: author name and affiliation are empty for anonymous submission ====
%\def\paperauthorA{} 
%\affiliation{}{}


%==== final submission: author name and affiliation ====
%---- uncomment 1 to 4 lines, for 1 to 4 authors
\def\paperauthorA{<NAME>}
\def\paperauthorB{<NAME>}
\def\paperauthorC{<NAME>}
%\def\paperauthorD{Fourth Author}

%%---- set correspnding affiliation data for...
%%-- 1 author
%\affiliation{\paperauthorA}
%  {School\\ Department, City, Country \\ {\tt \href{mailto:<EMAIL>}{<EMAIL>}}}

%%-- 2 authors with same affiliation
%\affiliation{\paperauthorA, \paperauthorB}
%  {School\\ Department, City, Country \\ {\tt \href{mailto:<EMAIL>}{<EMAIL>}}}

%-- 2 authors with different affiliations
%\twoaffiliations{\paperauthorA}{School\\ Department}
%  {\paperauthorB}{Company\\ Address}

%%-- 3 authors with different affiliations
\threeaffiliations{\paperauthorA}{BEK\\C. Sundtsgt. 55\\5004 Bergen\\Norway\\<EMAIL>}
  {\paperauthorB}{GMEA\\4 rue <NAME>\\81000 Albi\\France\\<EMAIL>}
  {\paperauthorC}{GMEA\\4 rue <NAME>\\81000 Albi\\France\\<EMAIL>}

%%-- 4 authors with different affiliations
%\fouraffiliations{\paperauthorA}{School A\\ Department X}
%  {\paperauthorB}{Company\\ Address}
%  {\paperauthorC}{School B\\ Department Y}
%  {\paperauthorD}{School C\\ Department Z}

%  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^ user defined variables  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^  ^ 
%------------------------------------------------------------------------------------------

%%-- if using .ps or .eps figure files, they will be converted on the fly
%%-- RMK: for faster LaTeX runs, use it only once after adding new \includegraphics[]{} cmds
%\usepackage{epstopdf}	 

%---- the hyperref package must be last to properly work
\usepackage[pdftex,
       pdftitle={\papertitle},
	pdfauthor={\paperauthorA},
	colorlinks=false,bookmarksnumbered,pdfstartview=XYZ]{hyperref}
%\pdfcompresslevel=9
\usepackage[pdftex]{graphicx}	% for compatible graphics with hyperref
\usepackage[figure,table]{hypcap}	% corrects the hyper-anchor of figures/tables

\title{\papertitle}

%------------------------------------------------------------------------------------------
\begin{document}

\DeclareGraphicsExtensions{.png,.jpg,.pdf} % used graphic file format for pdflatex
    
\maketitle




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Abstract
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



% TODO: Write abstract!
% TODO: Tim notes the spelling of spatialisation, instead of spatialization -- probably the latter is preferred?
% TODO: Tim notes the use of the phrase "in terms of" a lot in this paper.  Too much.  This terminology should be limited to mathematical descriptions, and not aesthetic or perceptual issues.

\begin{abstract}
The abstract should be placed at the top left column and should contain
about 150 words.
\end{abstract}








%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Introduction
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\section{Introduction}\label{sec:introduction}

Multichannel and surround sound reproduction is becoming more common, both for consumer applications as well as for musical and artistic purposes. A number of techniques exist for virtual positioning of sound sources using an array of loudspeakers.  Techniques for spatialisation commonly assume that the position of a listener is known and fixed, and that the speakers are surrounding the listener either on a two-dimensional ring or a three-dimensional sphere. Examples of such speaker layouts and spatialisation techniques are stereo panning, 5.1-channel surround \cite{ITU:1993_surround_5:1}, further extended industrial multichannel configurations \cite{Rumsey:2001spatial_audio}, vector-based amplitude panning (VBAP) \cite{Pulkki:1997vbap}, as well as both first-order and higher-order ambisonics \cite{Gerzon:1974surround, Poletti:2000holographic_sound}.

Wave field synthesis (WFS) is a noticeable exception to the aforementioned ``sweet spot'' restriction, reproducing signals resulting in a large listening area. The spatial properties of the acoustical scene can be perceived correctly by an arbitrarily large number of listeners regardless of their position inside this area \cite{Spors:2004sound_field_synthesis}.

A number of practical limitations tend to restrict what spatialisation techniques are feasible for musical and artistic use.

% TODO: Tim thinks this is sentence is very awkward.
Unless working on a site providing a permanent setup for wave field synthesis, the high number of loudspeakers required might render WFS impractical for financial reasons as well as time constraints.

% TODO: Tim asks " do you always need to say 'first and higher order ambisonics'? " -- it seems strange and is grammatically awkward.  Can you just use "ambisonics" ?  You already said first and higher once before...
For real-time music and sound purposes, the relatively low CPU requirements of matrix-based spatialisation techniques seem to make them popular choices. 
VBAP as well as first and higher order ambisonics are readily available for use in common software environments for real-time processing such as Max/MSP \cite{Pulkki:2000vbap_max, Schacher:2006ambi_max, Neukom:2008ambipan}.

Among the requirements imposed by VBAP and ambisonics, are that the listeners are restricted to a relatively small listening area surrounded by loudspeakers.  These requirements might be unfeasible or undesired in practical applications.  In the ideal concert situation the entire audience should have a detailed impression of the spatial content of the music, not limiting the impression to those sitting in the middle of the concert hall. In a sound installation context one might want the audience to be able to move around the space \cite{lossius:2008installations}.  Finally, for pragmatic and/or artistic reasons it might not be possible or desired to have loudspeakers arranged in a ring or a sphere.

% CHANGED: Tim capitalized the DBAP words -- if not desired, feel free to undo it
Distance-Based Amplitude Panning (DBAP) is a matrix-based spatialisation technique that takes the actual positions of the speakers in space as the point of departure, while making no assumptions as to where the listeners are situated. This makes DBAP useful for a number of real-world situations including music for concerts, works for stage, installations, and museum sound design where predefined geometric speaker layouts might not apply.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Fundamentals
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Distance-based amplitude panning}

\subsection{Fundamentals}

% TODO: Tim changed the capitalization above -- but here it is again.  They should be the same, so what should it be?
% CHANGED: Tim changed a couple of places where the word 'setup' was used.  This is a bit colloquial.  I replaced it with the word 'model'.  Discard or consider as appropriate. 

\textit{Distance-based amplitude panning (DBAP)} extends the principle of equal intensity panning from a pair of speakers to a loudspeaker array of any size, with no \textit{a priori} assumptions about their positions in space or relative to each other.
For simplicity, the method will be discussed in terms of a two-dimensional model with speakers and sources all positioned in the same horizontal plane. This can be readily extended to three dimensions.

The position of a virtual source will be described in terms of Cartesian coordinates $(x_{s}, y_{s})$. For a model with $N$ speakers, the position of the $i$th speaker is given as $(x_{i}, y_{i})$. The distance from a source to each of the speakers can then be calculated as

\begin{equation} \label{eq:distance}
d_{i} = \sqrt{ {(x_{i} - x_{s})}^2 + {(y_{i} - y_{s})}^2 } \qquad \textrm{for } 1 \leq i \leq N \textrm{ .}
\end{equation}

For simplicity, the source is presumed as having unity amplitude. DBAP then makes two assumptions. The first is that intensity is to be constant regardless of the position of the virtual source. This can be considered an extension of the principle of constant intensity panning for stereo to multichannel setups. If the amplitude of the $i$th speaker is $v_{i}$, this implies

\begin{equation} \label{eq:constant_intensity}
I = \sum_{i=1}^{N} {v_{i}}^2 = 1
\end{equation}

Secondly, it is assumed that all speakers are active at all times, and the relative amplitude of the $i$th speaker depends on the distance from the virtual source as 

\begin{equation} \label{eq:inverse_distance}
v_{i} = \frac{k}{2 d_{i} a} 
\end{equation}

% TODO: Tim notes that 'depending' isn't quite the right word in this sentence.  In both places it should be a different word (not certain about the replacement yet)
% TODO: Maybe the correct work is 'calculated from' ?
where $k$ is a coefficient depending on the position of the source and all speakers, while $a$ is a coefficient depending on the rolloff $R$ in decibels per doubling of distance:

\begin{equation} \label{eq:rolloff}
	a = 10^{\frac{-R}{20}}
\end{equation}

A rolloff of $R = 6$ dB equals the inverse distance law for sound propagating in a free field. For closed or semiclosed environments $R$ will generally be lower, in the range 3-5 dB, and depending on reflections and reverberation \cite{Everest:2000handbook_acoustics} (pp. 84-88). In these circumstances (\ref{eq:rolloff}) represents a simplified description of attenuation with distance, but simulation of reflections and reverberation is anyway beyond the scope of an amplitude-panning based spatialisation method.

%The second is based on the inverse distance law for sound pressure for sound propagating in free field as discussed in section \ref{distance_hearing}. DBAP applies an adaption of this by assuming that the relative amplitude for each speaker is inversely proportional to the distance from source to speaker:

Combining equations (\ref{eq:constant_intensity}) and (\ref{eq:inverse_distance}) $k$ can be found as:

\begin{equation} \label{eq:calculate_k}
k = \frac{2a}{\sqrt{\sum_{i=1}^{N} \frac{1}{{d_{i}}^2}}}
\end{equation}




\subsection{Spatial blur}

If the virtual source is located at the exact position of one of the loudspeakers, (\ref{eq:calculate_k}) will cause a division by zero. Combining equations (\ref{eq:inverse_distance}) and (\ref{eq:calculate_k}) we get

\begin{equation}
v_{j} = \frac{1}{\sum_{i=0}^{N} \frac{{d_{j}}^2}{{d_{i}}^2}}
\end{equation}

From this it can be shown that

\begin{equation} \label{eq:distance_zero}
\lim_{d_{j} \rightarrow 0} v_{i} = 
\left\{ \begin{array}{ll} 
1 & \textrm{if $i=j$}\\ 
0 & \textrm{if $i \ne j$}
\end{array} \right.
\end{equation}

When the virtual source is located at the exact position of one of the loudspeakers, only that speaker will be emitting sound. This may cause unwanted changes in spatial spread and coloration of a virtual source in a similar way as observed for VBAP \cite{Pulkki:1999vbap}. To adjust for this a similar solution can be provided by introduction of a degree of \textit{spatial blur} $r_{s} \ge 0$ in equation (\ref{eq:distance}):

\begin{equation} \label{eq:mod_distance}
d_{i} = \sqrt{ {(x_{i} - x_{s})}^2 + {(y_{i} - y_{s})}^2 + {r_{s}}^2}
\end{equation}

The blur coefficient $r_{s}$ can be understood as a displacement in vertical position introduced between the source and the speakers, as if the speakers are positioned at $z_{i}=0$ while the vertical position of the source is $z_{s}=r_{s}$. The larger $r$ gets, the less the source will be able to gravitate towards one speaker only. There should be a potential for using this artistically to create contrasts between highly articulated or diffuse spatial positioning of sources.  There is a limitation, however, to how blurred the sources can be perceived.  While all speakers will approach the same level as $ r_{s} \rightarrow \infty $, practical experience indicates that the precedence effect will come into play, causing the perceived direction of the source to gravitate towards the speaker(s) closest to the listener \cite{Litovsky:1999precedence_effect}.

% TODO: Discuss variance



\subsection{Sources positioned beyond the field of speakers}

%TODO: Tim asks "should you be saying speaker or loudspeaker?"

The presuppositions upon which DBAP is based do not hold true when sources move outside of the field of speakers. As the distance of a source position from a speaker increases, the relative difference in distance from source to each of the speakers diminishes, resulting in progressively less difference in levels between the speakers.  This occurs in much the same manner as discussed for spatial blur in the previous subsection. To compensate for this, additional steps needs to be taken when the source moves outside the field of speakers.

From the description of loudspeaker positions the \emph{convex hull} of the field of speakers is calculated. In two dimensions the convex hull ``is the shape taken by a rubber band stretched around nails bounded into the plane at each point'' \cite{Rourke:1998_geometry}.

For each source position it is first determined if the source is outside the hull or not. If it is inside or on the boundary no additional steps needs to be taken. If the source is positioned outside the convex hull, the projection of the point onto the boundary of the hull is calculated, defined as the point on the boundary with the shortest possible distance to the source. The source position is then substituted for the projected point on the hull in subsequent DBAP calculations. In addition, the distance from the source position to the convex hull is returned. This value can be used for optional added spatial processing such as gain attenuation, air filtering, doppler effect, or gradual introduction of reverb with increasing distance from the hull.




\subsection{Extending DBAP by introducing spatial weights}

In the discussions thus far, the DBAP algorithm has dealt with the speakers in a transparent manner, with the aim of reproducing virtual sound sources in the best way possible without any further considerations for any loudspeaker properties apart from position.

The extension of DBAP by introduction of a spatial weight $w_{i}$ in equation \ref{eq:inverse_distance} enables a source to be restricted to use a subset of speakers:

\begin{equation} \label{eq:inverse_distance_weighed}
v_{i} = \frac{k w_{i}}{2 d_{i} a} 
\end{equation}

Equation \ref{eq:calculate_k} will now be modified to:

\begin{equation} \label{eq:calculate_k_weighted}
k = \frac{2a}{\sqrt{\sum_{i=1}^{N} \frac{{w_{i}}^2}{{d_{i}}^2}}}
\end{equation}

This might offer several artistic possibilities. Within the tradition of the Acousmonium \cite{Bayle:1993MusiqueAcousmatique} a large number of speakers are used, sorted in several groups with different qualities and characteristics, thus allowing a scripting of sound space according to the spectral content of the projected music \cite{Prager:2002acousmatique}. If the loudspeaker setup consists of different kinds of speakers with differing spectral properties, they can be thought of as an orchestra of speakers and be organized into different instrumental groups. Spatial weights can then be used to ensure that a source is spatialised among members of one group only. This allows a timbral and spatial orchestration to be prepared or composed prior to performance, and then be adjusted to the specific room used for playback \cite{Lyon:2008spatial_orchestration}. 

In installations or museum spaces spatial weights can also be used to confine sources to restricted areas. For instance one source can be diffused in one room only while another source with a different set of spatial weights might be permitted to move between several or all rooms.

Spatial weights can be changed dynamically, thus allowing smooth transitions from one state to another. 

% TODO: Tim says the words 'showed up' should be changed to a more proper term -- saying 'showed up' sounds very Texan ;-)
This weight parameter, after being submitted to listening tests and visualization (as described later in\ref{subsection:Visual representation}), showed up as being more of a spatial weight for each loudspeaker, or rather a spatial ``sharpness'' of the localization of each loudspeaker. This parameter, though, needs further research and listening tests, in laboratory and artistic contexts for a better understanding of its perceptual effect.

% CHANGED: Tim reworded this paragraph very significantly -- please check!
% TODO: Tim also says... Due to a conflict in SVN, I can't tell what happened here -- maybe this paragraph was just deleted ?
The authors are exploring a means by which to obtain a better numerical representation of this parameter.  In particular the parameter's range and transfer function. Research is ongoing to find a more intuitive process for the user by which to manage the interdependence of all weights.



{'fraction_non_alphanumeric': 0.10833568804747104, 'fraction_numerical': 0.009042102288782142, 'mean_word_length': 4.442257419652468, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5884854', 'n_tokens_mistral': 9474, 'n_tokens_neox': 8819, 'n_words': 4513}