Based on the differences in noise characteristics, this paper classifies electromagnetic noise into two categories: power frequency noise and random noise and proposes corresponding suppression strategies according to their respective characteristics.
  2.1. Bipolar Cancellation Power Frequency Filtering
According to the periodic characteristic of power frequency noise, the power frequency noise in electromagnetic signals can be removed. The electromagnetic signals are divided into effective signals and noise signals as follows:
        where 
v(
t) is the electromagnetic signal collected by the receiving coil; 
s(
t) is the effective electromagnetic signal reflecting the underground medium, and the information contained therein can be used for the subsequent inversion of the substation grounding grid; 
fn(
t) is the power frequency interference and its harmonics, which are the main processing objects of power frequency filtering; 
rn(
t) is the random noise collected in the substation.
The power frequency interference in the substation is particularly serious. In this paper, the power frequency interference is first suppressed by the method of positive and negative bipolar cancellation. The power frequency interference in Chinese substations is mainly composed of the 50 Hz fundamental frequency and its integer-multiple harmonics. To utilize its periodic characteristics and thereby cancel the power frequency noise through bipolarity, the article sets the excitation frequency of the transmitting coil to 25 Hz with a duty cycle of 25%, and the transmitting waveform is a bipolar pulse square wave. At this time, the signal in a single period can be divided into positive signals and negative signals:
        where 
v+(
m) and 
v−(
m) represent first and second half of a PEC periodic signal, respectively, where 
m denotes the number of signal points collected in one period; 
s+(
m) and 
s−(
m) are the positive and negative pulsed electromagnetic signals, respectively, with the same amplitude but opposite directions; 
fn+(
m) and 
fn−(
m) refer to the power frequency interference and its harmonics. Since power frequency noise does not change abruptly in a short time, it can be considered that 
rn+(
m) and 
rn−(
m) have the same power frequency phase and amplitude. The power frequency interference can be effectively suppressed by performing differential averaging on 
v+(
m) and 
v−(
m), as shown in (3).
From (3), we can see that the power frequency interference in the electromagnetic signal has been eliminated by using the differential averaging method, but the random noise still remains. For this reason, MNF is further introduced to suppress the random noise.
  2.2. PEC Random Noise Suppression Based on MNF
MNF is a noise reduction method based on statistical characteristics, which is often used for noise reduction and signal extraction of high-dimensional data. In this paper, MNF is applied to the random noise processing of PEC data after power frequency interference removal. Through reconstruction with a certain threshold, random noise is separated from effective signals. After the power frequency preprocessing is completed by the above-mentioned bipolar cancellation power frequency filtering method, the collected PEC signal is 
X(
m × 
n):
        where 
X is the noisy data with effective signal 
XS and random noise 
XR. In addition, 
XS and 
XR are independent of each other. Here, 
n represents 
n cycles, and 
m is the number of datapoints contained in a single cycle; the covariance matrix 
C corresponding to 
X can be decomposed into the signal matrix 
CS and the noise matrix 
CR:
The 
CR is calculated by the maximum autocorrelation factor algorithm, where 
CR is composed of elements 
γkq.
        where 
zk(
j) and 
zq(
j) represent the differences between the (
j + 1)-th group of signals and the 
j-th group of signals in the 
k-th and 
q-th channels of data, respectively, while 
 and 
 are the average values of the 
k-th and 
q-th channels of data, respectively. In (6), 
k, 
q = 1, 2, …, 
n; 
j = 1, 2, …, 
m − 1; the 
CR is decomposed into the following formula by singular value decomposition:
        where 
DR is a diagonal matrix of eigenvalues, and 
U is a vector matrix corresponding to the eigenvalues. Construct the transformation matrix 
P:
And 
X is adjusted to 
XP, which lead to noise variance in minimum noise component of the PEC is a unit variance. Through calculation, the relationship between the covariance matrix 
CX of the transformed data 
XP and 
C of original data 
X in (9):
In (9), the covariance matrix 
CX is subjected to singular value decomposition, resulting in 
DX and 
V, where these two matrices are the eigenvalue matrix and eigenvector matrix, respectively. The second transformation matrix 
W = 
PV is constructed using the transformation matrix 
P and the eigenvector matrix 
V, and the PEC data 
X is linearly transformed using matrix 
W to obtain the MNF matrix 
ψ.
The MNF in matrix 
ψ is defined as the ratio of the noise variance in the data to the variance of the data itself, and formula is (11):
In (11), a smaller NF indicates a larger ratio of the effective signal to the total signal. Moreover, since the MNF transformation is a linear transformation, the PEC data X can be reconstructed using the MNF matrix. When a certain number of components are selected for reconstruction, the original PEC data X can be well recovered.
The MNF matrix is arranged in descending order of the effective signal ratio. The front principal components mainly contain the effective PEC signal Xs, with the noise component 
X, being secondary, while the rear principal components are dominated by noise 
XP, with the effective signal 
XS being secondary. Therefore, random noise can be effectively suppressed by reasonably selecting a small number of MNFs with high effective signal ratios for reconstruction, as shown in (12).
In (12), the effective PEC signal XS is reconstructed by selecting the first MNFs, while the MNFs from a−1 to m correspond to the random noise component Xp of data.
The components after MNF transformation are arranged in descending order of signal-to-noise ratio. Therefore, the essence of determining the reconstruction threshold 
a is to distinguish between signal-dominated components and noise-dominated components. To enhance the reproducibility of the method, this paper adopts the cumulative contribution rate method to determine the threshold 
a. Specifically, the eigenvalue 
λi of each component in the minimum noise component matrix 
ψ is first calculated. The eigenvalue reflects the energy contained in the component. Then, the cumulative energy contribution rate 
Ck of the first 
k components is calculated:
By setting a cumulative contribution rate threshold T = 95%, the threshold a is determined to be the minimum integer that satisfies Ca ≥ T. This method can adaptively retain most of the effective signal energy while discarding the remaining components dominated by noise, thereby achieving effective random noise suppression under the premise of ensuring signal fidelity.
Because the noise signal and the effective signal are independent of each other, MNF achieves the suppression of random noise through the following process: (1) Take input data into orthogonal components sorted in descending order of the effective signal ratio; (2) Select some components with higher effective signal ratios for signal reconstruction; (3) Effectively separate and remove noise components with lower effective signal ratios. This process can reduce the prediction pressure of the subsequent convolutional neural network and improve the noise reduction accuracy.