# Differentiable grey-box modelling of phaser effects using frame-based
spectral processing

###### Abstract

Machine learning approaches to modelling analog audio effects have seen
intensive investigation in recent years, particularly in the context of non-
linear time-invariant effects such as guitar amplifiers. For modulation
effects such as phasers, however, new challenges emerge due to the presence of
the low-frequency oscillator which controls the slowly time-varying nature of
the effect. Existing approaches have either required foreknowledge of this
control signal, or have been non-causal in implementation. This work presents
a differentiable digital signal processing approach to modelling phaser
effects in which the underlying control signal and time-varying spectral
response of the effect are jointly learned. The proposed model processes audio
in short frames to implement a time-varying filter in the frequency domain,
with a transfer function based on typical analog phaser circuit topology. We
show that the model can be trained to emulate an analog reference device,
while retaining interpretable and adjustable parameters. The frame duration is
an important hyper-parameter of the proposed model, so an investigation was
carried out into its effect on model accuracy. The optimal frame length
depends on both the rate and transient decay-time of the target effect, but
the frame length can be altered at inference time without a significant change
in accuracy.

##  1 Introduction

A broad class of audio effects found in almost all genres of popular music is
that of time-varying modulation effects, and includes phasing, flanging,
chorus, and tremolo. Model-based digital implementations of these effects are
straightforward [1], but many musicians prefer the timbre and character of the
original analog or electro-mechanical devices used to create these effects,
and these may be considerably more difficult to model. Circuit-based
simulations [2, 3] can produce physically accurate results but are highly
optimized to a specific device, and require complete knowledge of the circuit
and its component values.

In general, modelling of audio effects using machine learning has become an
active area of research in recent years, with a particular focus on modelling
non-linear time-invariant effects such as guitar amplifiers and distortion
pedals. Approaches in modelling these systems include fully black-box methods
using recurrent or convolutional neural networks (RNNs / CNNs) [4, 5], as well
as grey-box models which use some prior knowledge of the reference system,
such as differentiable state-space models [6, 7] and differentiable DSP-based
models [8, 9]. Modelling of effects with time-varying input-dependent
behaviour such as dynamic range compression has also been explored through the
use of CNNs with long receptive fields [10] and temporal feature-wise linear
modulation [11]; as well as a differentiable DSP model proposed in [12].
Modelling of time-varying modulation effects presents a unique challenge due
to the modulation of system behaviour by a low frequency oscillator (LFO). The
deep-learning approach proposed in [13] can emulate a wide range of effects,
however the use of bi-directional long-term short-memory networks (LSTMs)
makes the model non-causal and therefore not suited for real-time use. Wright
et al. [14] proposed a real-time model for phasing and flanging effects using
RNNs, but required manual measurement and estimation of the LFO prior to
training as this was an input to the model. Earlier work by Kiiski et al. [15]
proposed a grey-box model of phasing, but in which no machine learning was
used.

This work presents a differentiable DSP model of a phaser effect that can be
trained through gradient descent to jointly learn the underlying LFO signal
and the time-varying spectral response of an analog reference pedal. The model
utilises frequency domain approximations of IIR filters to accelerate training
times, as has been employed in [9, 12]. Through experiment, we investigate the
conflicting demands of time and frequency resolution when using this method in
the context of time-varying effects.

The paper is structured as follows: Section 2 provides background on analog
and digital phasing effects; Section 3 outlines the proposed model; Section 4
describes the target systems and data; Section 5 describes the experimental
procedure and results; and Section 6 concludes the paper with an outlook on
areas of future work. Source code and audio examples are provided at the
accompanying web-page [16].

##  2 Analog and Digital Phase Shifters

The phaser is a time-varying filter effect in which the phase of an input
signal is subject to a periodic modulation and combined together with the
‘dry’ (uneffected) signal to create audible notches in the frequency spectrum
[17]. The movement of these notches with time gives the characteristic
perceived sweeping effect. The phasing effect is often confused with flanging,
and indeed both effects are caused by modulating notches in the spectra. The
key difference is that a flanger generates an infinite series of harmonically
spaced notches, whereas the phaser response has finite non-uniformly spaced
notches [18]. Furthermore, implementations of phasers and flangers differ both
historically and in present day commercial products. Originally, the flanging
effect was created by playing two tape machines in near unison with a small
variable time delay between the two reels [19]. Nowadays, flangers are
typically implemented using time-varying digital comb filters, or ‘bucket-
brigade’ delay lines in analog pedals. In contrast, phasers create phase
shifts through cascaded all-pass filters, in which break frequencies are
modulated by a low-frequency oscillator (LFO).

Digital phaser effects are usually implemented as linear time-varying signal-
based models, in which the all-pass filters are discrete-time approximations
of idealised all-pass filters [1, 18, 20]. The motivation of this work is to
explore whether such a model can be embedded in a machine learning framework
to emulate the response of an analog phaser pedal. The continuous and discrete
time signal processing concepts of phasing, which underpin the proposed model,
are outlined in the remainder of this section.

###  2.1 Continuous-time phasing

We will examine phasers of the topology shown in Figure 1 composed of a
cascade of $K$ identical first-order all-pass filters. (In many practical
implementations of the phaser, $K=4$ [18], but other choices of $K$ have been
employed [15].) The continuous-time transfer function of each such first-order
section is [18]:

$A(s)=\frac{s-\omega_{b}}{s+\omega_{b}}$ (1)

where $s=\sigma+j\omega$ is the complex frequency and $\omega_{b}\geq 0$ is
known as the break-frequency of the all-pass filter. Because $A$ is all-pass,
for real frequencies $s=j\omega$ it may be written as $A=e^{j\Theta}$, where:

$\Theta(\omega)=\pi-2\arctan\left(\omega/\omega_{b}\right)\,.$ (2)

From (2) it can be observed that $\omega_{b}$ is the frequency at which
$\Theta(\omega_{b})=\pi/2$. Furthermore, the all-pass filter inverts DC, and
the phase response tends to zero as $\omega\to\infty$.

Figure 1: A typical phaser structure in continuous time.

The cascade arrangement in Figure 1 includes a through path with gain $g_{1}$,
and a feedback path with gain $g_{2}$, with $0\leq g_{2}<1$. The following
transfer function results:

$H(s)=g_{1}+\frac{A^{K}}{1-g_{2}A^{K}}\,.$ (3)

The poles $s=\xi_{k}$, and zeros $s=\eta_{k}$, $k=0\ldots,K-1$, are:

$\displaystyle\xi_{k}\\!\\!\\!\\!$ $\displaystyle=$
$\displaystyle\\!\\!\\!\\!\omega_{b}\frac{1\\!+\\!\lambda_{k}}{1\\!-\\!\lambda_{k}}\quad{\rm
where}\;\lambda_{k}=\frac{e^{j2\pi k/K}}{\sqrt[K]{g_{2}}}$ (4a)
$\displaystyle\eta_{k}\\!\\!\\!\\!$ $\displaystyle=$
$\displaystyle\\!\\!\\!\\!\omega_{b}\frac{1\\!+\\!\beta_{k}}{1\\!-\\!\beta_{k}}\quad{\rm
where}\;\beta_{k}=\sqrt[K]{\frac{g_{1}}{1\\!-\\!g_{1}g_{2}}}e^{j\pi(2k+1)/K}\,.$
(4b)

Figure 2 shows a root locus plot of the pole and zero trajectories for $0\leq
g_{2}\leq 1$, and when $g_{1}=1$. Under open loop ($g_{2}=0$) conditions, two
notches are located on the non-negative imaginary axis. As $g_{1}\to 0$ the
zeros move away from the imaginary axis and as such, parameter $g_{1}$
controls the perceived depth of the phaser effect. Under fully closed loop
conditions, two poles are located on the non-negative imaginary axis (one at
DC).Variations in the transfer function magnitude $|H|$ with both $g_{1}$ and
$g_{2}$ are shown in Figure 3.

Figure 2: Root locus plot, for $g_{1}=1$, and for for $g_{2}$ between 0 (open
loop, indicated by circles) and 1 (indicated by crosses). Pole locations are
indicated by blue lines, and zero locations by yellow lines. The real
frequency $-\omega_{b}$ (where here, $\omega_{b}=2\pi\cdot 1000$ rad/s) is
indicated by a dashed line.

Figure 3: Magnitude response for $H$, under open-loop conditions at left, for
different values of $g_{1}$, as indicated, and under closed-loop conditions at
right, for $g_{1}=1$, and different values of $g_{2}$, as indicated. As
before, $\omega_{b}=2\pi\cdot 1000$ rad/s.

###  2.2 Discrete-time phasing

The continuous-time transfer function (1) can be approximated in discrete-time
via the bilinear transform to give the discrete-time all-pass section,
$A_{d}(z)$, defined as:

$A_{d}(z)=\frac{p-z^{-1}}{1-pz^{-1}}\qquad{\rm where}\qquad
p=\frac{1-\tan(\omega_{b}T/2)}{1+\tan(\omega_{b}T/2)}\,.$ (5)

Here, $T=1/F_{s}$ is the sampling period, for sample rate $F_{s}$ in Hz. The
corresponding discrete-time phaser is shown in Figure 4. The discrete-time
transfer function $H_{d}(z)$ of $K$ cascaded all-pass sections, including the
residual connection and feedback loop is:

$H_{d}(z)=g_{1}+\frac{A_{d}^{K}}{1-g_{2}z^{-\phi}A_{d}^{K}}\,.$ (6)

Note that a digital delay $z^{-\phi}$, $\phi\in\mathcal{Z}^{+}$ has been
included in the feedback loop. Without this, a delay-free loop would be
present in the resulting difference equation. Efficient modelling of delay-
free loops found in phaser pedals has proven challenging: the state-space
model of a phaser pedal presented in [3] required a Newton-Raphson solver at
run-time; and Kiiski et al. reported that the fictitious delay line in their
DSP model ($\phi=1$) resulted in perceptual differences in the feedback effect
when compared with the analog reference device [15]. The effect of the delay
line on the magnitude response of the system can be seen in Figure 5. It is
clear that the fictitious delay line in the feedback loop drastically changes
the magnitude response for high-frequencies, and should ideally be avoided in
virtual analog models of phasers.

Figure 4: A typical DSP phaser structure.

Figure 5: Comparison of magnitude responses of continuous-time (CT) and
discrete-time (DT) phaser models, with constant parameters
$\omega_{b}=2\pi\cdot 1000$ rad/s, $g_{1}=1.0$, $g_{2}=0.9$, and $T=1/44100$
s. Distinct cases of the discrete-time model without ($\phi=0$) and with
($\phi=1$) a fictitious delay are illustrated.

###  2.3 Time-varying behaviour

