## 2 Proposed NELE Method
### Optimization Unit  
The summed-cost-function (SCF) for frame number \(k(SCF_{k}(f))\) is defined by weighted summation of cost functions of that frame \((CF_{k}(f))\) and upcoming frames \((CF_{i}(f))\):  
\[SCF_{k}(f)=\sum_{i=k}^{p+k-1}\beta_{i}\cdot CF_{i}(f), \tag{12}\]  
Each one-third octave band denoted by \(f\) is optimized independently. To optimize a SCF, the number of frames influenced by the gain of a frame instead of \(M\) is denoted by P in Equation (12). According to Equation (4) and considering the \(T_{60}\), \(M\) short frames are overlapped by an extended frame. However, to reduce the computational load, lower number of frames may be considered, because it is reasonable to neglect the effect of the reverberation after \(P\leq M\) frames that are naturally shorter than \(T_{60}\). Therefore, this implementation does not require having a full-length signal available when optimizing a given frame and only a limited look ahead into the future is needed. This P value is imperially set using the energy decay curve (EDC) of RIR when its value is dropping by 25 dB. For the onset detection, an energy-based method described in [20,21] is used. Here, a parameter, namely the high frequency content (HFC), is constructed from a weighted sum of spectral powers for each frame. A detection function (DF), which is the ratio of the HFCover two consecutive frames, is calculated. After obtaining the DF for the full signal, its values are normalized to its maximum across frames. These normalized values \(0\leq\beta_{i}\leq 1\) that are the outputs of the onset detection unit are used for weighting the cost function in Equation (12). If the frame number \(k\) is detected to be an onset, a higher \(\beta_{i}\) is assigned to its cost function. To prevent high fluctuations of weights in the optimization, lower and upper bounds for a weight \(\alpha_{i,k}\) are set. The lower bound that is the minimum gain is set to \(-40\) dB. The output of the onset detection unit is also used here in the optimization routine. A frame is recognized as an onset if its \(\beta_{i}\) is above a threshold. This threshold is computed adaptively according to the average value of all \(\beta_{i}\) across all frames. If a frame is detected to be an onset, the maximum possible gain (upper bound) is set to \(20\) dB, otherwise maximally \(0\) dB is allowed. In the optimization procedure, only positive weights are accepted because the parameter that is going to be controlled is the leaked energy of each frame on the upcoming frames. Since the optimization is targeting energy, the application of negative weights would be meaningless. The constrained optimization problem is summarized as follows:  
\[ \begin{split}&\min SCF_{k}(f)\\ &\left\{\alpha_{i,f},k-P\leq i\leq k+P-1\right\}\\ & 0\leq\text{lower bound}\leq\alpha_{i,k}\leq\text{upper bound}\\ &\text{lower bound}=-40\text{ dB}\\ &\text{upper bound}=\left\{\begin{array}{ll}20\text{ dB},&\text{ frame ``$i$'' is an onset}\\ 0\text{ dB},&\text{ otherwise}\end{array}\right.\end{split}  \tag{13}\]  
To find the minimum of constrained non-linear multivariable function of Equation (13), a state-of-the-art method called the Sequential Quadratic Programming (SQP) [22; 23] is used. In this numerical optimization method, the Hessian of the Lagrangian function using a quasi-Newton updating method is estimated. The algorithm starts independently for each frequency band by calculating the coefficient of first frame \(\alpha_{1,f}\). The effect of the first frame is considered up to \(P\) frames after. Therefore, \(SCF_{1}(f)\) is a function of \(\alpha_{1,f}\), \(\alpha_{2,f},\alpha_{p,f}\). All of these \(P\) weights are determined in the first optimization routine. However, only \(\alpha_{1,f}\) is accepted as the final value, because other weights, except \(\alpha_{1,f}\), have an effect on the upcoming SCFs. In the next optimization \(\alpha_{2,f}\) is determined and being fixed and so on.