# SGM-EMA: Speech Enhancement Method Score-Based Diffusion Model and EMA Mechanism
## 2 Methodology
### Diffusion Process Based on SDE
Based on Equation (1), the forward diffusion process defines a Gaussian process, allowing the mean and variance of the process state \(\mathbf{x}_{t}\) to be determined when the initial conditions are known [43]. Consequently, this allows for direct sampling of \(\mathbf{x}_{t}\) at any time step \(t\) given \(\mathbf{x}_{0}\) and \(\mathbf{y}\) by using the perturbation kernel: \[p_{0t}(\mathbf{x}_{t}|\mathbf{x}_{0},\mathbf{y})=\mathcal{N}_{\mathbb{C}} \Big{(}\mathbf{x}_{t};\boldsymbol{\mu}(\mathbf{x}_{0},\mathbf{y},t),\sigma(t) ^{2}\mathbf{I}\Big{)},\] (6) where \(\mathcal{N}_{\mathbb{C}}\) is a circularly symmetric complex normal distribution and \(\mathbf{I}\) is the identity matrix. We use Equations (5.50, 5.53) in Sarkka and Solin [43] to determine the mean: \[\boldsymbol{\mu}(\mathbf{x}_{0},\mathbf{y},t)=e^{-\gamma t}\mathbf{x}_{0}+ \big{(}1-e^{-\gamma t}\big{)}\mathbf{y},\] (7) and the variance of the closed-form solution. \[\sigma(t)^{2}=\frac{\sigma_{\min}^{2}\bigg{(}\Big{(}\frac{\sigma_{\max}}{ \sigma_{\min}}\Big{)}^{2t}-e^{-2\gamma t}\bigg{)}\text{log}\Big{(}\frac{\sigma _{\max}}{\sigma_{\min}}\Big{)}}{\gamma+\text{log}\Big{(}\frac{\sigma_{\max}}{ \sigma_{\min}}\Big{)}}\] (8)  
[PERSON] [44] showed that the score model \(S_{\theta}\) fitted to the perturbation kernel \(\
abla_{\mathbf{x}_{t}}\text{log}_{pt}(\mathbf{x}_{t}|\mathbf{x}_{0},\mathbf{ y})\) is equivalent to implicit and explicit score matching under certain regularity conditions [45]. This is essentially an estimation result. Accordingly, \(\mathbf{x}_{t}\) can be efficiently calculated as  
\[\mathrm{d}\mathbf{x}_{t}=\mathbf{f}(\mathbf{x}_{t},\mathbf{y})\mathrm{d}t+g( t)\mathrm{d}\mathbf{w},\]0  
where \(\mathbf{z}\sim\mathcal{N}_{\mathbb{C}}(\mathbf{z};0,\mathbf{I})\). Using the score-matching principle [44], we simplify the perturbation kernel \(\
abla_{\mathbf{x}_{t}}\text{log}_{pt}(\mathbf{x}_{t}|\mathbf{x}_{0},\mathbf{ y})\) to  
\[\mathrm{d}\mathbf{x}_{t}=\mathbf{f}(\mathbf{x}_{t},\mathbf{y})\mathrm{d}t+g( t)\mathrm{d}\mathbf{w},\]1  
\[\mathrm{d}\mathbf{x}_{t}=\mathbf{f}(\mathbf{x}_{t},\mathbf{y})\mathrm{d}t+g( t)\mathrm{d}\mathbf{w},\]2\[\mathrm{d}\mathbf{x}_{t}=\mathbf{f}(\mathbf{x}_{t},\mathbf{y})\mathrm{d}t+g( t)\mathrm{d}\mathbf{w},\]3  
Substituting Equation (9) into Equation (12), we obtain  
\[\mathrm{d}\mathbf{x}_{t}=\mathbf{f}(\mathbf{x}_{t},\mathbf{y})\mathrm{d}t+g( t)\mathrm{d}\mathbf{w},\]4  
Therefore, Equation (12) can be rewritten as  
\[\mathrm{d}\mathbf{x}_{t}=\mathbf{f}(\mathbf{x}_{t},\mathbf{y})\mathrm{d}t+g( t)\mathrm{d}\mathbf{w},\]5  
Simplifying the expression yields  
\[\mathrm{d}\mathbf{x}_{t}=\mathbf{f}(\mathbf{x}_{t},\mathbf{y})\mathrm{d}t+g( t)\mathrm{d}\mathbf{w},\]6  
After \((\mathbf{x}_{t},\mathbf{y},t)\) is input into the score model (see Equation (4)), the final loss is the unweighted \(L_{2}\) loss between the model output \((\mathbf{s}_{\theta}(\mathbf{x}_{t},\mathbf{y},t))\) and the score of the perturbation kernel (derived from Equation (15)). The overall training objective is given by Equation (16):  
\[\mathrm{d}\mathbf{x}_{t}=\mathbf{f}(\mathbf{x}_{t},\mathbf{y})\mathrm{d}t+g( t)\mathrm{d}\mathbf{w},\]7