In analog phase shifters, the break frequency of the all-pass sections,
$\omega_{b}$, is periodically modulated by a sub-audio rate LFO, typically
with frequency in the range $0.05\text{\,}\mathrm{Hz}$ to
$5\text{\,}\mathrm{Hz}$. The mapping between LFO voltage and break frequency
is often nonlinear and asymmetrical: for example, in the MXR Phase 90 the LFO
varies the voltage across JFETs which in turn alters the break frequency of
the all-pass [3]. Certain devices, such as the Uni-Vibe and its replicas, are
optical: the LFO varies the voltage across a light source (an incandescent
bulb in original units [21]) surrounded by light dependent resistors (LDRs).
The resulting fluctuation in current through the LDRs controls the all-pass
break frequencies. Accurate prediction of the LFO characteristics (including
fundamental frequency and waveshape) are therefore critical to the quality of
discrete-time emulations of such effects, including phasers.

##  3 Modelling Method

This section outlines the proposed model of a differentiable phase shifting
algorithm which, given input-output audio recordings of a reference device,
can be trained to emulate the time-varying behaviour. Consider an arbitrary
phase-shifting device that has been sampled in discrete time as:

$y[n]=f(x[n],\theta[n])$ (7)

where $x$ is the input signal, $y$ is the output signal, $\theta$ are the
time-varying parameters of the system, $n$ is the sample index and $f$ is a
linear function of $x$. We seek to develop a model of the form:

$\hat{y}[n]=g(x[n],\hat{\theta}[n])$ (8)

whose output $\hat{y}[n]$ is perceptually indistinguishable from $y[n]$. The
function $g$ is assumed differentiable so that the model can be trained using
gradient descent to find model parameters $\hat{\theta}$ that minimise an
objective loss function $\mathcal{L}(y,\hat{y})$. The proposed model
architecture is shown in Figure 6.

###  3.1 Frame-based processing

Utilising frame-based spectral processing [22, 23], the proposed model assumes
that the target phaser can be treated as a linear time-invariant (LTI) system
over the duration of a short frame of length $W$ seconds. Suppose that an
input audio signal $x[l]$ of length $L$ samples is segmented into
$N_{f}=\lceil L/H\rceil$ frames of length $N=\lfloor WF_{s}\rfloor$ with hop-
size $H$ samples. (The resulting frame rate is $F_{f}=F_{s}/H$ in Hz.) The
$m$th frame, $m=0,\ldots,N_{f}-1$, is defined as the $N\times 1$ column vector
${\bf x}_{m}=[x[mH],\ldots,x[mH+N-1]]^{T}$. The short-time Fourier transform
vector ${\bf X}_{m}$, $m=0\ldots,N_{f}-1$ is derived from ${\bf x}_{m}$
through windowing and Fourier transformation as follows:

${\bf X}_{m}={\bf U}{\bf Q}{\bf x}_{m}\,.$ (9)

Here, ${\bf Q}=[{\bf W}\,\,{\bf Z}]^{T}$ is an $N^{\prime}\times N$ windowing
matrix, where where $N^{\prime}$ is the DFT length. It includes the diagonal
$N\times N$ matrix ${\bf W}$, containing samples of the Hann window on the
diagonal, and an $N\times(N^{\prime}-N)$ all-zero matrix ${\bf Z}$
implementing zero-padding. ${\bf U}$ is an $N^{\prime}\times N^{\prime}$ DFT
matrix.

Figure 6: Structure of the proposed model. Black arrows indicate signal flow,
with magenta indicating the flow of gradients to the learnable parameters. The
blue and yellow boxes indicate operations in the frequency domain and time
domain respectively. The subscript $m$ denotes parameters varying at the frame
rate, with all other parameters held constant for the duration of a training
epoch. Parameters in magenta are updated once per epoch by the optimizer.

At each frame, spectral processing is applied via element-wise complex
multiplication in the frequency domain, followed by an inverse Fourier
transform, truncation and windowing to yield the $N\times 1$ output vectors
${\bf y}_{m}$, $m=0,\ldots,N_{f}-1$:

${\bf y}_{m}=\frac{1}{N^{\prime}}{\bf Q}^{T}{\bf U}^{*}{\bf H}_{m}{\bf
X}_{m}\,.$ (10)

Here, $\mathbf{H}_{m}$ is an $N^{\prime}\times N^{\prime}$ diagonal matrix
containing values of a transfer function (incorporating Hermitian symmetry) at
frame $m$ on its diagonal. ${\bf U}^{*}$ is the conjugate transpose of the DFT
matrix ${\bf U}$. Finally, the output time series $\hat{y}[l]$ is obtained
from the frames ${\bf y}_{m}$ through an overlap-add procedure, with hop size
$H$. It can be shown that for $\mathbf{H}_{m}={\bf I}$, exact reconstruction
of the input signal can be obtained if $N/H$ is an integer greater than
two—this property is known as constant-overlap-add and is enforced in the
proposed model. Considering the transfer function in (10) to represent a
digital filter with $M\in\mathbb{Z}$ non-zero taps, then the DFT length must
be $N^{\prime}\geq N+M-1$ to avoid temporal aliasing in the output frames. For
IIR filtering (where $M\to\infty$), some degree of temporal aliasing is
inevitable but can be practically suppressed by choosing $M$ as the 60dB decay
time (in samples) of the filter. In this work the decay time of the target
system was not known, but we found a DFT length of
$N^{\prime}=2^{\lceil\log_{2}(N)\rceil}$ to be sufficient to train the models.

###  3.2 LFO generator

The proposed model has an LFO module which governs the time-varying behaviour
of the spectral processing. The LFO produces samples at the frame rate,
$F_{f}$, and is defined as the real part of a damped complex exponential:

$s_{m}(z_{a},z_{b})=\text{Re}(z_{b}z_{a}^{m})=|z_{b}||z_{a}|^{m}\cos(m\angle
z_{a}+\angle z_{b})$ (11)

where $z_{a},z_{b}\in\mathbb{C}$ are the complex frequency and complex
amplitude respectively. Hayes et al. showed that Wirtinger’s calculus can be
used to compute the partial derivatives of real-valued, complex-variable
functions such as (11) to enable sinusoidal frequency estimation by gradient
descent [24]. In this work we extend this method to include a learnable
starting phase and amplitude (defined by $z_{b}$). The Wirtinger derivatives
of (11) are:

$\displaystyle\frac{\partial s_{m}}{\partial
z_{a}}\triangleq\frac{1}{2}\left(\frac{\partial
s_{m}}{\partial\text{Re}(z_{a})}-j\frac{\partial
s_{m}}{\partial\text{Im}(z_{a})}\right)$
$\displaystyle=\frac{mz_{b}z_{a}^{m-1}}{2}$ (12a) $\displaystyle\frac{\partial
s_{m}}{\partial z_{b}}\triangleq\frac{1}{2}\left(\frac{\partial
s_{m}}{\partial\text{Re}(z_{b})}-j\frac{\partial
s_{m}}{\partial\text{Im}(z_{b})}\right)$
$\displaystyle=\frac{z_{a}^{m}}{2}\,.$ (12b)

In the model implementation, the LFO parameters were initialised to:

$z_{a}=0.7\exp(j\zeta/F_{f}),\quad z_{b}=1.0$ (13)

where $\zeta$ is a random number sampled from a standard normal distribution.
The damped amplitude envelope was only applied during training; during
inference $z_{a}$ was normalised to the unit circle to give a lossless LFO.

###  3.3 Multi-layer perceptron waveshaper

The output of the LFO generator is passed through a multi-layer perceptron
(MLP) to allow the model to learn non-sinusoidal control signals like those
described in Section 2.3. The conceptual motivation for this module was to
emulate the linear and non-linear mapping of the LFO signal (in volts or
amperes) to the break-frequencies of the all-pass filters (in ) in an analog
phaser device. Therefore we treat the output of the MLP as the model’s
prediction of the normalised time-varying break-frequency signal, such that
the all-pass parameter is given by:

$p_{m}=\frac{1-\tan(d_{m})}{1+\tan(d_{m})}\quad\text{where}\quad
d_{m}=\text{MLP}(s_{m},\gamma)\,,$ (14)

with $\gamma$ being the MLP parameters. The MLP consisted of three hidden
layers; with 8 neurons per layer; hyperbolic tangent activation functions in
the hidden layers; and linear activation in the output layer. The input and
output features were scalar, based on the assumption that all $K$ all-pass
filters are identical in the reference device.

###  3.4 Model transfer function

The frame-dependent transfer function of the model has the form:

$\mathbf{h}_{m}\triangleq\text{diag}(\mathbf{H}_{m})=\mathbf{h}^{(1)}\cdot\left(g_{1}+\frac{\mathbf{h}^{(2)}\cdot\mathbf{a}_{m}}{1-|g_{2}|\mathbf{z}^{-I(\phi)\phi}\cdot\mathbf{h}^{(2)}\cdot\mathbf{a}_{m}}\right)$
(15)

where $\mathbf{a}_{m}$ is the frame-dependent all-pass kernel:

$\mathbf{a}_{m}=\left(\frac{p_{m}-\mathbf{z}^{-1}}{1-p_{m}\mathbf{z}^{-1}}\right)^{K}$
(16)

and ${\bf z}$ is the $N^{\prime}$\- element vector ${\bf z}=[e^{\frac{2\pi
j(0)}{N^{\prime}}},\ldots,e^{\frac{2\pi j(N^{\prime}-1)}{N^{\prime}}}]^{T}$.
(Here and elsewhere in this section, operations on vectors are assumed to be
applied element-wise.) The parameters $g_{1},g_{2},\phi\in\mathbb{R}$ retain
their physical meanings from Section 2 but are now initialised as learnable
parameters of the model. $I(\cdot)$ is the Heaviside step function and was
included to prevent the model learning a non-casual transfer function. The
number of all-pass filters is a hyper-parameter and was fixed for all
experiments to $K=4$. The model includes two frequency domain representations
of bi-quad filters, given by:

$\mathbf{h}^{(i)}=\frac{b_{0}^{(i)}+b_{1}^{(i)}\mathbf{z}^{-1}+b_{2}^{(i)}\mathbf{z}^{-2}}{1+a_{1}^{(i)}\mathbf{z}^{-1}+a_{2}^{(i)}\mathbf{z}^{-2}}$
(17)

where
$b_{0}^{(i)},b_{1}^{(i)},b_{2}^{(i)},a_{1}^{(i)},a_{2}^{(i)}\in\mathbb{R}$ are
the learnable filter parameters for the $i$th biquad, $i=1,2$. These kernels
were included to account for any further LTI filtering that an analog phaser
might impart in addition to the core phasing effect described in Section 2.
For example, low-pass filtering, DC blocking or gain adjustment.

###  3.5 Loss function

The proposed model uses the error-to-signal ratio (ESR) as the objective loss
function during training:

$\mathcal{L}(y,\hat{y})=\frac{\sum_{l=0}^{L-1}\left(y[l]-\hat{y}[l]\right)^{2}}{\sum_{l=0}^{L-1}y[l]^{2}}$
(18)

