{'fraction_non_alphanumeric': 0.03847894975101856, 'fraction_numerical': 0.011367637442784568, 'mean_word_length': 4.986750978620897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Phase-aware Harmonic/Percussive Source Separation via Convex Optimization

Decomposition of an audio mixture into harmonic and percussive components, namely harmonic/percussive source separation (HPSS), is a useful pre-processing tool for many audio applications. Popular approaches to HPSS exploit the distinctive source-specific structures of power spectrograms. However, such approaches consider only power spectrograms, and the phase remains intact for resynthesizing the separated signals. In this paper, we propose a phase-aware HPSS method based on the structure of the phase of harmonic components. It is formulated as a convex optimization problem in the time domain, which enables the simultaneous treatment of both amplitude and phase. The numerical experiment validates the effectiveness of the proposed method.


INTRODUCTION
Audio source separation, decomposing an audio mixture into each source, is one of the fundamental tools for audio signal processing. In particular, harmonic/percussive source separation (HPSS), which decomposes an audio mixture into harmonic components (e.g., guitar and piano) and percussive components (e.g., drums), has gained much attention as a pre-processing tool for many music-information retrieval (MIR) tasks including chord estimation [1] and tempo estimation [2]. For instance, extracted percussive components are useful cues for tempo estimation while the harmonic components are crucial for chord estimation. HPSS is also helpful for audio remixing [3] and time-scale modification [4].
One of the main approaches to HPSS is to take advantage of the anisotropic smoothness of power spectrograms (i.e., power spectrograms of harmonic components are continuous in the time direction, and those of percussive components are continuous in the frequency direction as shown in Fig. 1) [5][6][7]. Based on the anisotropic smoothness, HPSS was formulated as an optimization problem of minimizing the 2 norm of the gradient of power spectrograms in [5]. Considering the same assumption, the method presented in [8] applies the time-/frequency-directional median filtering (MF) to the power spectrogram of the audio mixture, which was further developed into the kernel additive model (KAM) [9][10][11]. Although these methods have been successfully applied to HPSS, they have a limitation because the degraded phase from the audio mixture is still utilized for resynthesizing the separated time domain signals.
Recent literature has shown the importance of phase in audio source separation [12,13] and audio denoising [14][15][16][17]. These studies utilize a model of phase for harmonic components, called sinusoidal model. This model claims that the phase evolution of harmonic components can be predicted from their instantaneous frequencies. More recently, this model was also applied to HPSS [18,19]. In [18], the real-valued time-frequency mask for extracting harmonic components was constructed based on the sinusoidal model. However, the phase is not modified through time-frequency masking, and thus the degraded phase from the audio mixture is utilized for resynthesizing back to the time-domain. On the other hand, [19] utilizes the sinusoidal model for recovering the phase after applying a time-frequency mask obtained by a deep neural network. However, simultaneous modification of both amplitude and phase has not been presented for HPSS.
In this paper, we propose a phase-aware HPSS method, which treats both amplitude and phase simultaneously, through convex optimization in the time domain. For harmonic components, the proposed method assumes the time-directional smoothness of the complex-valued spectrogram with the recently proposed phase modification [15]. This assumption can be interpreted as the unification of the two conventional HPSS methodologies: the anisotropic smoothness and sinusoidal model. For the percussive components, the time-frame-wise sparsity is assumed on their complex-valued spectrograms, which does not require any assumptions for its phase structure. The effectiveness of the proposed method was confirmed by the signal-to-distortion ratio (SDR).

PREVIOUS WORKS
In this section, we briefly revisit two approaches to HPSS, the anisotropic smoothness and sinusoidal model, since the proposed method combines these two approaches as described in Section 3.

HPSS based on anisotropic smoothness
One main approach to HPSS is the anisotropic smoothness of power spectrograms. It assumes that a power spectrogram of harmonic components H ∈ R K×T + and that of percussive components P ∈ R K×T + have the following relations: where ω = 1, . . . , K and τ = 1, . . . , T are frequency and time indices, respectively. Eq. (1) indicates that the power spectrogram of the harmonic components varies slowly, while Eq. (2) claims that of the percussive components is smooth in the frequency direction. Based on these assumptions, the following optimization-based HPSS method was proposed in [5]: where Dτ and Dω are the time and frequency-directional differences (i.e., discrete approximation of directional derivatives), σ h and σp are parameters to adjust smoothness of harmonic and percussive spectrograms, and X ∈ C K×T is the complex-valued spectrogram of the audio mixture to be separated. γ is a hyperparameter for range compression (0 < γ ≤ 1), and it will be set to 1 in the rest of this paper for simplicity. By minimizing the energy of directional derivatives of the spectrograms, this model attempts to find spectrograms which are smooth in each direction. In the experimental section, this optimization-based method will be referred to as Ono's. While this optimization-based method is simple and effective, the assumption of additivity of power spectrograms holds only approximately (it can be justified only by some statistical sense [20]). Furthermore, it considers only power spectrograms, and thus the phase information is ignored. Although some extensions based on the anisotropic smoothness of power spectrograms have been proposed [8][9][10][11], the degraded phase of the audio mixture is utilized for resynthesizing the separated time domain signals, which often causes audible artifacts as mentioned in [12].

HPSS based on sinusoidal model
Another recent approach to HPSS is based on the sinusoidal model. Let the short-time Fourier transform (STFT) of a signal x ∈ R L be where g ∈ R L is a window, j = √ −1, a and b are the time and frequency shifting steps, and index overflow is treated by zero-padding. Considering a sinusoid given by where A ∈ R+, f ∈ [0, L/2), and φ ∈ [0, 2π) are the amplitude, frequency, and initial phase, respectively. Its phase spectrogram φ (with appropriate unwrapping) has the following relation: where vω,τ is the instantaneous frequency at each time-frequency bin. This sinusoidal model has been studied in phase vocoders [21], and applied to audio signal processing tasks recently [13,16,17,22]. More recently, the sinusoidal model was also applied to HPSS [18,19]. The phase-based masking (PM), which constructs the timefrequency mask based on the relation among phases in successive time frames, was presented in [18]. Although this method considers phase information, the phase of the audio mixture is still utilized for resynthesizing the separated time domain signals. In contrast, the method presented in [19] utilizes the sinusoidal model for modifying phase. Specifically, the time-frequency mask is estimated by a deep neural network, and phases of separated signals are estimated by the specific algorithm based on the sinusoidal model [13]. It significantly depends on the time-frequency mask estimation, and phase information is utilized just in the post-processing.

PROPOSED HPSS METHOD
In this section, we propose a phase-aware HPSS method through convex optimization where the phase-aware smoothness in the time direction is assumed for harmonic components as a unification of the aforementioned approaches: anisotropic smoothness and sinusoidal model. On the other hand, the time-frame-wise sparsity is considered for the complex-valued spectrograms of percussive components as a phase insensitive prior. The proposed method directly separates the time-domain signal, which enables the simultaneous modification of amplitude and phase.
At first, we review the phase-aware smoothness of harmonic signals introduced in the previous study [15]. Then, based upon that, we formulate the proposed method and discuss the relation to the conventional HPSS approaches reviewed in the previous section.

Time-directional smoothness of instantaneous phase corrected complex-valued spectrogram
As shown in Eq. (6), the phase of a sinusoid has the relation among successive time frames. It indicates the phase in the next frame is predictable from the phase and instantaneous frequency in the current frame. Based on the relation of phase, a model of a complexvalued spectrogram of harmonic components was recently studied for audio signal processing [14,15]. Since the amplitude of the sinusoid is constant, its complex-valued spectrogram satisfies the following relationship: Therefore, the complex-valued spectrogram of a sinusoid takes the same value in each sub-band if its phase evolution is eliminated. In order to eliminate such a phase evolution, instantaneous phase corrected STFT (iPC-STFT) was proposed in [15]: where E is the instantaneous phase correction matrix defined by with Eω,0 = 1 for all ω, and is the Hadamard product. This matrix eliminates the phase evolution of a sinusoid as in Eq. (6). While real and imaginary parts of the complex-valued spectrogram calculated by the usual STFT vary owing to the phase evolution, those of iPC-STFT are constant in each sub-band thanks to the instantaneous phase correction as illustrated in Fig. 2. Namely, the complex-valued spectrogram of the sinusoid is smooth in each sub-band as FiPC(s)ω,τ = FiPC(s)ω,τ−1.
Although this equation considers a single sinusoid, the timedirectional smoothness of the complex-valued spectrogram calculated by iPC-STFT is also reasonable for harmonic signals consisting of a sum of sinusoids. In [15], based on this characteristic of iPC-STFT, a simple prior for harmonic signals was proposed, which penalizes the time-derivative of the complex-valued spectrogram calculated by iPC-STFT for enhancing harmonic components. For more details about iPC-STFT, we refer readers to [15]. Note that the instantaneous frequency vω,τ is not known and must be estimated in advance. It can be estimated by the direct timedifferential of phase as whereF is the usual STFT whose window is the time-derivative of the original window g, and Im[z] is the imaginary part of z [23].

Proposed optimization-based HPSS method
As described in the previous subsection, complex-valued spectrograms of harmonic components calculated by iPC-STFT have the distinctive structure. Utilizing iPC-STFT, we propose a phase-aware HPSS method through the following convex optimization: where x h , xp, and x are the time-domain signals of harmonic components, percussive components, and the audio mixture, respectively, λ > 0 is the hyperparameter which adjusts the amount of harmonic and percussive components, and W ∈ R K×T + is a weight constructed in advance. Note that the the instantaneous phase correction matrix E in iPC-STFT is calculated from the the audio mixture, and thus iPC-STFT is treated as the fixed linear operator in the proposed formulation.
The first term induces the time-directional smoothness of harmonic components as an extension of Eq. (10). Since power spectrogram of harmonic components is smooth in the time-direction as in Eq. (1), the time-directional smoothness of iPC-STFT spectrogram of general harmonic components is also reasonable. The weight W, which adjusts the time-directional smoothness around each time-frequency bin, is given by where κ > 0 is a small number for adjusting the weight, and |X h | is the normalized amplitude of pre-estimated harmonic components which can be obtained by any existing method as [5,8,10]. This weight takes a small value when the amplitude of harmonic components are large, and thus harmonic components with large amplitude are not penalized so much. Note that this additional weight was not introduced in the previous study [15], and thus it is one of the contributions of this paper. The second term is the 2,1-norm which induces group sparsity. Here, the time-frame-wise sparsity is promoted by defining it as This penalty function concentrates the energy into a few time frames and enhances impulsive components. Such time-frame-wise sparsity of percussive components can be seen in Fig. 1.

Relation to the conventional methods
The proposed method is related to the method based on anisotropic smoothness [5] described in Section 2.1. While the first term in Eq. (3) only considers the power spectrogram of harmonic components, that of Eq. (12) treats both amplitude and phase through the operation in the complex domain (note that the squared amplitude of X h corresponds to H). Thus, the proposed method given by Eq. (12) can be interpreted as a phase-aware extension of Eq. (3). For the percussive components, the proposed method assumes the time-framewise sparsity, while Eq. (3) considered smoothness in the frequency direction. Considering the frequency-directional smoothness for the complex-valued spectrogram of percussive components may not be easy. Thus, the proposed method utilizes 2,1-norm, which is insensitive to phase, instead of penalizing the frequency-derivative of the complex-valued spectrogram. As in Eq. (12), the proposed method directly treats the timedomain signals, and its constraint claims that the separated components satisfy the perfect reconstruction property in the time-domain as in a recent audio source separation method [24]. Some of the conventional HPSS methods (e.g., anisotropic smoothness based methods [5,7] and non-negative matrix factorization based methods [25,26]) assume additivity of power spectrograms, but it requires some statistical assumptions as discussed in [20]. In contrast, the constraint in the proposed method (additivity in the time-domain) is always justified. To the best of our knowledge, this is the first study applying the perfect reconstruction constraint to the separated time domain signals in HPSS.

Primal-dual splitting algorithm for proposed HPSS method
In order to solve the convex optimization problem given by Eq. (12), in this paper, a primal-dual splitting algorithm [27] is adopted because it can handle some priors tied with linear operators with a constraint. A primal-dual splitting (PDS) method [27] is one of the convex optimization algorithms for solving the following problem: 1 where Θ and Υm are proper lower-semicontinuous convex functions, and Lm is a linear operator (m ∈ {1, 2}). A PDS algorithm solves this problem by iterating the following procedure: where L * m is the adjoint operator of Lm, n is the iteration index, µ1 > 0, µ2 > 0, and 0 < α < 2. The important feature of this procedure is that the minimization of each function is handled separately through the proximity operator [28]: To apply this PDS algorithm to the proposed method in Eq. (12), it should be reformulated to the following equivalent problem:

Algorithm 1 Proposed HPSS algorithm solving Eq. (21)
Input: x, x where L h (·) = W Dτ FiPC(·) , and ιx(·, ·) is the indicator function of the perfect reconstruction constraint given by Applying the PDS algorithm to the reformulated problem in Eq. (21) yields Algorithm 1, where the choice of µ1 and µ2 can be automated as in [27], and the proximity operators involved in the algorithm can be analytically calculated as follows [28,29]: where Xτ is the K-dimensional vector at the τ th time frame. We stress that this algorithm does not require the inverse of linear operators, L h and F , but only require applying them and their adjoint, and thus we can avoid the huge computation for calculating their inverse.

NUMERICAL EXPERIMENT
The proposed method was applied to separations of 10 audio tracks 2 which was presented in the previous study [18]. The sampling rate was 44100 Hz, and STFT was calculated by the canonical tight window of the Hann window of 4096 samples with 1024 sample shifting. The proposed method was compared with four conventional methods: Ono's [5], MF [8], KAM [10], and PM [18]. In each method, the hyperparameters were set to suggested values in each original paper. Separation performance was evaluated by the average of BSS Eval measures: SDR, signal-to-interference ratio (SIR), signal-to-artifacts ratio (SAR) [30]. For the proposed method, the amplitude spectrogram of harmonic components should be estimated in advance for calculating the weight W. Here we utilized MF as a simple and fast HPSS method for prior estimation of the harmonic components. Although MF does not treat phase, it is modified through the proposed method. For calculating iPC-STFT, the instantaneous frequency of the harmonic components is also required. Since its oracle information is not available, we calculated it from the audio mixture (Prop-mix). In order to evaluate the potential of the proposed method, iPC-STFT with the instantaneous frequency calculated from the oracle harmonic components was also compared (Prop-ora). In both cases, the instantaneous frequency was calculated by Eq. (11). The hyperparameters, λ and κ, were experimentally determined to be 0.5 and 0.001. Algorithm 1 was iterated 100 times with µ1 = 1, µ2 = 0.25, and α = 0.5. While an arbitrary choice is allowable, MF was utilized for estimating the initial value.

Results
The experimental results are summarized in Table 1. MF outperformed other conventional methods in terms of SDR, which served as the initial value of the proposed method. Since the time-frequency mask was estimated solely from the phase information, PM resulted in the lowest performance. In contrast, the proposed method, which simultaneously treats both amplitude and phase, outperformed conventional methods in terms of SDR. We observed that KAM reduced much components, which significantly improved SIR of harmonic components but induced low SDR and SAR. As a result of taking phase into account, the proposed method achieved higher scores than Ono's which is the non phase-aware version of the proposed method as discussed in Section 3.3.
Comparing Prop-ora with Prop-mix, we confirmed that the accurate estimation of the instantaneous frequency of harmonic components can improve the performance of the proposed method. This is because the first term in Eq. (12) takes a smaller value for harmonic components and penalizes percussive components more by utilizing the appropriate instantaneous frequency. The instantaneous frequency estimation given by Eq. (11) is one of the simplest methods. More specific methods for the accurate estimation of the instantaneous frequency of harmonic components should be considered, which is a future work.

CONCLUSION
In this paper, a phase-aware HPSS method through convex optimization was proposed. Based on two HPSS approaches (anisotropic smoothness and sinusoidal model), the proposed method assumes the smoothness of the complex-valued spectrogram of harmonic components calculated by iPC-STFT in the time direction. On the other hand, the time-frame-wise sparsity of percussive spectrograms was considered as a phase insensitive prior. Furthermore, the proposed method considers the perfect reconstruction constraint in the time domain instead of power spectrograms. Through the experiment, the effectiveness of the proposed method was validated in terms of SDR. The experimental results indicated the accurate estimation of the instantaneous frequency of harmonic components can improve the performance of the proposed method, which is included in our future works.