S-SPADE Done Right: Detailed Study of the Sparse Audio Declipper Algorithms
Abstract
This technical report shows and discusses in detail how Sparse Audio Declipper (SPADE) algorithms are (and should be) derived from the signal model using the ADMM approach. The analysis version (A-SPADE) of Kitic et. al. (LVA/ICA 2015) is derived and justified. The derivation of the synthesis version (S-SPADE) of the same research team is done right, leading to an algorithm comparable to A-SPADE. The document also discusses the issue of complex variables.
Full text
S-SPADE Done Right: Detailed Study of the Sparse Audio Declipper Algorithms Pavel Záviška, Ondřej Mokrý, Pavel Rajmic∗ October 30, 2018 Abstract: This technical report shows and discusses in detail how Sparse Audio Declipper (SPADE) algorithms are derived from the signal model using the ADMM approach. The analysis version (A-SPADE) of Kitić et. al. (LVA/ICA 2015) is derived and justified. The synthesis version (S-SPADE) of the same research team is shown to solve a different optimization task than intended. This issue is corrected in this report, leading to the new S-SPADE algorithm which is in line to A-SPADE. 1 Alternating Direction Method of Multipliers (ADMM) We start with the brief review of ADMM [1]. ADMM is able to solve problems of the form min xf(x) + g(Ax),(1) where x∈CNand A:CN→CPis a linear operator. We assume f, g real convex functions of (possibly complex) variables. Problem (1) can be reformulated as follows: min x,zf(x) + g(z)s.t. Ax−z= 0.(2) To solve optimization task (2) we form the Augmented Lagrangian as Lρ(x,y,z) = f(x) + g(z) + y>(Ax−z) + ρ 2kAx−zk2 2,(3) where ρ > 0is called the penalty parameter. ADMM consists of three steps: x(i+1) = argmin x Lρx,z(i),y(i)(4a) z(i+1) = argmin z Lρx(i+1),z,y(i)(4b) y(i+1) =y(i)+ρAx(i+1) +z(i+1).(4c) It is possible to convert ADMM to the so-called scaled form, which is often more convenient; this is done by defining the residual r=Ax−z. In such a case, the last two terms of the Augmented Lagrangian in (3) can be rewritten as y>r+ρ 2krk2 2=ρ 2kr+1 ρyk2 2−1 2ρkyk2 2=ρ 2kr+uk2 2−ρ 2kuk2 2,(5) where uis a scaled dual variable such that u=y/ρ (see Remark 1 for the proof of Eq. (5)). ∗All the authors are with Brno University of Technology, Czech Republic. Contact: [email protected]. Authors are thankful to Jakub Kůdela for discussing the Augmented Lagrangian for complex variables. 1
After the above manipulation, the Augmented Lagrangian in the scaled form is Lρ(x,u,z) = f(x) + g(z) + ρ 2kr+uk2 2−ρ 2kuk2 2.(6) The scaled version of the ADMM is expressed as x(i+1) = argmin xf(x) + ρ 2kAx−z(i)+u(i)k2 2(7a) z(i+1) = argmin zg(z) + ρ 2kAx(i+1) −z+u(i)k2 2(7b) u(i+1) =u(i)+Ax(i+1) −z(i+1).(7c) Note that in minimizing Lρ(x,y,z)over xin the first step (7a), it was possible to omit g(z). This term is not dependent on x, thus it does not play any role in finding the argument of the minima of Lρ(x,y,z). The same argumentation applies to ρ 2kuk2 2. Eq. (7b) is obtained the same way. Remark 1. The second equality in Eq. (5) is just a substitution. The first one can be proven (right to left) using the following, assuming rand yare real for the moment: ρ 2kr+1 ρyk2 2−1 2ρkyk2 2=ρ 2hr+1 ρy,r+1 ρyi − 1 2ρhy,yi =ρ 2hr,ri+hr,1 ρyi+h1 ρy,ri+h1 ρy,1 ρyi−1 2ρhy,yi =ρ 2krk2 2+1 2r>y+1 2y>r =ρ 2krk2 2+y>r. (8) In the case of complex variables, we need to guarantee the Augmented Lagrangian to be real (and therefore the minimization is legitimate). For this reason, the Augmented Lagrangian in Eq. (3) would need to be alternatively defined as Lρ(x,y,z) = f(x) + g(z) + y>"<(Ax−z) =(Ax−z)#+ρ 2 "<(Ax−z) =(Ax−z)# 2 2 ,(9) now with y∈R2P. Then, (8) can be used again to prove Eq. (5), leading to Augmented Lagrangian in the form (6)—the only difference is that r,u∈R2Pinstead of CP. In the implementation, this difference can be ignored and complex variables rand ucan be directly used since it holds kck2 2= "<(c) =(c)# 2 2 (10) for any complex vector c; therefore Equations (7a) and (7b) can be used as they are, and Eq. (7c) corresponds only to addition of uand r, which can be equivalently performed either in CPor separately with the real and imaginary parts. 2 Sparse Audio Declipper (SPADE) – Derivation using ADMM SPADE algorithm(s) approximate the solution of the following non-convex, NP-hard synthesis- or analysis-regularized inverse problems [2]: min x,zkzk0s. t. x∈Γ(y)and kAx−zk2≤ . . . A-SPADE,(11) 2
min x,zkzk0s. t. x∈Γ(y)and kx−Dzk2≤ . . . S-SPADE,(12) where Γ = Γ(y)is the set of feasible solutions, x∈RNis signal in the time domain, z∈CPare signal coefficients. Linear operator D:CP→RNis the synthesis operator and A:RN→CPis the analysis operator, and it holds D=A∗. Because of the computational reasons, we will restrict ourself exclusively to Parseval tight frames, i.e. it holds DD∗=A∗A=Id.(13) For such frames, it holds kA∗ck2≤ kck2while kA∗ck2=kck2for c∈ R(A),(14) where R(A)denotes the range space of A. Problems (12) and (11) can also be written as a sum of two indicator functions, such that min x,z,k ιΓ(y)(x) + ι`0≤k(z)s.t. Ax−z= 0 . . . A-SPADE x−Dz= 0 . . . S-SPADE,(15) where ιΓ(y)(x)is indicator function forcing the result to lie in the set of feasible solutions Γ and ι`0≤k(z)is a symbolic notation for indicator function ι{z| kzk0≤k}(z), that enforces the sparsity of the signal. In the particular case of A-SPADE, our goal is to minimize the following argmin x,z,k ιΓ(y)(x) | {z } f(x) +ι`0≤k(z) | {z } g(z) s.t. Ax−z= 0,(16) which for fixed kcorrespond to problems of the form (2). However, the difference is the non-convexity of g, therefore we aim only at an approximation of (16) using ADMM [1]. We form the Augmented Lagrangian Lρ(x,y,z) = ιΓ(y)(x) + ι`0≤k(z) + y>(Ax−z) + ρ 2kAx−zk2 2.(17) Using the scaled form, the Augmented Lagrangian can be also written as Lρ(x,z,u) = ιΓ(y)(x) + ι`0≤k(z) + ρ 2kAx−z+uk2 2−ρ 2kuk2 2.(18) According to definition of ADMM in (7), we can form the ADMM algorithm for problem (16) as follows: x(i+1) = argmin xιΓ(y)(x) + ρ 2kAx−z(i)+u(i)k2 2(19a) z(i+1) = argmin zι`0≤k(z) + ρ 2kAx(i+1) −z+u(i)k2 2(19b) u(i+1) =u(i)+Ax(i+1) −z(i+1).(19c) Note that thanks to the indicator functions, the penalty parameter ρdoes not play any role in finding the argument of the minima, therefore can be omitted. ADMM steps (19) can be also written in the constrained form, such that we get x(i+1) = argmin x kAx−z(i)+u(i)k2 2s.t. x∈Γ(20a) z(i+1) = argmin z kAx(i+1) −z+u(i)k2 2s.t. kzk0≤k(20b) u(i+1) =u(i)+Ax(i+1) −z(i+1).(20c) 3
The x-update, i.e. the steps (19a) and (20a), is an orthogonal projection onto the set of feasible solutions Γ. The z-update, steps (19b) and (20b), is solved (not approximated!) by hard-thresholding operator Hk, which sets all but klargest components in the magnitude of the input vector to zero. This is implied by the property argmin z∈CP,kzk0≤k kz−sk2 2=Hk(s)(21) for any fixed s∈CP. Remark 2. It is straightforward to show the property (21). First, it is clear that the optimal solution zopt has sparsity k, unless ksk0< k and then zopt =s. Supposing that it is not the trivial case, we will divide kz−sk2 2into two parts—the sum of squares of the coefficients of zthat are forced to be zero by the condition kzk0≤k, and the rest. Apparently, the first part is minimized by setting the P−ksmallest coefficients of sto zero. Furthermore, the second part is minimized by setting the remaining kcoefficients equal to corresponding values of s, leading us to the solution zopt =Hk(s). Remark 3. Step (20a) is a projection that seeks for a signal-domain solution. This is not trivial, however, along with [2], it can be transposed to a more convenient form, which is x(i+1) = argmin x kx−A∗(z(i)−u(i))k2 2s.t. x∈Γ,(20a’) i.e. a projection onto Γthat is easy to implement. We will now prove the equivalence of (20a) and (20a’). Denote s=z(i)−u(i)and define its unique factorization s=Aξ |{z} ∈R(A) +ε. |{z} ⊥R(A) (22) Using this, Eq. (20a) can be rewritten as x(i+1) = argmin x kA(x−ξ)−εk2 2s.t. x∈Γ.(23) Because clearly A(x−ξ)∈ R(A)and ε⊥ R(A), we can use the Pythagorean theorem and write x(i+1) = argmin x kA(x−ξ)k2 2+kεk2 2s.t. x∈Γ.(24) Since we are searching for the argument of the minima, we can omit the term kεk2 2, which is independent of x. Next, we will make use of the property of Parseval tight frames (14), leading to the equivalence of Eq. (24) and x(i+1) = argmin x kA∗A |{z} Id (x−ξ)k2 2s.t. x∈Γ.(25) Finally, we will show that ξ=A∗s. Using Aξ =s−εand the property (13), we can write ξ=A∗(s−ε) = A∗s−A∗ε. (26) We know that ε⊥ R(A)⇔ hε, Aωi= 0 ∀ω. Using the definition of adjoint operator, hε, Aωi=hA∗ε, ωi ∀ε∀ω, therefore hA∗ε, ωi= 0 ∀ω⇔A∗ε= 0 and ξ=A∗s. This completes the proof, because then kx−ξk2 2=kx−A∗sk2 2=kx−A∗(z(i)−u(i))k2 2 and that leads to Eq. (20a’). 4
The SPADE algorithms, as introduced in the original paper [2], are shown in Alg. 1 (A-SPADE) and Alg. 2 (S-SPADE), respectively. Algorithm 1: A-SPADE Require: A, y, MR, MH, ML, s, r, 1ˆ x(0) =y,u(0) =0, i = 1, k =s 2¯ z(i+1) =HkAˆ x(i)+u(i) 3ˆ x(i+1) = argminxkAx−¯ z(i+1) +u(i)k2 2 s.t. x∈Γ 4if kAˆ x(i+1) −¯ z(i+1)k2≤then 5terminate 6else 7u(i+1) =u(i)+Aˆ x(i+1) −¯ z(i+1) 8i←i+ 1 9if imod r= 0 then 10 k←k+s 11 end 12 go to 2 13 end 14 return ˆ x=ˆ x(i+1) Algorithm 2: S-SPADE Require: D, y, MR, MH, ML, s, r, 1ˆ z(0) =D∗y,u(0) =0, i = 1, k =s 2¯ z(i+1) =Hkˆ z(i)+u(i) 3ˆ z(i+1) = argminzkz−¯ z(i+1) +u(i)k2 2 s.t. Dz∈Γ 4if kˆ z(i+1) −¯ z(i+1)k2≤then 5terminate 6else 7u(i+1) =u(i)+ˆ z(i+1) −¯ z(i+1) 8i←i+ 1 9if imod r= 0 then 10 k←k+s 11 end 12 go to 2 13 end 14 return ˆ x=Dˆ z(i+1) While the paper [2] does not present the derivation of either A-SPADE or S-SPADE, we have shown in Sections 1 and 2 that A-SPADE perfectly fits the ADMM paradigm. On the other hand, the S-SPADE version in Alg. 2 follows a problem formulation which is different from the one the paper coped with. However, it is still derived from ADMM; it is easy to show that the problem formulation corresponding to the S-SPADE algorithm from [2] is min w,zkzk0s. t. Dw∈Γ(y)and kw−zk2≤. (27) This original S-SPADE can be derived from (27) in the same way we described the A-SPADE derivation, starting from (11). Section 3 introduces a new synthesis version of the SPADE algorithm derived from formulation (12), which is in some sense much more in line with the analysis approach than formulation (27) (therefore the “done right” in the title). Remark 4. Note that [2] reported that the projection step in S-SPADE is computationally expensive. Our recent paper [3] showed that there exists a one-step projection, making A-SPADE and S-SPADE identical from this point of view. It is a kind of paradox that we were able to speed up an algorithm that is derived in an inconsistent way (with the initial formulation), although producing reasonable results. In the new S-SPADE presented below, our fast projection step is not helpful. 3 Synthesis Version of SPADE, Done Right The problem formulation of this version of SPADE algorithm is very similar to (16), only with the difference that ι`0≤k(z)will be identified with f(z)and likewise ιΓ(y)(x)will be identified with g(x). The primal variable, in this case, will be zrepresenting signal coefficients, opposite to A-SPADE, where the primal variable was signal waveform, x. We formulate the problem as argmin x,z,k ι`0≤k(z) | {z } f(z) +ιΓ(y)(x) | {z } g(x) s.t. Dz−x= 0,(28) 5
We again form the Augmented Lagrangian for this problem as: Lρ(x,y,z) = ι`0≤k(z) + ιΓ(y)(x) + y>(Dz−x) + ρ 2kDz−xk2 2.(29) As in (18), we use the scaled form Lρ(x,z,u) = ι`0≤k(z) + ιΓ(y)(x) + ρ 2kDz−x+uk2 2−ρ 2kuk2 2,(30) leading to the ADMM steps as follows: z(i+1) = argmin z kDz−x(i)+u(i)k2 2s.t. kzk0≤k(31a) x(i+1) = argmin x kDz(i+1) −x+u(i)k2 2s.t. x∈Γ(31b) u(i+1) =u(i)+Dz(i+1) −x(i+1).(31c) When comparing ADMM steps of A-SPADE and S-SPADE, one can notice a different order of the minimization steps. This is caused by setting the variable zas the primal variable in S-SPADE. According to [1], it should be possible to freely choose the order of the f- and g-update steps. As a consequence, it is possible to first apply the hard thresholding and then the projection onto Γin both A-SPADE and S-SPADE, being aware that the statement from [1] generally holds true for convex problems only. The f-update (31a) is a challenging task to solve, but we rely on the frequent ADMM behaviour that it still converges even when the individual steps are computed (in contrast to A-SPADE) only approximately. We interpret Eq. (31a) as follows: we search for a ksparse vector of coefficients z(i+1), such that the synthesis operator Dapplied to these coefficients gives signal closest to (x(i)−u(i)). We suggest approximating the solution of this optimization task with the hard thresholding operator Hkapplied to the analysis coefficients of (x(i)−u(i)), i.e. z(i+1) ≈z(i+1) appr =HkD∗(x(i)−u(i)),(32) and we will show that this approximation is sufficiently close to the proper solution of (31a). Using the properties of Parseval tight frame (13) and (14), we can write Dz(i+1) −x(i)+u(i) 2 2= Dz(i+1) −DD∗(x(i)−u(i)) 2 2(33a) = D(z(i+1) −D∗(x(i)−u(i))) 2 2(33b) ≤ z(i+1) −D∗(x(i)−u(i)) 2 2.(33c) Using the property (21), the norm (33c) is minimized by z(i+1) appr defined by (32). Therefore the error of the approximation in the time domain (i.e. the original norm in (33a)) is bounded by the minimal value of (33c) and thus we can expect it to be sufficiently small. The solution to (31b) is obtained by a simple projection in the time domain. The final version of the S-SPADE done right is shown in Algorithm 3. Note that the computational complexity is identical in all three SPADEs and it is dominated by the cost of the transforms. Remark 5. Note that the ADMM step (31a) can be also approximated using other means, for example by a greedy algorithm such as the OMP, where the signal to be sparsely approximated is (x(i)−u(i)), the dictionary is Dand the algorithm is forced to terminate after kiterations. 6
Algorithm 3: S-SPADE done right Require: D, y, MR, MH, ML, s, r, 1ˆ x(0) =D∗y,u(0) =0, i = 1, k =s 2¯ z(i+1) =HkD∗(ˆ x(i)−u(i)) 3ˆ x(i+1) = argminxkD¯ z(i+1) −x+u(i)k2 2s.t. x∈Γ 4if kD¯ z(i+1) −ˆ x(i+1)k2≤then 5terminate 6else 7u(i+1) =u(i)+D¯ z(i+1) −ˆ x(i+1) 8i←i+ 1 9if imod r= 0 then 10 k←k+s 11 end 12 go to 2 13 end 14 return ˆ x=ˆ x(i+1) 4 Equivalence of SPADEs in case of unitary operators Note also that the three presented SPADEs are equivalent for unitary operators D=A∗= A−1. This fact can be shown as an equivalence of formulations of the three problems—the resulting algorithms are equivalent as a consequence, since the derivation process is the same for all three. First, let us repeat the formulation (15) for A-SPADE and S-SPADE done right min x,z,k ιΓ(y)(x) + ι`0≤k(z)s.t. Ax−z= 0 . . . A-SPADE x−Dz= 0 . . . S-SPADE,(15) and let (27) be reformulated in similar form as min w,z,k ιΓ(y)(Dw) + ι`0≤k(z)s.t. w−z= 0.(34) The two formulations in (15) differ only by the constraint binding xwith zand in the unitary case, one can be easily translated into the other by applying D=A−1(A-SPADE to S-SPADE) or A=D−1(S-SPADE to A-SPADE) on both sides of the constraint. To show the equivalence of (34) and (15), we substitute x=Dw, leading to w=D−1x=Ax. Formulation (34) then attains the form min x,z,k ιΓ(y)(DA |{z} Id x) + ι`0≤k(z)s.t. Ax−z= 0,(35) which is the A-SPADE formulation from (15). 7
References [1] S. P. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein, “Distributed optimization and statistical learning via the alternating direction method of multipliers.” Foundations and Trends in Machine Learning, vol. 3, no. 1, pp. 1–122, 2011. [Online]. Available: http://dblp.uni-trier.de/db/journals/ftml/ftml3.html#BoydPCPE11 [2] S. Kitić, N. Bertin, and R. Gribonval, “Sparsity and cosparsity for audio declipping: a flexible non-convex approach,” in LVA/ICA 2015 – The 12th International Conference on Latent Variable Analysis and Signal Separation, Liberec, Czech Republic, Aug. 2015. [3] P. Záviška, P. Rajmic, Z. Průša, and V. Veselý, “Revisiting synthesis model in sparse audio declipper,” in Latent Variable Analysis and Signal Separation, Y. Deville, S. Gannot, R. Mason, M. D. Plumbley, and D. Ward, Eds. Cham: Springer International Publishing, 2018, pp. 429–445. 8