where $L$ is the length of the training data in samples. This loss function
has been widely used in black-box and grey-box modelling of other audio
effects [5, 12, 14], but the strict time-alignment required by (18) introduced
some interesting challenges when it came to training the proposed model.
Because the frequency and phase of the LFO are unknown parameters, the
training data cannot be arbitrarily split into short segments (as is common
when using long audio sequences as training data [5, 11]). For example, even
if the initial random frequency guess was precisely correct, the model would
‘see’ a different starting phase for each segment (unless the segment length
happened to be an integer multiple of the LFO period). In initial experiments,
this phase discrepancy was accounted for using the current estimate of LFO
frequency, but this caused noisy optimizer updates and convergence issues when
the segment length was shorter than one LFO period in the target data.

This presents a dilemma in training this model: we need a sufficient duration
of training data to capture the slowly time-varying features in the target
system, but are constrained to training with single-batch gradient descent,
meaning the time taken for one optimizer step increases linearly with the
length of training data. The proposed solution to this problem was to use a
short, spectrally-flat training signal. Details of this signal are outlined in
Section 4.

###  3.6 Training details

All models were trained on audio with a sample rate of
$44.1\text{\,}\mathrm{kHz}$ using an Adam optimizer [25] with an initial
learning rate of $10^{-3}$. Models were trained for a maximum of 5000 epochs
on a NVIDIA Titan-X GPU. The training times varied depending on the length of
training data and window size. For example, for an audio sequence of
$10\text{\,}\mathrm{s}$ the training times were $\sim$3 hours and $\sim$16
hours for window lengths of $160\text{\,}\mathrm{ms}$ and
$10\text{\,}\mathrm{ms}$ respectively. It is important to note that early
designs of the proposed model were implemented in the time-domain and trained
via back-propagation through time, but training times were deemed too slow to
pursue this approach further ($\sim$24 hours for 1000 epochs on 1s of training
audio). The prohibitive training times of IIR filters has been reported in
previous work [9] [12].

###  3.7 Model inference

In this work, at model inference we use the same algorithm as in training
(i.e. using frame-based spectral processing). This has the limitation of
introducing a minimum latency of $W$ seconds into the system, which may be
unsuitable for real-time use. A time-domain implementation using IIR filters
could conceivably be derived via inverse $z$-transform of the system transfer
function (15), but this is left as a task for future work. The handling of the
possibly non-integer delay-line length $\phi$ would require some
consideration, but could be implemented with an all-pass filter in the
feedback loop shown in Figure 4.

##  4 Target systems and datasets

A custom dataset was collected consisting of 60s of a synthetic chirp-train
signal followed by 60s of direct-input (DI) guitar recordings. The chirp-train
signal was used as the input signal for model training; whereas the guitar
recordings were reserved for testing.

###  4.1 Synthetic training signal

The chirp-train signal was synthesised as an impulse train with period
$30\text{\,}\mathrm{ms}$ passed through a cascade of 64 all-pass filters (5)
with $p=0.9$. This type of signal has been used previously for estimating the
LFO frequency and shape of LTV audio effects [14, 15]. Due to its spectral
flatness, it was hypothesised that even a few seconds of this signal would be
sufficient to train the model.

###  4.2 Digital phaser

As a simplified test problem, the proposed model was initially trained on data
generated through a digital phaser with transfer function (6) ($K=4$)
implemented through a time-domain recursion in MATLAB. This can be viewed as a
specific instance of the model itself but without frame-based spectral
processing and under known parameters, shown in Table 2. The LFO was set to a
triangular wave, sweeping through break-frequencies from
$4000\text{\,}\mathrm{rad}\text{\,}{\mathrm{s}}^{-1}$ to a maximum of
$16\,000\text{\,}\mathrm{rad}\text{\,}{\mathrm{s}}^{-1}$. The maximum
$60\text{\,}\mathrm{dB}$ decay time of this system (occurring at the minimum
of the LFO cycle) was measured to be $t_{60}=$ $38\text{\,}\mathrm{ms}$.

###  4.3 EHX Small Stone

The Electro-Harmonix (EHX) Small Stone is a commonly encountered analog phaser
pedal. The pedal has a single knob to control the rate of the effect, and a
binary “colour” switch. High-level analysis of a circuit schematic [26] showed
that it consisted of an LFO module, a series of four first order all-pass
filter sections and a feedback loop (engaged when the “colour” switch is on).
This circuit therefore shares the same topology as the proposed model. The
Small Stone data was collected by processing both the training and testing
audio through the pedal in one continuous recording. The audio was sent to the
pedal via the output of a PreSonus Audiobox i2 interface, and the output of
the pedal re-connected to the input of the audio interface. A calibration
recording was obtained with the pedal in bypass-mode and used as the input to
the models to negate the effect of the recording equipment on model training.
Six unique parameter configurations were captured: three different positions
of the ‘rate’ knob with colour switch ON (circuit with feedback) and colour
switch OFF (no feedback). The LFO rates were estimated through manual
inspection of the spectrogram, providing a pseudo-ground-truth $f_{0}$ which
could later be compared to the learned LFO signals — see Table 1.

Label | Colour | Rate knob position |  $T_{0}$* [] |  $f_{0}$* []
---|---|---|---|---
SS-A |  | 3 o’clock | 0.44 | 2.28
SS-B | OFF | 12 o’clock | 1.60 | 0.625
SS-C |  | 9 o’clock | 11.6 | 0.086
SS-D |  | 3 o’clock | 0.70 | 1.4
SS-E | ON | 12 o’clock | 2.56 | 0.38
SS-F |  | 9 o’clock | 18 | 0.056
Table 1: Manually estimated LFO rates of the Small Stone under different
parameter configurations. * denotes approximate values.

##  5 Experiments and Results

The focus of the experiments presented here is on the effect of the window
length $W$ (in seconds) on model accuracy in the context of both model
training and inference. In all experiments, the accuracy metric was the
resultant ESR (18) on the test dataset. It was noted that the training
convergence was sensitive to the initialisation of the MLP parameters,
$\gamma$. To address this issue, each training procedure was re-initialised
and repeated three times. The iteration with the lowest ESR was retained. A
frame overlap of 75% was used across all experiments, with the frame length in
samples $N$ truncated to a multiple of four to ensure constant-overlap-add
[18].

###  5.1 Experiment 1: training frame size sweep

As an initial experiment, instances of the model were trained with frame
lengths ranging from $10\text{\,}\mathrm{ms}$ to $160\text{\,}\mathrm{ms}$ on
the following data:

  1. (a)

Digital phaser with LFO rate $T_{0}=$ $2\text{\,}\mathrm{s}$ (DP-2).

  2. (b)

Small Stone with parameter configuration A (SS-A).

  3. (c)

Small Stone with parameter configuration D (SS-D).

The training data was truncated to $2.67\text{\,}\mathrm{s}$ in duration to
accelerate training, and was deemed sufficient given that it contained at
least one LFO cycle for all case studies.

The ESR obtained in experiment 1 can be seen in Figure 7. In the case of the
digital phaser, frame lengths of $40\text{\,}\mathrm{ms}$ to
$160\text{\,}\mathrm{ms}$ all resulted in a error-to-signal of less than 1% on
the testing data – implying an accurate match between the model output and
target waveform with minimal artefacts introduced by windowing. The frame
lengths of $10\text{\,}\mathrm{ms}$ and $20\text{\,}\mathrm{ms}$ produced
worse results, suggesting an insufficient number of bins in the transfer
function shape the spectrum and/or severe time aliasing in the output. The
learned parameters during this experiment can be found in Table 2 and show a
good estimation of the parameters in the target model. Figure 8 shows the
synthesised LFO signals, compared to the target triangular wave.

In the case of the Small Stone, the resulting model accuracy depended on the
presence of feedback in the circuit. The minimum test loss was approximately
1.5% without feedback and 10% with feedback. This result is expected due to
the increase in circuit complexity and longer decay time associated with the
feedback case. In both cases, window lengths of $40\text{\,}\mathrm{ms}$ and
$80\text{\,}\mathrm{ms}$ provided the best performance—suggesting a good
trade-off between time and frequency resolution. Despite the discrepancies in
numerical results, the perceptual differences are difficult to distinguish,
informally, from the target system—however, some differences in the low-
frequencies are noted for short window lengths. The reader is referred to the
accompanying web-page for audio examples. It is interesting to observe the
learned LFO signals of the Small Stone, as shown in Figure 9. In both cases,
the MLP module has consistently predicted a similar wave-shape across the
frame-rates. When engaged, the colour switch appears to increase both the
depth and the period of break-frequency modulation.

Figure 7: ESR for different training window lengths $W$ on the test audio of
three case studies: digital phaser with $T_{0}=2$s (DP-2), Small Stone with
parameter configurations A and D (SS-A, SS-D).

Figure 8: Outputs of the MLP module (left) and the absolute error (right)
compared to the triangular LFO in the target digital phaser, with $T_{0}=2$s
(plotted left as ground truth).

Figure 9: Outputs of the MLP module in the Small Stone modelling task for
different training window lengths with feedback off (SS-A, left) and feedback
on (SS-D, right). In both cases, the training audio was recorded with the
pedal’s rate knob at 3 o’clock. NB the ground-truth signal is unknown so not
plotted.

###  5.2 Experiment 2: training frame size vs LFO rate

Experiment 2 investigated the effect of frame-length on model accuracy in more
detail, considering as a case study the digital phaser with LFO periods
$T_{0}=$ 0.5; 2; 8 The length of training data was held constant at
$10\text{\,}\mathrm{s}$, and the prior knowledge of target LFO periods
informed the choice of frame-lengths:

$W_{b}=T_{0}2^{b/2}/100\quad{\rm where}\quad b=0,\dots,10$ (19)

Figure 10 (top) shows the results of the experiment, with minimum test loss
against training frame size for different rates of phaser effect. Firstly, we
see that the model accuracy increases for longer LFO periods. This is
intuitive, as in the limit $T_{0}\to\infty$ the target system becomes linear
and time-invariant (LTI) so we expect the artefacts of frame-based processing
to diminish. Also intuitively, the results suggest the optimum window length
depends on the target LFO period. In the bottom figure, the window length has
been normalised to target LFO period. In this case, the optimum $W/T_{0}$
ratio shows consistency across the phaser rates, with $W/T_{0}\approx 5\%$
giving, on average, the lowest loss.

Figure 10: ESR against training window length $W$ (top) and the ratio of
training window length to target LFO period $W/T_{0}$ (bottom) for the digital
phaser.

###  5.3 Experiment 3: inference frame size

The aim of the final experiment was two-fold: to train instances of the model
on all six parameter configurations of the Small Stone, and to investigate the
effect of window length on model accuracy during inference. For each
configuration, the training window length was informed by the results of
Experiment 2 and set within 5-10% of the estimated LFO period (see Table 1).
The training data was truncated to contain approximately three cycles of the
LFO. After training, the models were tested using various window lengths at
inference, with the results shown in Figure 11

