# Automated Personalized Loudness Control for Multi-Track Recordings
## 2 Materials and Methods
### Data Preparation
One very important step in automatic learning using any type of data is to ensure that all the examples are in the same distribution and within a similar range of values. Because the loudness control is a problem of human perception, we needed to make sure that each song has the same loudness volume. This operation was carried out in order to ensure that the mix created by each engineer is always at the same loudness level, and only the coefficients between tracks are different. Additionally, each original song has its own multi-tracks at different loudness levels, therefore, it is important to normalize all the initial tracks to a fixed loudness. To ensure consistency and optimal listening conditions, we normalized each input track to \(-45\) LUFS and set the loudness of every original mix to \(-23\) LUFS. The decision to use \(-45\) LUFS for individual tracks stems from a widely adopted practice among sound engineers, who prefer to start with lower volumes to have greater control during the mixing process. This initial low volume also surpasses the loudness threshold gate, below which measurements by loudness meters may not be reliable, ensuring accuracy in our loudness assessments. The selection of \(-23\) LUFS for the mixed audio volume is rooted in its recognition as a level that aligns closely with human auditory perception, offering a balance that preserves both clarity and dynamic range, without inducing listener fatigue over extended periods. This choice mirrors the standards set forth by international broadcasting guidelines, such as the EBU R128 standard [18], which recommends a target loudness of \(-23(\pm 2)\) LUFS to ensure a consistent and comfortable listening experience across various platforms and media types. However, obtaining an accurate loudness reading for audio tracks with only small brief moments of useful signal, such as a single clap or a snare strike, can be quite difficult. It is well known that the length of the useful signal should be at least 3 s for a proper loudness measurement. In the case of such exceptional cases with very brief useful signal and small amplitude levels, the Root Mean Square (RMS) value was used instead of LUFS implementation in order to scale the track. For this paper, we consider the reference mix level at \(-23\) LUFS, and the input track level at \(-45\) LUFS. For audio processing, it is usually quite challenging to work with the entire signal, therefore, splitting the audio into multiple overlapped windows is commonly practiced. However, for the problem of a fixed loudness level for the entire track, we discovered that there is no need to look at all the signal windows, but instead, use only one of them, because the scale factor will be the same over the entire track. In other words, instead of processing entire tracks, we focus on key segments, thereby reducing processing time without compromising on the accuracy of loudness estimation. Additionally, based on the human auditory sensitivity differences across frequencies, we also recognized that the maximum loudness perception is between 250 Hz and 4000 Hz [23]. For this reason, as an optimization step, we realized that we could downsample the audio at a lower frequency rate, maintaining quality while reducing computational load. The following multi-step procedure was applied for each track in every song:  
1. Downsample the entire track to 16 kHz, in alignment with human auditory sensitivity and the equal-loudness contours, which emphasize the 2-5 kHz range where clarity and loudness perception are most significant [3];
2. Divide the audio signal into windows of 3 s, with a hop size of 1 s (66% overlap);
3. Find the best window within the audio. We consider the best window the one with the highest RMS value, which can approximate the loudness level with some degree (it is a representation of the power of the signal, without the human perception factor), but is much faster to compute;
4.