# Musical Mix Clarity Prediction Using Decomposition and Perceptual Masking Thresholds
## 2 Proposed Model
### Component Energy and Masking Calculation Stage  
The MPEG Psychoacoustic Model's output, the signal-to-mask ratio (SMR), is employed in the cross-adaptive automatic mixing system [10]. It is also utilised in the proposed model where it is used to represent masking occurring across sub-bands of the frequency spectrum, called'scale-factor bands' (\(sb\)) [23]. SMR indicates the ratio of the energy (\(E\)) of the input signal to a masking threshold (\(MT\)), which is calculated as a function of frequency and time [23; 24]. Thus, the SMR is defined as:  
\[SMR(sb)=\frac{E(sb)}{MT(sb)} \tag{4}\]  
where \(MT\) is calculated by grouping spectral bins into threshold calculation partitions, which represent approximately a third of a critical bandwidth. Energy in these partitions is spread and then weighted based on a tonality measure. The tonality measure is a sliding scale indicating how noise-like or tone-like the input is. More noise-like partitions result in an increased masking threshold as they are more effective maskers. This weighted masking threshold is then compared with the threshold in quiet and the largest of the two is taken as the final masking threshold in each partition. By calculating the masking threshold of an external signal, the SMR reflects the level at which the external signal will be perceived to mask the input signal. Three implementations of the MPEG Psychoacoustic Model were explored in the objective testing of the clarity model, these were the layer 2 (L2 PM), layer 3 (L3 PM) and modified L3 PM. This allowed for the performance of the implementations to be compared, with a view to establishing which would perform optimally in the proposed mix clarity model. There are three key differences between SMR calculation in the L2 PM and L3 PM. Firstly, the L3 PM employs two window lengths, a long window, and a short window. This improves the temporal resolution of the tonality measure at high frequencies using the short windows, while retaining spectral resolution at low frequencies using the long windows. The L3 PM can also employ a window switching technique, such that SMR calculation for particularly transient information is performed solely using the short window length, to reduce pre-ringing. When using only short windows the number of scale-factor bands output is reduced as the masking calculation has lower frequency resolution. Secondly, the L2 PM masking thresholds are calculated in approximately one third of critical bands which are then spread back over the spectral bins of the Fourier transform. The spread masking threshold is then grouped into linearly spaced scale-factor bands, from which the SMR calculation is performed. In the L3 PM, the masking thresholds are also calculated in approximately one third of critical bands. These are converted directly into scale-factor bands spaced to approximate the critical bands of human hearing. As such, while masking threshold calculations in both are perceptually derived, the L3 PM scale-factor band spacing is more closely related to human perception than the L2 PM scale-factor band spacing. Finally, due to the more complex nature of the L3 PM, it requires more computational overhead than the L2 PM. The modified L3 PM is a combined approach devised for the present work. It performs the masking threshold calculation from the L3 PM, which is then spread back over the spectral bins of the Fourier transform and used to calculate the SMR in linearly grouped scale-factor bands employed in the L2 PM. This allowed for assessment of the impact of the scale-factor band spacing on the model performance presented in Section 4. In the case of the cross-adaptive masking metric [10], the energy and threshold calculation for the scale-factor bands is kept the same, though they define a masker-to-signal ratio (MSR) given in decibels as:  
\[MSR(sb)=10\log_{10}\left(\frac{MT^{\prime}(sb)}{E(sb)}\right) \tag{5}\]  
where \(MT^{\prime}\) is the threshold calculated for the sum of accompanying signals, and \(E\) is the energy of the signal of interest.