In both feedback configurations, the models trained on higher LFO rates (SS-A,
SS-D) were most sensitive to changes in window size at inference time. This
implies a fine balance between the window size being long enough to simulate
the transient behaviour of the device, but short enough to not smear the LFO
behaviour. In contrast, the accuracy of models trained on longer LFO periods
(SS-C, SS-F) was mostly unchanged across the range of window sizes tested.
This is a promising result, as it implies one can use a long window size for
accelerated training; but a short window size for lower-latency playback at
inference. However, the results suggest that there will always be a lower
bound on the frame size that is determined by the decay time of the system
modelled.

Figure 11: ESR using various window sizes at inference time across the Small Stone parameter configurations. The green squares indicate the training window lengths. Parameter | Description | Target value | Initial Value | Learned Value (to 3.s.f)
---|---|---|---|---
$f_{0}$ | LFO rate [Hz] | 0.5 | 0.0627 | 0.500
$g_{1}$ | Wet mix | 1.0 | 1.0 | 0.999
$g_{2}$ | Feedback gain | 0.7 | 0.01 | 0.700
$\phi$ | Feedback delay-line length (samples) | 1 | 0.5 | 0.995
$[b_{0_{1}},b_{1_{1}},b_{2_{1}}]$ | Biquad 1 feedforward coeffs. | [1, 0, 0] | [1, 0, 0] | [1.00, -0.0641, 0.0336]
$[a_{1_{1}},a_{2_{1}}]$ | Biquad 1 feedback coeffs. | [0, 0] | [0, 0] | [-0.0629, 0.0336]
$[b_{0_{2}},b_{1_{2}},b_{2_{2}}]$ | Biquad 2 feedforward coeffs. | [1, 0, 0] | [1, 0, 0] | [1.00, -0.0214, 0.0140]
$[a_{1_{2}},a_{2_{2}}]$ | Biquad 2 feedback coeffs. | [0, 0] | [0, 0] | [-0.0238, 0.0136]
Table 2: Example learned parameters of digital phaser model with $T_{0}=$
$2\text{\,}\mathrm{s}$ (DP-2). The parameters are from the best performing
model in Experiment 1, obtained using a window size of 80ms during training.
Note that the biquad feedforward coefficients have been normalised.

##  6 Conclusions and further work

This work has presented a differentiable DSP model of a phaser that uses
frame-based spectral processing to implement a time-varying filter in the
frequency domain. The model was based on a generalised continuous-time model
of a phaser effect with several free parameters learnable via gradient
descent. It was shown that the model can recover the parameters of a reference
digital phaser and learn the correct frequency, starting phase and waveform of
the underlying low-frequency oscillator (LFO), without seeing the ground-truth
LFO during training. Furthermore, the model was trained to emulate an analog
reference device. Informal listening found the model perceptually convincing
in this task for a range of parameter configurations. Formal listening tests
are important, but left for future work. It was found that the objective model
accuracy depended on the training window length and required a manual
estimation of the target LFO frequency for the best results. Future work will
aim to remove the need for this initial estimation, perhaps through a multi-
resolution training process. A key limitation of the proposed model is the
inherent latency introduced by the frame-based approach, which could be
problematic for real-time model inference. Future work will aim to remove this
by implementing an equivalent audio-rate time-domain recursion. Finally,
further work may involve extending the general approach proposed in this paper
to grey-box modelling of other time-varying filters and delay-based audio
effects such as auto-wah, flangers and chorus.

##  7 Acknowledgments

The authors would like to thank Ben Hayes, Lauri Juvela and Alec Wright for
helpful discussions on some underlying concepts of this work. Thank you to the
anonymous reviewers for their comments.

## References

  * [1] P. Dutilleux, M. Holters, S. Disch, and U. Zölzer,  “Filters and delays,”  in DAFX: Digital Audio Effects, U. Zölzer, Ed., chapter 2, pp. 47–81. John Wiley & Sons, Ltd, 2011.
  * [2] M. Holters and U. Zölzer,  “Physical modelling of a wah-wah effect pedal as a case study for application of the Nodal DK Method to circuits with variable parts,”  in Proc. 14th Int. Conf. Digital Audio Effects, Paris, France, Sept. 2011.
  * [3] F. Eichas, M. Fink, M. Holters, and U. Zölzer,  “Physical modeling of the MXR Phase 90 guitar effect pedal,”  in Proc. 17th Int. Conf. Digital Audio Effects, Erlangen, Germany, Sept. 2014.
  * [4] E.-P. Damskägg, L. Juvela, E. Thuillier, and V. Välimäki,  “Deep learning for tube amplifier emulation,”  in Proc. IEEE Int. Conf. on Acoust. Speech Sig. Proces., Brighton, UK, May 2019.
  * [5] A. Wright, E.-P. Damskägg, L. Juvela, and V. Välimäki,  “Real-time guitar amplifier emulation with deep learning,”  Appl. Sci., vol. 10, no. 2, 2020.
  * [6] J. Parker, F. Esqueda, and A. Bergner,  “Modelling of nonlinear state-space systems using a deep neural network,”  in Proc. 22nd Int. Conf. Digital Audio Effects, Birmingham, UK, Sept. 2019.
  * [7] F. Esqueda, B. Kuznetsov, and J. Parker,  “Differentiable white-box virtual analog modeling,”  in Proc. 24th Int. Conf. Digital Audio Effects, Vienna, Austria, Sept. 2021.
  * [8] B. Kuznetsov, J. Parker, and F. Esqueda,  “Differentiable IIR filters for machine learning applications,”  in Proc. 23rd Int. Conf. Digital Audio Effects, Vienna, Austria, Sept. 2020.
  * [9] S. Nercessian, A. Sarroff, and K. Werner,  “Lightweight and interpretable neural modeling of an audio distortion effect using hyperconditioned differentiable biquads,”  in Proc. IEEE Int. Conf. Acoust. Speech Sig. Proces., Toronto, Canada, June 2021.
  * [10] C. Steinmetz and J. Reiss,  “Efficient neural networks for real-time modeling of analog dynamic range compression,”  in 152nd Audio Eng. Soc. Conv., The Hague, Netherlands, May 2022\.
  * [11] M. Comunità, C. Steinmetz, H. Phan, and J. Reiss,  “Modelling black-box audio effects with time-varying feature modulation,”  arXiv:2211.00497, Nov 2022.
  * [12] A. Wright and V. Välimäki,  “Grey-box modelling of dynamic range compression,”  in Proc. 25th Int. Conf. Digital Audio Effects, Vienna, Austria, Sept. 2022.
  * [13] M. Martínez-Ramírez, E. Benetos, and J. Reiss,  “Deep learning for black-box modeling of audio effects,”  Appl. Sci., vol. 10, no. 2, 2020.
  * [14] A. Wright and V. Välimäki,  “Neural modeling of phaser and flanging effects,”  J. Audio Eng. Soc., vol. 69, no. 7, pp. 517–529, 2021.
  * [15] R. Kiiski, F. Esqueda, and V. Välimäki,  “Time-variant gray-box modeling of a phaser pedal,”  in Proc. 19th Int. Conf. Digital Audio Effects, Brno, Czech Republic, Sept. 2016.
  * [16] A. Carson,  “Differentiable Grey-box Modelling of Phaser Effects — accompanying web-page [online],” https://a-carson.github.io/ddsp-phaser/, accessed 4/4/23.
  * [17] B. Bartlett,  “A scientific explanation of phasing (flanging),”  J. Audio Eng. Soc., vol. 18, no. 6, pp. 674–675, 1970.
  * [18] J. O. Smith III,  Physical Audio Signal Processing,  http://ccrma.stanford.edu/~jos/pasp/, accessed 28/2/23,  online book, 2010 edition.
  * [19] H. Bode,  “History of electronic sound modification,”  J. Audio Eng. Soc., vol. 32, no. 10, pp. 730–739, 1984.
  * [20] V. Välimäki, S. Bilbao, J. O Smith, J. S Abel, J. Pakarinen, and D. Berners,  “Virtual analog effects,”  in DAFX: Digital Audio Effects, U. Zölzer, Ed., chapter 12, pp. 473–522. John Wiley & Sons, Ltd, 2011.
  * [21] C. Darabundit, R. Wedelich, and P. Bischoff,  “Digital grey box bodel of the Uni-Vibe effects pedal,”  in Proc. 22nd Int. Conf. Digital Audio Effects (DAFx-19), Birmingham, UK, Sept. 2019.
  * [22] T. Stockham, Jr.,  “High speed convolution and correlation,”  in Proc. Spring Joint Comput. Conf., April 1966, p. pp. 229–233.
  * [23] J. Bonada, X. Serra, X. Amatriain, and A. Loscos,  “Spectral processing,”  in DAFX: Digital Audio Effects, U. Zölzer, Ed., chapter 10, pp. 393–445. John Wiley & Sons, Ltd, 2011.
  * [24] B. Hayes, C. Saitis, and G. Fazekas,  “Sinusoidal frequency estimation by gradient descent,”  arXiv:2210.14476, Nov 2022.
  * [25] D. P. Kingma and J. Ba,  “Adam: A method for stochastic optimization,”  in Proc. Int. Conf. Learning Representations, San Diego, CA, 2015\.
  * [26] J. Sleep,  “Small Stone Information [Online],” http://generalguitargadgets.com/effects-projects/phase-shifters/small-stone-information/, accessed 26/3/23.


# ML-Assisted UE Positioning: Performance Analysis and 5G Architecture
Enhancements

