# Computation of Psycho-Acoustic Annoyance Using Deep Neural Networks
## 2 Psycho-Acoustic Annoyance Model
### Signal Processing and Computing Time  
To calculate the nuisance model we designed four different scripts aimed at computing each of the psycho-acoustic parameters (\(L\), \(S\), \(R\), and \(F\)) from an input audio signal and one to calculate the total annoyance PA from the rest of parameters. As we need to simplify the computation, the study is oriented towards an acoustic sensor network framework in which we use a single-channel audio input per node. A sampling frequency of 16 kHz is used to reduce the number of samples to be processed. Then, annoyance is analyzed over frequencies up to 8 kHz. As performed in many other studies [8; 17; 18] and as suggested in [PERSON]'s book [9], the input signal is enframed with typical window sizes of 80 to 200 ms with 50% overlap. This applies to \(L\), \(S\), and \(R\), but \(F\) needs longer windows, as it takes into account modulation frequencies of about 4 Hz and performs better with window sizes in the range going from 500 ms to 1 s. In this work, we considered windows with a length of 1 s.  
To perform a descriptive measurement of the required computing time of psycho-acoustic parameters and the general annoyance parameter PA, we have used three different platforms: two personal computers and a RaspberryPi-3B. The times of the personal computers were used to obtain an average of the processing time in common desktop equipment. To get an idea of the average calculation time on a normal desktop PC, we have evaluated 1000 audios on each of the 2 computers, obtaining an average of 1000 times on each. In Table 2 you can see an average of these 2 average times, in order to have a baseline of a generic PC performance calculating the general psycho-acoustic annoyance indicator, PA, and compare it with an IoT device, such as the Raspberry Pi. The Raspberry Pi platform was used to estimate the average computing time in a real node, as it is a device widely used in WASN applications [8; 13; 19]. The specifications are:  
* PC-1: Intel(R) Core i7-7700 CPU 3.6 Ghz x64; 16 GB RAM; NVIDIA GTX 1060 6 GB. \begin{table}
\begin{tabular}{l} \hline \hline \(PA=L\left(1+\sqrt{\left(\frac{(S-1.75)log(L+10)}{4}\right)^{2}+\left(\frac{2. 18(0.4F+0.6R)}{L^{4}}\right)^{2}}\right)\) \\ \hline \(L=\sum_{z=0}^{28 Rark}L^{\prime}(z)\cdot\Delta z\) \\ \hline \(S=C_{S}\cdot\frac{\sum_{i=0}^{3888}L^{\prime}(z)\cdot\Delta^{i71+z}+\Delta z}{L}\) \\ \hline \(R=C_{R}\cdot\sum_{i=0}^{3333}B(g(z_{i})\cdot m_{i}\cdot k_{i-2}\cdot k_{i})^{2}\) \\ \hline \(F=C_{F}\cdot\sum_{i=0}^{3333}B(g(z_{i})\cdot m_{i}\cdot k_{i-2}\cdot k_{i})^{2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Numerical expressions for \(PA\), \(L\), \(S\), \(R\), and \(F\). * PC-2: 2 \(\times\) Intel(R) Xenon(R)Silver 2.2 Ghz x64; 96 GB RAM; NVIDIA GTX 1080 8 GB. * Raspberry Pi 3B: CPU + GPU: Broadcom BCM2837 Cortex-A53 (ARMv8) x64 1.2 GHz; 1 GB RAM. We used 1000 audio clips of one second duration to carry out the computing tests. These were taken randomly from our database (discussed later), measuring the computation time of each parameter in all platforms. Table 2 shows the results of the computing times. In general, \(S\) is the fastest as it is taken directly from \(L\) as described in Table 1. The calculation of \(R\) and \(F\) are the slowest ones. Looking at the results of a Raspberry Pi 3B, it can be observed that times are well above 1 s, which does not allow real-time processing. Note also that the resulting times would considerably increase for higher sampling rates. Although the use of two desktop PCs with dedicated GPUs can be confusing, in no case has the GPU been used to perform direct calculations or CNN predictions. Especially so that the conditions of the test were the same regarding the Raspberry Pi. Therefore, both the direct calculations and the predictions have been made in the CPU and only affect the characteristics of the CPU. A more extensive study on the calculation of psycho-acoustic parameters in a WASN using Raspberry Pi is provided in [19].