## 2 Algorithm Principle
### Dictionary Construction Based on an Oscillatory Atomic Library  
Building an appropriate sparse dictionary is a prerequisite for a signal to be sparsely represented. The selected dictionary should be as close as possible to the structure of the signal. If a correlation algorithm is used to find a few atoms with the best linear combination from the dictionary to represent the signal to be approximated, then the dictionary (atomic library) can be called the best dictionary. The processed object in this study is the MRS signal, and its expression is as follows:  
\[E(t)=E_{0}e^{-\frac{t}{T_{2}}}\cos(2\pi f_{1}t+\theta) \tag{3}\]  
where \(E_{0}\) is the initial amplitude, which is related to the water content; \(T_{2}^{*}\) indicates the transverse relaxation time and is related to the pore size distribution; \(f_{1}\) indicates Larmor frequency, which is related to the Earth's magnetic field and whose global variation range is 1.3-3.7 kHz; and \(\theta\) is the initial phase related to the conductivity of the subsurface medium and other factors. Equation (3) shows that the MRS signal is a cosine signal with an exponential decay characteristic.  
Power-line harmonic noise is a set of sine waves generated by power lines. Its expression is  
\[V_{harmonic}=\sum_{n=1}^{N}\ A_{n}\cos(2\pi nf_{0}t+\varphi_{n}) \tag{4}\]  
where \(A_{n}\) and \(\varphi_{n}\) are the amplitude and phase of the \(n\)-th harmonic, respectively; \(N\) is the number of harmonics; and \(f_{0}\) is the fundamental frequency of the power-line harmonic. Theoretically, \(f_{0}\) = 50 Hz; however, a certain degree of fluctuation exists. The use of an oscillating atomic library for the construction of sparse dictionaries is proposed in this study by combining Equations (3) and (4).  
\[g_{r}=K_{r}\cos(2\pi ft+\varphi)e^{-pt} \tag{5}\]  
where \(f\) is the oscillation frequency; \(\varphi\) is the oscillation phase, and its range is \([0,2\pi]\) (rad); and \(\rho\) is the oscillation attenuation coefficient, where \(\rho\geq 0\). When \(\rho>0\), it is an attenuated oscillation and corresponds to the MRS signal. When \(\rho=0\), it is a cosine signal that corresponds to the power-line harmonics. Here, \(g_{r}\) is normalized to obtain the coefficient \(K_{r}\). In the construction of the atomic library, each parameter in the parameter group \([\omega,\varphi,\rho]\) should be discretized, where \(\omega=2\pi f\). Each parameter in this work was discretized as follows:  
\[\begin{cases}\omega^{*}=\frac{2\pi}{N}\cdot p,&p\in[1,\text{N}]\in Z\\ \varphi^{*}=\frac{2\pi}{N}\cdot q,&q\in[0,\text{N}-1]\in Z\\ \rho^{*}=\frac{1}{N}\cdot r,&r\in[0,\text{N}-1]\in Z\end{cases} \tag{6}\]  
The correspondence between the atomic and discretized parameters is  
\[\begin{cases}f=\frac{\omega^{*}}{2\pi}\cdot f_{s}\\ \varphi=\varphi^{*}\\ \rho=\rho^{*}\cdot f_{s}\end{cases} \tag{7}\]By simplifying the relationship between Equations (6) and (7), the discrete parameter \(p\) and and signal frequency \(f\) were obtained.  
\[p=\frac{N}{f_{s}}f=t\cdot f \tag{8}\]  
The relationship between the discrete parameters \(r\) and \(T_{2}^{*}\) is  
\[r=\frac{N}{f_{s}}\cdot\frac{1}{T_{2}^{*}}=\frac{t}{T_{2}^{*}} \tag{9}\]