summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2020-02-02 14:30:27 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2020-02-02 14:30:27 +0100
commitc40280699582d85be898c6feba44e8d0674e3219 (patch)
tree92c56c0052f84eab0ab84c9ead511e3268598cd8
parentd33334b4914e8a75e822bf1919a61ca9f2d9cae3 (diff)
First version of algorithm section, except one TODO.
-rw-r--r--sampling_alg_lac2020/LAC-20.tex26
1 files changed, 20 insertions, 6 deletions
diff --git a/sampling_alg_lac2020/LAC-20.tex b/sampling_alg_lac2020/LAC-20.tex
index a16f82d..fc58394 100644
--- a/sampling_alg_lac2020/LAC-20.tex
+++ b/sampling_alg_lac2020/LAC-20.tex
@@ -154,6 +154,8 @@
%\usepackage{showframe}
\usepackage{algorithm}
\usepackage{algpseudocode}
+\renewcommand{\algorithmicrequire}{\textbf{Input:}}
+\renewcommand{\algorithmicensure}{\textbf{Output:}}
% nice theorem and proof environments. taken from Ema's template
\theoremstyle{plain}
@@ -343,12 +345,23 @@ The third therm, namely
\]
just adds some noise to the process to make it non-deterministic and thus avoid patterns in the selection as mentioned in Section \ref{sec:requirements}.
-\todoandre{Maybe add some pseudo-code to make things easier to understand?}
-Algorithm \ref{alg:sampling} shows the pseudo code for the sample selection algorithm.
-
+% \todoandre{Maybe add some pseudo-code to make things easier to understand?}
+We already explained the core part of the sample selection algorithm. The remainder is now straight-forward. We simply evaluate the objective function for each sample and then pick the one with the smallest value. For completeness, Algorithm \ref{alg:sampling} shows the pseudo code for the sample selection algorithm.
\begin{algorithm}
\begin{algorithmic}
- \State bla
+ \Require Requested power $p$, Instrument $I$, current time step $t$, parameters $\alpha, \beta, \gamma$, and array $\mathit{last}$ with the time points a sample has been played last
+ \Ensure Sample $s$
+ \State $s = \text{undefined}$
+ \State $f_{\min} = \infty$
+ \For{$s' \in \{ s'' \mid s'' \text{ is sample of instrument }I\}$}
+ \State $v \gets \alpha \cdot \left( \frac{p-p_{s'}}{p_{\max} - p_{\min}}\right)^2 + \beta \cdot \left( 1 + \frac{t - \mathit{last}[s']}{S}\right)^{-1} + \gamma \cdot r(s',t)$
+ \If{$v < f_{\min}$}
+ \State $f_{\min} \gets v$
+ \State $s \gets s'$
+ \EndIf
+ \EndFor
+ \State $\mathit{last}[s] = t$
+ \State \Return $s$
\end{algorithmic}
\caption{This is the high-level code of the sampling function.}
\label{alg:sampling}
@@ -374,8 +387,9 @@ Note that the worst-case complexity of evaluating the objective function is line
\todoandre{Recapitulate what was done in this paper. Highlight some of the difficulties and surprises.}
\todoandre{List future work: transforming the loudness space; refine the objective function; adapt algorithm to other instruments/settings; study to see what sounds good to people and do they actually hear the difference?}
-\section{Acknowledgements}
-\todo{Thank people for testing?}
+% \section{Acknowledgements}
+% \todo{Thank people for testing?}
+% \todo{Thank people for proof-reading?}
%\newpage
\nocite{*}