M. Majid Butt, , Anna Pantelidou and István Z. Kovács
This work has been presented in part at VTC-Spring 2020 [1].M. Majid Butt,
István Z. Kovács, Anna Pantelidou are with Nokia Bell Labs. e-mail:
{majid.butt, istvan.kovacs<EMAIL_ADDRESS>
###### Abstract

Artificial intelligence and data-driven networks will be integral part of 6G
systems. In this article, we comprehensively discuss implementation challenges
and need for architectural changes in 5G radio access networks for integrating
machine learning (ML) solutions. As an example use case, we investigate user
equipment (UE) positioning assisted by deep learning (DL) in 5G and beyond
networks. As compared to state of the art positioning algorithms used in
today’s networks, radio signal fingerprinting and machine learning (ML)
assisted positioning requires smaller additional feedback overhead; and the
positioning estimates are made directly inside the radio access network (RAN),
thereby assisting in radio resource management. In this regard, we study ML-
assisted positioning methods and evaluate their performance using system level
simulations for an outdoor scenario. The study is based on the use of
raytracing tool, a 3GPP 5G NR compliant system level simulator and DL
framework to estimate positioning accuracy of the UE. We evaluate and compare
performance of various DL models and show mean positioning error in the range
of 1-1.5m for a 2-hidden layer DL architecture with appropriate feature-
modeling. Building on our performance analysis, we discuss pros and cons of
various architectures to implement ML solutions for future networks and draw
conclusions on the most suitable architecture.

###### Index Terms:

5G, Deep learning, Radio Access, Localization.

##  I Introduction

###  I-A Intelligence in Beyond 5G Networks

A lot of attention has been drawn in the last few years around the 5th
generation (5G) New Radio (NR) cellular systems, which has been under
standardization by the 3rd Generation Partnership Project (3GPP). 5G promises
ubiquitous connectivity of a massive number of heterogeneous services. Users
in a 5G network may have very different performance requirements in terms of
data rates, reliability and latency. To support those, 5G networks are
designed to be very flexible and sophisticated, but also highly complex. This
renders optimization of different network functions difficult. Artificial
intelligence (AI) and Machine Learning (ML) in particular have been recently
investigated as promising techniques that can be used to optimize network
functions by introducing an additional data-driven intelligence to the network
[2].

Network virtualization and network softwarization solutions in 4G networks can
support data-driven intelligent and automated networks to some extent. In 5G
and beyond systems, network intelligence is envisioned to be end-to-end. The
user equipment (UE) devices need to be smarter, environment and context aware,
and capable of running ML algorithms. The radio access network algorithms and
radio resource management (RRM) functions can exploit network intelligence to
fine tune network parameters to reach close-to-optimal performance. More
dynamic network topology and more flexible self-organization need to be
integrated in the network to support highly versatile network traffic. The era
of network virtualization and network softwarization in 4G and 5G leads to the
era of smart, intelligent and automated networks of the future in 6G.

(a) Conventional Positioning

(b) ML-assisted Positioning

Figure 1: In conventional positioning solutions, beam RSRP values as well as
angle of arrival is reported back by a UE to gNB. Our proposed ML solution
exploits just RSRP values reported by the UE.

###  I-B UE Positioning: Motivation and State of the Art

5G technologies introduce a new paradigm to connectivity and mobility by using
accurate location information. Positioning and localization studies have been
conducted for various applications and devices for many decades such as global
positioning systems, industrial internet of things, autonomous driving, indoor
maps and so on [3, 4]. Positioning applications are found from small indoor
area to wide landscapes of satellite coverage. As mobile handsets are
widespread, users start utilizing localization services through cellular
networks. In the 5G era, even higher number of device types appear such as
sensor devices, robots and vehicles; all operating based on highly accurate
location information.

Positioning accuracy is one of the most important factors to evaluate
localization system performances. Federal Communications Commission (FCC) in
the United States has set the E911 regulatory performance requirements [5] as
well as further accuracy requirements defined tightly by commercial systems
[3]. FCC E911 requires horizontal error less than 50m and vertical error less
than 5m for $80\%$ of UEs [5]. In commercial systems like 3GPP, requirements
are tighter than E911 ones. To reach these levels, novel enhanced positioning
methods need to be investigated.

In order to achieve such goals of high accuracy and measurement efficiency,
various positioning methods have been deeply studied. In localization systems,
usually a positioning method is defined based on a particular type of
measurement metric. As illustrated in Fig. 1(a), timing-based techniques take
advantage of knowledge of time-differences due to the speed of RF signals for
distance calculation between a transmitter and a receiver. The measurement
matrix is estimation of the time of arrival (TOA) of signals. Angle-based
techniques take advantage of transmit beamforming of signals and differences
of phase across receive antenna elements to determine the angle between a
transmitter and a receiver. There is a lot of literature available on UE
positioning in 5G based on UE signal time and angle measurements or a
combination of them, e.g., [6, 7, 8, 9]. A detailed overview of positioning
technology and road map to 5G positioning architecture is provided in [8]
while Wymeersch et al discuss positioning for vehicular networks in 5G era
[9].

As the NR physical layer design inherently supports beam-based Reference
Signal Received Power (RSRP) measurement reports from the UE for multiple
beams, we study how well ML-based approaches work to determine the UE position
directly from these measurements as illustrated in Fig. 1(b). During the ML
inference, the only inputs needed are measurements the UE is providing to its
serving cell, hence the positioning estimation can be done using an ML
inference engine in the baseband of the UE’s serving cell, avoiding the need
for the location server framework which resides outside the radio access
network and therefore, efficiently supporting a single-cell based positioning
method.

ML techniques have been used to solve various problems in communication
systems. References [10, 11, 12] survey some exciting works on use of ML
algorithms in the field of wireless communication and networking. Some recent
works apply ML techniques for localization problems. In [13] autoencoder-based
indoor localization method is studied that provides high-performance 3-D
positioning in large indoor places for bluetooth low energy networks. The
authors in [14] propose a machine learning approach based on Gaussian process
regression to position users in a distributed massive multiple-input multiple-
output (MIMO) system with the uplink received signal strength (RSS) data. The
simulation results show that the proposed method improves performance in
massive MIMO scenarios. In [15], neural networks are used on input of
fingerprint data obtained from channel characteristics and geographical
locations and median error of 6 and 75 meters is reported for indoor and
outdoor scenarios, respectively. Similar approaches for UE positioning using
neural networks (NNs) are investigated in [16, 17, 18, 19, 20] as well.

Most of these works discuss ML-based positioning in different settings than
ours. For instance, work in [13] is limited to bluetooth networks, [16, 17]
focus mainly on data from Wifi networks, while results in [18] are limited to
the case where data is available reliably from three base stations, none of
them is a limitation of our work. The authors in [15] use more practical
settings for their evaluation but their feature selection is different and
evaluation is limited to indoor scenarios unlike this work, where evaluation
is carried our for more challenging out door scenarios by making use of
raytracing. The works in [19] and [20] evaluate UE positioning in the context
of 5G networks but evaluations are very limited in terms of details on feature
selection and no insight is provided on challenges associated with deployment
of ML based positioning in 5G networks. The authors in [14] provide
fundamental results on error bounds using ML and no evaluation results are
provided for the practical cellular networks. Furthermore, we dedicate second
part of the paper to network architecture aspects, including measurement
collection, ML module hosting and associated challenges in practical
deployment of the solution in 5G networks. This study is integral part of 5G
networks going forward and missing in literature.

###  I-C Contributions

Recent literature on the usage of ML in wireless networks emphasizes on
fundamental communication problems [21], potential use cases [22] and
associated challenges; but there is a lack of studies on the larger scale
performance analysis at system level and the challenges associated with ML
algorithms implementation in 5G networks. Standardization bodies, such as
International Telecommunication Union [23], and 3GPP (Rel 17 and Rel 18) have
started working on identifying requirements for the future networks.

This article complements the standardization efforts and aims at filling this
gap by studying performance of UE positioning as an example use case, and
discussing architecture level aspects for implementing ML-assisted solutions
in 5G and beyond networks.

Our contributions are summarized as follows:

  * •

We provide a comprehensive system level study starting from generating
raytracing data, using system level simulator to generate RSRP fingerprinting
for geographical $(X,Y)$ coordinates; and finally applying ML techniques to
train and validate UE positioning accuracy.

  * •

We study various input features that contribute to improve positioning
accuracy and conclude that a combination of RSRP values from the serving and
neighboring cell beams provides the best results. Then, we evaluate the
performance of network level and cell-specific training topologies and
quantitatively show that cell-specific training outperforms network level
training. For the sake of comparison, we evaluate decision tree regression ML
technique to evaluate the performance.

  * •

We identify main requirements to implement ML solution for UE positioning use
case. In particular, we identify the data source for the ML model host and
analyze how data could be gathered in 5G-RAN architecture to train the ML
model and subsequently use it for inference. Then, we identify ML model hosts
in relation to 5G-RAN architecture and describe pros and cons for the proposed
solutions with respect to data availability and overhead cost.

The rest of this paper is organized as follows: after describing 3GPP system
activities in relation to UE positioning in Section II, we proceed with
details of set up for our case study in Section III. Performance of the ML
approach is evaluated and discussed in Section IV. Section V and VI discuss 5G
architecture level support to run ML solution for this use case and associated
design challenges. Section VII concludes with the main contributions of the
paper.

##  II 3GPP Standardization on Positioning

3GPP positioning feature has been supported in Rel-9 LTE networks; several RF
based positioning methods have been introduced, and advanced techniques are
under investigation for NR in Rel-16 and Rel-17. Recent 3GPP NR positioning
study conclusions have been stated in [24]. There has been discussion of many
different possible positioning solutions in the study item, conclusions have
been made that the 3GPP NR systems should support solutions of observed time
difference of arrival (OTDOA), uplink time difference of arrival (UTDOA),
angle information, Multi-Cell Round Trip Time (Multi-RTT), and enhanced cell-
ID (E-CID) in NR Rel-16 [25]. For the proposed solutions, 3GPP is under
discussion to define network measurements through DL or UL radio link.

One of the major changes in NR compared with legacy cellular networks is the
addition of the millimeter wave (mmWave) frequency band. NR also provides
support for beam-based operations. During the beam search operation, the angle
can be obtained easily in terms of downlink angle of departure (DL-AoD) and
uplink angle of arrival (UL-AoA). While UEs and gNBs search for the best beam
for radio link, DL and UL RSRP is measured to evaluate signal quality of a
beam. Received power measurement has been considered for positioning
fingerprint in wireless systems [26].

Figure 2: Schematic diagram for our proposed ML-assisted UE positioning
framework. Offline data pre-processing and ML training is performed while
online part performs inference.

5G technologies introduce a new paradigm to connectivity, location awareness
and RRM by providing accurate UE location information to network functions. In
future 3GPP releases, positioning enhancements are envisioned to achieve
different levels of positioning accuracy for different applications.
Positioning requirements in 3GPP are under discussion with horizontal
positioning accuracy for general commercial use cases (80% of users) with less
than 1m accuracy and the positioning latency below 100ms [27]. For industrial
IoT use cases, the position accuracy of less than 20cm is required with a
desired latency in the order of 10ms [28].

3GPP Release-17 and beyond is further evolving to improve accuracy and latency
with advanced technologies in specific scenarios. 3GPP has interests in centi-
meter accuracy positioning measurements through carrier phase measurement or
wideband positioning measurements [3, 29]. Positioning using machine learning
is one of key topics as well. Positioning service latency is another important
factor to evaluation positioning system especially for vehicle and industrial
use cases. As enabling technologies, V2X and sidelink supports ad-hoc
positioning measurements, and on-demand positioning reference signal (PRS)
supports rapid scheduling of PRS and measurements effectively.

Achieving better accuracy requires more radio resources and signal bandwidth,
computational power, more overhead in collecting more measurements and more
delay in processing this information. Thus, positioning can be treated as a
service with different quality of service (QoS) attributes. A request for UE
location may be conveyed with a required QoS, which includes the desired
location accuracy (vertical and/or horizontal) as well as the response time.
In fact, the location service (LCS) can allow the LCS client to specify its
required quality of service parameter. In 3GPP standard, two different LCS QoS
class options are defined [30]. In _assured class_ , the requirements for
estimated UE position are strict in terms of accuracy and response time. If
the obtained result does not fulfill the indicated requirements, then the
response will be discarded by the LCS service. In the _best effort class_ ,
the requested location QoS is not strict and the LCS service should receive
the information, even if it does not fulfill the indicated requirement. The
selection of the most suitable positioning method, e.g., AoA, ToA based
methods; and its related parameters should account for this QoS information
when available.

##  III Positioning in 5G Systems: A Case Study

###  III-A System Setup

We first describe the system set up for our study. As shown in Fig. 2, the
system set up is divided into the following main components:

  1. 1.

Raytracing: A raytracing software is used to generate raytracing data as a
function of $(X,Y)$ coordinates, and full 3-D multipath ray data is generated
for each point. In this case, an outdoor urban database and the Intelligent
Ray Tracing algorithm were configured.

  2. 2.

System Level Simulation: As the NR system is required to construct measurement
per beam, we investigate NR received signal power based positioning method.
Based on the raytracing data generated for channel modelling, system level
simulation of the 3GPP 5G NR air interface including beamforming is run to
produce beam RSRP values for each UE. The details of the parameters used in
system level simulations are provided in Table I and Table II. The serving as
well neighboring beam RSRP values serve as fingerprinting for the under-study
area based on raytracing data.

  3. 3.

Offline ML Training: Based on the data received for the system level
simulator, offline ML training is performed. We select beam RSRP values as
input features and train ML model with feed-forward neural network as well as
decision tree algorithms.

  4. 4.

Online ML Inference: Finally, trained ML model is numerically evaluated to
determine UE location. Euclidean distance between the estimated and actual UE
position, which is assumed to be known, serves as the accuracy measure for the
estimated UE position.

The last block in Fig. 2 points toward possible use cases for application of
accurately estimated positioning data.

Raytracing is performed for a section of Lincoln Park, Chicago. Eight sites
are placed at each street corner as shown in Fig. 3. In this study, we have
confined ourselves to study of positioning accuracy for the UEs that have a
Line of sight (LoS) connection to their serving cell. We observed that
positioning accuracy using this ML-assisted method in the mmWave propagation
environment is severely affected when LoS is not available to the UE. However,
this may not be a big issue in future networks where very dense mmWave
deployments are planned and LoS non-availability chances will not be that
high. In our study, $62\%$ of the UEs have LoS available and we consider only
those users for ML training and testing. For ML training purpose, we only
consider RSRP feature for the beams in current time slot, i.e. a snapshot
based approach is employed. The methodology used in this study provides an
efficient option to evaluate feasibility of this approach compared to drive
testing.

We use two parameters, mean and standard deviation denoted by $\bar{E}$ and
$\sigma$ respectively, of the Euclidean distance between the estimated
training/test UE position and the actual UE position and define them as,

$\displaystyle\bar{E}$ $\displaystyle=$
$\displaystyle\frac{\sum_{n=1}^{N}x_{n}}{N}$ (1) $\displaystyle\sigma$
$\displaystyle=$
$\displaystyle\sqrt{\frac{1}{N}{\sum_{n=1}^{N}(x_{n}-\bar{E})^{2}}}$ (2)

where $x_{n}$ is the value for UE Euclidean distance for $n^{th}$ sample.

Figure 3: 8 sites are placed at 8 corners of Lincoln Park, Chicago for the
purpose of raytracing data generation.

###  III-B Summary of Deep Learning Architecture

Deep learning is one of the powerful ML techniques to solve
classification/regression problems. Deep feedforward networks are advanced
neural networks (NNs) with one or more hidden layers of neurons between input
and output layer.

A feedforward deep NN (DNN) has an input layer, which is connected with output
layer through hidden layers. The hidden layers represent _depth_ of the
network, and ’deep learning’ term arises from this. The number of neurons in
each layer represent _width_ of an NN where neuron is a computational unit
that represents a vector-to-scalar mapping. An activation function, such as
’tanh’ and ’Rectified Linear Units (ReLU)’, is used to compute element
(neuron) wise non-linear transformation of learned parameters ’weights’ and
’bias’, which is transferred to next layer. Goal of a DNN is to learn the
function that maps input $x$ to output $y$. Input vector $x$ is termed as
_feature vector_ in DL literature. Architecture of a neural network defines
how many layers a NN has, how many neurons per layer are required and how
layers are connected. This is a stochastic process and termed as
’hyperparameter’ optimization.111Hyperparameter optimization is one of the
main tasks in ML and include optimization of several parameters by
experimentation.

For supervised learning, the term ’Loss’ is defined as the difference between
the computed output and actual output parameterized by some function, such as
minimum squared error (MSE), entropy function, etc. Based on the training
data, DNN tries to learn mapping function that minimizes ’loss’ as training
progresses. During inference, test error is computed by an appropriate metric
to compute accuracy of the trained DNN.

In ML, ’overfitting’ and ’underfitting’ are two important concepts.
’Overfitting’ represents the situation when DNN is over-trained and it becomes
hard for the computed model to be generalized for the unknown testing
examples. To overcome this problem, ’early stopping’ and ’regularization’ is
used. On the other side, ’underfitting’ represents the situation when both
training and testing error are large [31]. Analysis of training and testing
error provides good indication of accuracy of DNN model and helps designer
take right actions to improve the model. Collecting more data and/or
hyperparameter optimization are the well-known solutions.

Unlike conventional positioning methods based on ToA and AoA information, ML
assisted positioning does not necessarily require measurements from the
neighbouring gNBs for triangulation. ML-assisted algorithms can be used to
compute UE position based on RF-fingerprinting of UE location and the RSRP of
the beams serving the UE. In the next section, we present results based on a
case study conducted in a millimeter wave (mmWave) outdoor scenario.

##  IV Performance Evaluation

TABLE I: Raytracing Parameters Parameter | Value
---|---
Number of sites | 8
Access Point height | 10m
Inter-site distance | 110m vertical, 200m horizontal
Carrier frequency | 28 GHz
Resolution of data points | 1m (123,768 locations sampled)
TABLE II: System Level Simulation Parameters Parameter | Value
---|---
Number of SSB beams | 32
Number of gNBs | 8 having 3 sectors each
DL Tx Power per sector | 30 dBm
Element Azimuth Beamwidth | 65 degrees
Element Elevation Beamwidth | 65 degrees
Element gain | 8dBi
Front2Back | 30dB
Mechanical downtilt | 5 degrees

(a) Example 1

(b) Example 2

Figure 4: Pattern for RSRP values for the 32 beams received at the UEs in
close proximity.

Parameters used for raytracing in raytracing software and system level
simulations are summarized in Table I and II, respectively. In particular,
Table I shows the parameters used for raytracing module with 8 sites, each
with heigh 10m, as shown in Fig. 3. Resolution of raytraced data points is 1m,
i.e., raytracing area is sampled at interspacing of 1m.

In Table II, parameters used in system-level simulations are shown. The
coverage is beam-based in 5G, not cell based. There is no cell-level reference
channel to measure the coverage of the cell. Instead, each cell has one or
multiple Synchronization Signal Block Beam (SSB) beams and the UE can select
candidate beams after beam sweeping. The antenna panel used for system level
simulations was a $16\times 16$ cross-pol array, formed of 16 azimuthal beams
and 3 elevation beams and grid-of-beam comprises 16 non-uniform beams to cover
the full cell. Further details, on physical antenna parameters are provided in
Table II.

For evaluation of DL module, the parametric settings are explained as follows.
90$\%$ of the labeled data is used for training and $10\%$ is set aside for
validation. Other parameters include, Batch size = 32, ’tanh’ activation
function for input and hidden layers, linear activation function for output
layer, ’adam’ optimizer, loss metric = ’MSE’. We used Keras API with
TensorFlow backend. ’Early Stopping’ based on the ’loss’ in the training data
is set to prevent overfitting while maximum number of epochs is set to 500.
Data is normalized using mean and standard deviation normalization.

###  IV-A Decision-Tree Regression

For the baseline ML solution, we use Decision Tree Regressor algorithm to
evaluate performance. Decision Tree is a supervised learning method used for
classification and regression for the problems where feature vectors have
’tree like’ structure. The goal is to train a model that predicts the value of
a target variable by learning decision rules inferred from the data features.
Decision trees are simple to implement and results can be easily visualized
and analyzed. Our feature vector (explained later in this section) has a ’tree
like’ structure as illustrated in Fig. 5 and suits well to regression problem
at hand. The UEs are first subdivided based on cell IDs. Further divisions are
done based on beam IDs, and finally RSRP values help to differentiate between
UEs with the same beam and cell ID. Later, in this section, we compare the
Decision-Tree Regressor algorithm based performance evaluation with the DL
based results.

Figure 5: Block diagram for the tree like feature structure considered in this
work.

###  IV-B Network-Level DL Training

We first study the case where ML training is performed over all the data
available from 24 sites at one positioning server. Current 3GPP standards
support UE reporting for up to 4 strongest beams from the serving cell. In
Table III, we show training and testing accuracy for the case when RSRP values
for 4 strongest beams from the serving cell, corresponding beam IDs and cell
ID is the input for the input layer of the DNN. This will serve as a baseline.
For the 9 input features ($4\times$ beam ID, $4\times$ RSRPs, Cell ID), we
train our DNN. We use only one hidden layer to get some idea on suitability of
features and vary the number of neurons for each experiment222Multilayer NNs
improve accuracy as we show later, however we confine ourselves to single
hidden layer in the beginning to get more insight on the other parameters
influencing our model.. Estimation accuracy improves with increasing number of
neurons and we get mean test accuracy of approximately 5m for very large
number of neurons.

TABLE III: Positioning Accuracy for 4 Strongest beams from the Serving Cell No. | Training $\bar{E}$ | Training $\sigma$ | Test $\bar{E}$ | Test $\sigma$
---|---|---|---|---
Neurons | (m) | (m) | (m) | (m)
576 | 5.4 | 4.3 | 5.7 | 5.1
1152 | 4.3 | 3.4 | \footnotesize4.9⃝ | 4.4
2304 | 4.1 | 3.1 | 5.1 | 4.7

In Fig. 4, we investigate the main hurdle in improving positioning accuracy
based on RSRP values of the beams from the serving cell alone. The figures are
plotted by choosing a UE randomly and then finding the UEs in its close
proximity. We observe high correlation in serving cell beam IDs and their
respective RSRP values for the UEs, which makes it harder to improve
positioning accuracy of the UEs in close proximity. Fig. 4(a) and Fig. 4(b)
show 2 such examples where RSRPs for the strongest beam IDs are almost
overlapping. After some further experimentation with various number of
strongest beams from the serving cell with DNN (not reported in this paper),
we observe a negligible difference in positioning accuracy by using 3 instead
of 4 beams from the serving cell. As UE reporting is costly operation, we use
RSRP values for at most 3 beams from the serving cell for further
investigation in this sequel.

TABLE IV: Positioning Accuracy for with Fixed 3 beam RSRPs from the Serving Cell and Varying beam RSRPs from the Neighboring Cells No. beams from | Training $\bar{E}$ | Training $\sigma$ | Test $\bar{E}$ | Test $\sigma$
---|---|---|---|---
neighbor cells | (m) | (m) | (m) | (m)
0 | 4.3 | 3.6 | 4.8 | 4.7
1 | 2.8 | 2.6 | 3.6 | 4.8
2 | 2.2 | 1.5 | \footnotesize3.0⃝ | 3.4
3 | 2.1 | 1.5 | 3.1 | 4.9

Next, we propose to make use of RSRP values of the beams not only from the
serving cell but from the neighboring cells as well. In Table IV, we show
position accuracy results by fixing the number of strongest beams from the
serving cell to 3 and varying the number of beams from the neighbor cells. For
example, using 2 strongest beams from 2 neighbor cells along with their beam
and cell IDs give us 6 more features in addition to 7 features from 3 beam
IDs, their respective RSRP values and cell ID of the serving cell. From Table
IV, we observe that mean accuracy of 3m is achieved by using data from 2
strongest beams from the neighboring cells in addition to 3 serving cell
beams. This is considerable improvement over the case using data from beams
only from the serving cell. This performance gain is achieved by adding more
features and data for the DNN model training.

###  IV-C Cell-Specific DL Training

Looking beyond feature engineering, we investigate the effect of change in
location of training. In Section IV-B, the DNN training was performed with all
the data from several sites at one location server. In this section, we study
positioning accuracy by training individual cell-specific DNN model for each
cell. This results in removing the serving cell ID feature from the feature
vector as it is known a-priori, called dimensionality reduction in ML
literature. We preprocess data generated by the system level simulator to
differentiate data for various cells. As a result, size of both training and
test data may vary from cell-to-cell. For example, we have data for more than
$10\times 10^{3}$ positions for cell number 14, while it is about $700$ for
cell number 1. However, this variance in number od training examples does not
affect results in our case as the resolution for Ray-tracing is kept fixed for
all the cells regardless of their size.

TABLE V: Cell-Specific-Training, Single Hidden Layer: Positioning Accuracy for data from both Serving and Neighboring Cells No. beams from | Training $\bar{E}$ | Training $\sigma$ | Test $\bar{E}$ | Test $\sigma$
---|---|---|---|---
neighbor cells | (m) | (m) | (m) | (m)
0 | 2.9 | 3.0 | 3.3 | 3.1
1 | 2.3 | 2.0 | 2.8 | 5.1
2 | 1.7 | 1.2 | \footnotesize2.0⃝ | 2.1
3 | 1.4 | 1.1 | 1.9 | 1.7
TABLE VI: Cell-Specific-Training, 2 Hidden Layers: Positioning Accuracy for data from both Serving and Neighboring Cells No. | Training $\bar{E}$ | Training $\sigma$ | Test $\bar{E}$ | Test $\sigma$
---|---|---|---|---
Neurons | (m) | (m) | (m) | (m)
32 | 2.2 | 1.6 | 2.4 | 1.6
64 | 1.1 | 0.7 | \footnotesize1.4⃝ | 1.2
128 | 1.2 | 0.8 | 1.5 | 1.4

In Table V, we study DNN with a single hidden layer and cell specific training
for cell number 14. As previously observed, best feature vector uses data from
3 strongest beams from the serving cell. We further investigate accuracy by
varying the number of beams from the neighboring cells for cell-specific
training. Again, positioning accuracy improves by using data from more beams
from the neighboring cells. In this case, the largest mean positioning
accuracy is achieved for 3 neighboring cells; but difference is negligible as
compared to 2 neighboring cell case. Looking at the cost of reporting
information for this extra beam from the neighboring cell, we can safely
assume that most of the performance gain is achieved with data from 3 serving
and 2 neighboring cell beams. Remarkably, cell-specific training provides us
mean positioning accuracy of 2m for 3 serving and 2 neighboring cell beams
case which is considerably higher than the accuracy of 3m for the same
configuration for network level training. This gain emerges from preprocessing
step to get cell-specific data from the data set and removing _Cell ID_
feature. To further achieve better results, we now look at further improving
results by adding one more hidden layer to DNN. Table VI shows that mean
positioning error can be reduced to 1.4m by using 64 nodes in both hidden
layers of DNN, a performance gain of 0.5m over the same parameters and single
hidden layer case. To elaborate further on the results, Fig. 6 shows
cumulative distribution function (CDF) for this particular parameter set333CDF
is the most commonly used criterion for reporting results in industry as it
gives information about other percentile, e.g., $80\%$, $90\%$ percentile..
The results illustrate that almost 30% UEs achieve positioning error less than
1m and less than 10% have error greater than 3m.

Figure 6: CDF of positioning accuracy for the 2 hidden layer, cell specific DL
training for cell 14.

To conclude, we summarize all the results in Fig. 7 and show that DNN with
cell-based training using both serving as well as neighboring cell RSRP beam
features provide the most accurate results. We include evaluation results for
the baseline Decision-Tree Regression approach for _network level_ training.
Network level training eliminates the need for cell-level training servers
without much loss of performance as decision tree regressor can easily
differentiate cells based on their IDs at first level of branching as depicted
in Fig. 5. The input features for the baseline case are the same as for DNN
approach, i.e., 3 beams from the serving cell and 2 from the neighboring
cells. We get mean positioning error of 2.1m which is less than the mean
positioning error obtained by DNN approach.

##  V Architecture Support for ML-Assisted Use Cases

Figure 7: Performance comparison of Decision Tree Regressor and various DNN
cases with different input features, number of hidden layers (HL) and
architecture for training data, i.e. network based (NB) or cell-based (CB).

Based on our performance analysis in previous section, we discuss architecture
level aspects to implement ML solutions in 5G networks. In relation to
measurement data collection and network support, it is important to answer a
few fundamental questions for any use case enabled with ML assistance:

  * •

Data sources: How and from where to collect sufficient data for ML training
and inference?

  * •

Training and inference hosts: What are the 5G system (5GS) entities to place
the ML training and inference modules?

  * •

Required enhancements: Does the current 5GS architecture support the required
data collection? Which 5GS architecture enhancements would be needed?

To answer the above for the UE positioning use case as an example, we have
primarily looked at the fundamental architecture problems associated with
implementation of ML and specifically supervised learning techniques in 5G
radio access network (RAN).

5G NR architecture introduced a split RAN architecture for a 5G NodeB (gNB),
where a gNB consists of a Centralized Unit (gNB-CU) and one or more
Decentralized Units (gNB-DU) [32]. In the split architecture adopted by 3GPP,
the lower layers of the protocol stack reside at the gNB-DU and the higher
layers, including the radio resource control (RRC), are part of the gNB-CU
[32]. An example of split architecture with 2 gNB-CUs hosting 3 gNB-DUs each,
is illustrated in Figure 8. Given this split architecture, all the RRC
specific messages and configurations are performed at the gNB-CU. To be able
to monitor and maintain network operation, network configures UEs with
measurement reports. Measurement reports can be configured from RRC in which
case the configured UE measurements are sent to the gNB-CU. One type of UE
reports is obtained by the network through configuration of MDT reports.
Additionally, network can configure radio measurements, involving the physical
and MAC layers, as well as their reporting. Those measurements are either
periodic in nature or sent upon trigger and are available at the gNB-DU
hosting the lower layers in the form of channel quality indicator (CQI)
reports.

Figure 8: Proposed ML-Assisted RRM architecture. As illustrated on the left side of the figure (gNB1 (CU1)) ML Training can be performed in gNB-CU, and OAM, while ML Inference can be performed in the gNB-DU or gNB-CU. The exact possibilities on ML Training and Inference for the specific use cases of Positioning are given at the right side of the figure (gNB2 (CU2)). TABLE VII: Summary of ML-assisted UE Positioning Use Case Requirements for ML | 5G Network Options
---|---
Data Source |  Training: UE measurements (RSRP, location); other options (AoA, ToA)
| Inference: UE measurements (RSRP); other options (AoA, ToA)
Training Host |  option 1: gNB-CU
|  option 2: OAM
Inference Host | gNB-DU
Required Enhancements |  UE: periodic Immediate MDT reports with low overhead
|  OAM: ML-data processing and storage from large number of cells and UEs
|  gNB/gNB-CU: ML-data processing and storage, transfer to/ from other gNBs
|  OAM and gNB/gNB-CU communication: ML-data transfer between gNB and OAM/TCE

###  V-A Measurement Collection for Running ML Solutions

Supervised ML solutions comprise two phases, the training phase where
measurements are used to train an ML model and the inference phase where the
model is executed. In order to train an ML model, it is important to obtain
”sufficiently” large number of high-quality measurements for training an ML
model. In Long Term Evolution cellular systems (LTE), 3GPP introduced
Minimization of Drive Tests (MDT) [33] as a methodology to support network
planning and optimization by detecting and troubleshooting erroneous network
situations, such as coverage holes and weak coverage in the uplink or downlink
directions to name a few.444MDT is a feature introduced in 3GPP Rel. 10 which
allows operators to collect data from UEs, e.g., radio measurements and
location information, in order to improve network performance. To achieve
that, MDT requests, manages and processes a (potentially) large amount of
data. Even though MDT was originally introduced in LTE, it has currently been
under NR standardization. Since MDT requests measurements from the UEs, it has
been considered a viable solution to obtain radio measurements for ML model
training. Similarly, for the ML inference phase, (near) real time data needs
to be collected from the MDT and an appropriate action is performed as a
result of ML inference.

In MDT, the network can configure a UE with specific measurements. There are
two modes for MDT measurements: Logged MDT and Immediate MDT. In Logged MDT,
the network configures a UE in RRC Connected State with a measurement
configuration. The UE logs measurements according to its configuration while
in RRC Idle or RRC Inactive states. Then, UE indicates data availability to
the network when it returns to RRC Connected state so that the network can
retrieve it. In LTE, logging was only periodical but in NR event-based logging
is also introduced to address ”out of coverage” detection.

Since MDT handles UE measurements, it has been considered as a viable
methodology for training of ML models. Also, both Immediate and Logged MDT can
be useful in providing UE measurements for UE localization since each method
targets UEs in a different state; in Immediate MDT measurements are provided
to the network by UEs in RRC Connected state while in Logged MDT a UE logs
measurements while in RRC Idle or Inactive states. By using both methods to
obtain measurements a larger number of UEs can be targeted providing a larger
and more diversified set of measurements in short time.

Despite its natural connection to data collection for ML, MDT is an optional
feature and does not bind UE manufacturers with implementing it. Furthermore,
user consent issues may arise where a user may not be willing to provide data
to the network exposing for instance its location or other user-specific
information. Thus, it is still challenging to obtain the required measurements
from UEs. Besides, the number of measurements required to obtain meaningful
training results can be large and depends on the performance sought by the ML
algorithm. For example, in UE positioning the number of measurements collected
for basic best effort positioning can be much less than those when some
guarantee on the positioning accuracy is expected. Furthermore, since
obtaining and reporting of UE measurements consumes UE resources (e.g., in
terms of battery power, memory, etc.), there should be a balance in the number
of measurements that the UE is configured to report to the network and in the
performance gains.

To address these problems above, network can further use measurements
internally collected and accumulated. For instance, downlink CQI feedback can
be collected by the gNB-DU and could be used in combination with RRC-based
reporting methods to help network with the data collection. Using such methods
would relieve some of the requirements on UE reporting for data collection. On
the other hand, this will come at the cost of a higher complexity on
collecting all the measurements on a single network entity since some of the
measurements may be available at the gNB-CU and others at a gNB-DU.

All above factors render the measurement collection process to be complex. In
this paper, we assume that UEs can provide the requested measurements to the
network, at least via the standardised RRC measurement reports, and we discuss
various options for the ML training and inference functions.

###  V-B ML Training and ML Inference Modules

As we discussed in the previous section, the training of an ML model requires
a potentially large number of measurements. Thus, it is natural to assume that
the training of an ML model will be placed at a network entity where the
measurements are available. In the 5G architecture, MDT measurements can be
reported by the UEs to the gNB-CU. This implies, that gNB-CU is a network
entity that may receive combined UE measurements from all UEs under this gNB-
CU. A gNB may log these measurements and forward the logs to the Trace
Collection Entity (TCE) that resides in the Operations and Management (OAM) of
the network. Thus, 5G architecture provides two natural locations to perform
the ML training, the gNB-CU and the OAM. Performing ML training at the gNB-CU
provides centralized optimization over the received measurements collected by
the UEs connected to it. On the other hand, ML training at the OAM could
additionally provide even more global optimization by combining measurements
obtained across gNBs.

For ML based positioning use case, non-real time, or near real-time, inference
is sufficient for most of the applications, which can be run in the gNB (DU or
CU). Where to run ML inference exactly, depends on the ML-assistance use case.
Specifically, when it comes to ML for localization, lower layer UE
measurements are used for the inference. It is therefore natural that the
inference is placed at the gNB-DU. Figure 8 depicts the possible locations
where ML training and ML inference can be placed within a split 5G-RAN
architecture.

##  VI Summary: Design Considerations

In Table VII, we summarise our findings, and the proposed answers to the main
questions raised in Section V.

The UE positioning relies on the UE downlink radio measurements and their
corresponding RRC reports or MDT reports to the serving gNB (or gNB-CU). ML-
assisted RRM algorithms can accommodate multiple types of input data sources
simultaneously, which can further enhance their inference capabilities.
Examples for such inputs are: RSRP measurements, UE location information, etc,
while others like cell load measurements, UE traffic type can as well be used
for other ML based use cases.

These types of ML-assisted mechanisms must rely on a minimum ’quality’ of the
input data in order to ensure good performance. This is not a trivial task,
especially when considering inputs generated in systems not fully controlled
by the 3GPP network and its RRM algorithms.

Training of the proposed ML-assistance algorithms for the studied UE
positioning use case can be done at the gNB and/ or at the UE. More advanced
training can combine joint training at the gNB and at the UE. Furthermore,
since MDT measurements are forwarded from the gNB to the OAM, ML training at
the OAM can further take advantage of the higher computational power it
offers. Additionally, since OAM is a reception point of MDT reports from
multiple gNBs, it can further provide a centralized system-wide ML solution.
ML training at OAM is also a viable solution for enhanced localization
purposes. Particularly for the localization use case, the ML inference is
performed at the gNB-DU, since this is a network entity with knowledge on
lower layer information, e.g., beam information and RSRP values.

The ML-assistance, data processing and data transfer functionalities need to
be available in the gNB (DU and/or CU) or OAM, either directly implemented in
these entities, or in separate host entities with direct interfaces to the gNB
and OAM [23].

##  VII Conclusions

In this article, we have comprehensively analyzed UE positioning use case for
application of machine learning for performance enhancement in 5G networks.
Performance of UE localization use case is evaluated for various input
features, network configuration for model training and neural network
architecture; and UE positioning accuracy of 1-1.5m is observed for LOS UE
measurements. Furthermore, the challenges in implementing machine learning
solution for the studied use case are discussed by 5G-RAN architecture point
of view. Various options for ML training and inference hosting are considered
and their trade-off in terms of complexity is presented. We outline our vision
for architectural level support in 5G (leading to 6G) networks for integrating
ML for the promising use cases where ML solutions can achieve significant
gains in future ML-based network architectures.

##  VIII Acknowledgements

The authors would like to thank Daejung Yoon and Afef Feki for having useful
discussions on UE positioning in 3GPP that helped to improve content of this
paper.

## References

  * [1] M. M. Butt, A. Rao, and D. Yoon, “RF fingerprinting and deep learning assisted UE positioning in 5G,” in _IEEE Vehicular Technology Conference (VTC2020-Spring)_ , 2020, pp. 1–7.
  * [2] K. B. Letaief, W. Chen, Y. Shi, J. Zhang, and Y. A. Zhang, “The roadmap to 6G: AI empowered wireless networks,” _IEEE Communications Magazine_ , vol. 57, no. 8, pp. 84–90, 2019.
  * [3] “3GPP, TR 38.855 study on NR positioning support,” March 2019, v.16.
  * [4] “3GPP, TR 36.855 feasibility of positioning enhancements for E-UTRA,” January 2015, v.15.3.0.
  * [5] “PS Docket No. 07-114 wireless E911 location accuracy requirements,” January 2015.
  * [6] O. Ennasr and X. Tan, “Time-difference-of-arrival (TDOA)-Based distributed target localization by a robotic network,” _IEEE Transactions on Control of Network Systems_ , vol. 7, no. 3, pp. 1416–1427, 2020\.
  * [7] J. Talvitie, T. Levanen, M. Koivisto, and M. Valkama, “Positioning and tracking of high-speed trains with non-linear state model for 5G and beyond systems,” in _International Symposium on Wireless Communication Systems (ISWCS)_ , 2019, pp. 309–314.
  * [8] Y. Liu, X. Shi, S. He, and Z. Shi, “Prospective positioning architecture and technologies in 5g networks,” _IEEE Network_ , vol. 31, no. 6, pp. 115–121, 2017.
  * [9] H. Wymeersch, G. Seco-Granados, G. Destino, D. Dardari, and F. Tufvesson, “5g mmwave positioning for vehicular networks,” _IEEE Wireless Communications_ , vol. 24, no. 6, pp. 80–86, 2017.
  * [10] O. Simeone, “A very brief introduction to machine learning with applications to communication systems,” _IEEE Transactions on Cognitive Communications and Networking_ , vol. 4, no. 4, pp. 648–664, Dec 2018.
  * [11] T. O’Shea and J. Hoydis, “An introduction to deep learning for the physical layer,” _IEEE Transactions on Cognitive Communications and Networking_ , vol. 3, no. 4, pp. 563–575, Dec 2017.
  * [12] C. Zhang, P. Patras, and H. Haddadi, “Deep learning in mobile and wireless networking: A survey,” _IEEE Communications Surveys Tutorials_ , pp. 1–1, 2019.
  * [13] C. Xiao, D. Yang, Z. Chen, and G. Tan, “3-D BLE indoor localization based on denoising autoencoder,” _IEEE Access_ , vol. 5, pp. 12 751–12 760, 2017.
  * [14] K. N. R. S. V. Prasad, E. Hossain, and V. K. Bhargava, “Machine learning methods for RSS-Based user positioning in distributed massive MIMO,” _IEEE Transactions on Wireless Communications_ , vol. 17, no. 12, pp. 8402–8417, Dec 2018.
  * [15] X. Ye, X. Yin, X. Cai, A. Pérez Yuste, and H. Xu, “Neural-network-assisted UE localization using radio-channel fingerprints in LTE networks,” _IEEE Access_ , vol. 5, pp. 12 071–12 087, 2017.
  * [16] L. Wu, C.-H. Chen, and Q. Zhang, “A mobile positioning method based on deep learning techniques,” _Electronics_ , vol. 8, no. 1, 2019.
  * [17] Q. Zhang and Y. Wang, “A 3D mobile positioning method based on deep learning for hospital applications,” _EURASIP Journal on Wireless Communications and Networking_ , vol. 2020, no. 170, 2020.
  * [18] J. Lee, C. Eom, Y. Kwak, H. Kang, and C. Lee, “DNN-Based wireless positioning in an outdoor environment,” in _IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)_ , April 2018\.
  * [19] M. Malmström, I. Skog, S. M. Razavi, Y. Zhao, and F. Gunnarsson, “5G positioning - a machine learning approach,” in _Workshop on Positioning, Navigation and Communications (WPNC)_ , 2019, pp. 1–6.
  * [20] J. Gante, G. Falcao, and L. Sousa, “Deep learning architectures for accurate millimeter wave positioning in 5G,” _Neural Processing Letters_ , no. 51, p. 487–514, 2020.
  * [21] A. Zappone, M. D. Renzo, and M. Debbah, “Wireless networks design in the era of deep learning: Model-based, ai-based, or both?” _IEEE Transactions on Communications_ , vol. 67, pp. 7331–7376, 2019.
  * [22] M. Koivisto, A. Hakkarainen, M. Costa, P. Kela, K. Leppanen, and M. Valkama, “High-efficiency device positioning and location-aware communications in dense 5g networks,” _IEEE Communications Magazine_ , vol. 55, no. 8, pp. 188–195, 2017.
  * [23] “Architectural framework for machine learning in future networks including IMT-2020,” recommendation ITU-T Y.3172. [Online]. Available: http://handle.itu.int/11.1002/1000/13894
  * [24] “3GPP, TS 36.211, E-UTRA physical channels and modulation,” September 2018, v.15.3.0.
  * [25] S. Fischer, “Observed time difference of arrival (OTDOA) positioning in 3GPP LTE,” White Paper, Qualcomm, June 2014.
  * [26] “3GPP TR 36.809, radio frequency (RF) pattern matching location method in LTE,” September 2013, v.12.0.0.
  * [27] “3GPP, TS 22.261, technical specification group services and system aspects; service requirements for the 5G system, stage 1,” Dec 2019, v17.1.0.
  * [28] “3GPP, TS 22.804, technical specification group services and system aspects; study on communication for automation in vertical domains,” Dec 2018, v16.2.0.
  * [29] “3GPP, TR 38.857 study on nr positioning enhancements,” March 2021, v.17.
  * [30] “3GPP, TS 22.071, group services and system aspect, location services (LCS); service description (release 15),” July 2018, v15.0.0.
  * [31] I. Goodfellow, Y. Bengio, and A. Courville, _Deep Learning_. MIT Press, 2016, http://www.deeplearningbook.org.
  * [32] “3GPP, TS38.401, group radio access network; ng-ran; architecture description (release 15),” Dec 2019, v16.0.0.
  * [33] “3GPP, TS37.320, universal terrestrial radio access (E-UTRA) and next generation radio access network; radio measurement collection for minimization of drive tests (MDT); overall description; stage 2,” July 2018, v15.0.0.