# Adaptive Filtering for Multi-Track Audio Based on Time-Frequency Masking Detection
## 3 Results  
To demonstrate our methodology, we employ a multitrack from the Mixing Secrets library [13]. The song is Flesh and Bone by [PERSON]. The song contains four tracks in the mix (bass, accordion, vocals, and guitar). Tracks with multiple microphone sources were premixed to ensure one track per instrument. The masking matrices for Flesh and Bone obtained using Equation (2) are shown in Figure 4. The most prominent masking comes from the bass to all other tracks (a-c, red); nevertheless, there is masking across all tracks at different extents. Based on these, and using Equations (3)-(6), an attenuating filter was generated for each track (see Figure 5). The filters have multiple peaks attenuating at different bands, except for guitar and vocals at approximately 165 Hz (E4, yellow and dashed purple). Each filter was applied to its correspondent track and then the tracks were averaged with their original levels (rough mix) and normalised to unity (rough master). The gain of each filter is user-defined and set as \(-8\), \(-6\), \(-3\), and \(-3\) dB for bass, accordion, vocals, and guitar, respectively.  
For clarity, Figure 6 shows a schematic of how the four tracks were combined, separated, and recombined to achieve the masking vectors required for filter design. In essence, all possible combinations of tracks are used to generate the initial masking vectors using Equations (2) and (3) (\(M^{\prime}(f)\)), then masker and maskee are separated (Equations (4)-(5)), averaged, and normalised (Equation (6)), resulting in (\(M(f)_{T}\)) as the basis for designing a filter. The number of tracks in this example is four and can be easily expanded to any number.  
Figure 7 shows the individual tracks before and after filtering. The changes in the spectrum match the response of the filter presented in Figure 5. Tracks 1 and 2, (bass and accordion, see Figure 7a-d) are modified significantly as the selected gain was aggressive (\(-8\) and \(-6\) dB, respectively). Tracks 3 and 4 (vocals and guitar, see Figure 7e-h) are modified subtly, yet changes in the frequency and time domains are also visible.  
Figure 3: Filter design. (**a**) Masking matrix (orange) with peaks identified (blue stars). (**b**) \(M_{T1}(f)\) with adaptive threshold (blue) and noise floor (dashed green). (**c**) Only the peaks above the adaptive threshold remain and are used for filter design. (**d**) Frequency response of the final filter for track 1 with a user-defined gain of 3 dB (yellow) and showing the peaks (orange stars) used for the design.  
Figure 4: Masking detected for S\({}_{1}\). The positive masking (red) represents a track 1 masking track 2 while negative masking (yellow) represents track2 masking track1. (**a**) Bass (1) over accordion (2). (**b**) Bass (1) over vocals (2). (**c**) Bass (1) over guitar (2). (**d**) Accordion (1) over guitar (t2). (**e**) Accordion (1) over vocals (2). (**f**) Vocals (1) over guitar (2).  
Figure 5: Filters generated and applied to each track. Each track had its own filter applied, which was generated through the analysis of the relationships between the tracks. The filters attenuate each track at different bands, except for guitar and vocals which share an attenuation peak at 165 Hz.