# Psychoacoustic Approaches for Harmonic Music Mixing +
## 2 Consonance Models
### Pitch Commonality Model
#### 2.2.1 Pitch Categorization  
[PERSON]'s algorithm detects the particular audibilities for each pure tone, considering the frequency-specific threshold of hearing, masking effects and the theory of virtual pitch. Following [PERSON] [20], the threshold in quiet \(L_{TH}\) is formulated as:  
\[L_{TH}=3.64f_{i}^{-0.8}-6.5\exp{(-0.6(f_{i}-3.3)^{2})}+10^{-3}f_{i}^{4}. \tag{6}\]  
Next, the auditory level Y_L_ of a pure tone with its specific frequency \(f_{i}\) is defined as its level in dB above its threshold in quiet,  
\[\text{Y}L(f_{i})=\text{max}(0,M_{i}-L_{TH}(f_{i})) \tag{7}\]  
Masking depends on the distance of pure tones in critical bandwidths. To simulate the effects of masking in the model, the pitch of the pure tone is examined on a scale that corresponds to critical bandwidths. To this end, the pure tone height, \(H_{p}(f_{i})\), for every pitch category, \(f_{i}\), in the spectrum is computed, using the analytic formula by [PERSON] and [PERSON] [17] that expresses the critical band rate in ERB (equivalent rectangular bandwidth):  
\[H_{p}(f_{i})=H_{1}\log_{c}(\frac{f_{i}+f_{1}}{f_{i}+f_{2}})+H_{0}. \tag{8}\]  
As parameters, [PERSON] and [PERSON] propose \(H_{1}\) = 11.17 ERB, \(H_{0}\) = 43.0 ERB, \(f_{1}\) = 312 Hz and \(f_{2}\) = 14,675 Hz. The partial masking level \(ml(f_{i},f_{j})\), which is the degree of how much every pure tone in the sonority with the frequency \(f_{i}\) is masked by an adjacent pure tone with its specific frequency \(f_{j}\) and auditory level Y_L_(\(f_{j}\)), is estimated as:  
\[ml(f_{i},f_{j})=\text{Y}L(f_{j})-k_{m}|H_{p}(f_{j})-H_{p}(f_{i})| \tag{9}\]  
where \(k_{m}\) can take values between 12 and 18 dB (chosen value: 12 dB). The partial masking level is specified in dB. The overall masking level, \(ML(f_{i})\), of every pure tone is obtained by summing its partial masking levels, which are converted first to amplitudes and, then, after the addition, back to dB levels:  
\[ML(f_{i})=\text{max}(0,(20\log_{10}\sum_{P\
eq P^{\prime}}10^{(ml(f_{i}f_{j})/ 20)})). \tag{10}\]In the case of a pure tone with frequency \(f_{i}\) that is not masked, \(ml(f_{i},f_{j})\) will take a large negative value. This negative value for \(ML(f_{i})\) is avoided by the use of the max operator when comparing the calculated value to zero. Following this procedure for each component, we can now obtain its audible level \(AL(f_{i})\) by subtracting its overall masking level from its auditory level \(YL(f_{i})\):  
\[AL(f_{i})=\max(0,(YL(f_{i})-ML(f_{i}))). \tag{11}\]  
To incorporate the saturation of each pure tone with increasing audible level, the audibility \(A_{p}(f_{i})\) is estimated for each pure tone component:  
\[A_{p}(f_{i})=1-\exp(\frac{-AL(f_{i})}{AL_{0}}). \tag{12}\]  
where, following Hesse [21], \(AL_{0}\) is set to 15 dB. Due to the need to extract harmonic patterns and to consider virtual pitches, the still audible partials are now assigned discrete semitone values. To this end, frequency values that fall into a certain interval are assigned to so-called pitch categories, \(P\), which are defined by their center frequencies in Hz:  
\[P(f_{i})=12\log_{2}(\frac{f_{i}}{440})+57 \tag{13}\]  
where the standard pitch of 440 Hz (musical note \(A_{4}\)) is represented by Pitch Category 57. For the detection of harmonic patterns in the sonority, a template is used to detect partials of harmonic complex tones shifted over the spectrum in a step size of one pitch category. One pattern's element is given by the formula:  
\[P_{n}=P_{1}+\lfloor 12\log_{2}(n)+0.5\rfloor \tag{14}\]  
where \(P_{1}\) represents the pitch category of the lowest element (corresponding to the fundamental) and \(P_{n}\) the pitch category of the \(n\)-th harmonic. Wherever there is a match between the template and the spectrum for each semitone-shift, a complex-tone audibility \(A_{c}(P_{1})\) is assigned to the template's fundamental.