A Novel Fault Diagnosis Method for Analog Circuits Based on Multi-Input Deep Residual Networks with an Improved Empirical Wavelet Transform

: Analog circuits play an essential role in electronic systems. To strengthen the reliability of sophisticated electronic circuits, this paper proposes a novel analog circuit fault diagnosis method. Compared with traditional fault diagnosis, the fault diagnosis process in this paper uses a square wave as the stimulus of the circuit under test (CUT), which is beneﬁcial for obtaining the response of the CUT with rich time and frequency domain information. The improved empirical wavelet transform (EWT), which can more accurately extract the amplitude modulated–frequency modulated (AM-FM) components, is used to preprocess the original response. Finally, based on the preprocessed data, a multi-input deep residual network (ResNet) is constructed for fault feature extraction and fault classiﬁcation. The multi-input ResNet is a powerful approach for learning the fault characteristics of the CUT under different faults by learning the characteristics of the AM-FM components. The effectiveness of the method proposed in this paper is veriﬁed by comparing different fault diagnosis methods.


Introduction
As the electronic industry advances, the volume of electronic circuits is smaller, the functions are more abundant, and the integration and complexity are absolutely higher. A previous survey showed that nearly 80% of electronic circuits are digital circuits, while approximately 80% of faults are caused by analog circuits [1]. Therefore, the analog circuit crucially influences the stability and reliability of the electronic system. If an analog circuit fails during use, it will lead to certain economic losses and even safety issues. In recent years, due to the important role played by analog circuits in electronic systems, analog circuit fault diagnosis has become a research hotspot in engineering and academia. However, due to the nonlinear nature of the analog circuit and the lack of a good fault diagnosis model, analog circuit fault diagnosis has also become a research difficulty [2]. With the increased integration and complexity of electronic circuits, vulnerability to circuit noise, component tolerances, and difficulty of obtaining test points, fault diagnosis of analog circuits has become more intricate and difficult.
Currently, two main types of fault diagnosis methods are available for analog circuits: simulation before test (SBT) and simulation after test (SAT) [2]. SBT simulates various faults prior to fault diagnosis of analog circuits by simulation tools. In practical applications, the actual measured data are compared with the dataset obtained from the simulation to complete the fault diagnosis. SAT refers to the realization of fault location through theoretical analysis and logical deduction based on the fault data of the analog circuit collected in the actual measurement, although small parameter disturbances will affect the fault location results [1]. Compared with SAT, SBT is more widely used in analog circuit fault diagnosis due to its simpler theoretical and logical analysis and better realtime performance. The fault types of analog circuits are mainly divided into hard faults and soft faults [1,2]. Hard faults mainly refer to open and short faults. Such faults will contribute to relatively large changes in the relevant parameters of the circuit that directly cause circuit failure or destruction, and most of them can be found in the test stage before the circuit is promoted and used. Soft faults refer to failures in which the parameters of the components in the circuit deviate from the nominal value due to factors such as manufacturing, temperature, humidity, pressure, sunshine, dust, and component ageing. Furthermore, the probability of soft faults is much greater than that of hard faults, and the diagnostic demand and value of soft faults are greater than those of hard faults.
At the end of the 20th century, with the rise of artificial intelligence algorithms, a large number of fault diagnosis methods for analog circuits based on artificial intelligence algorithms were proposed, thereby realising the intelligence and automation of analog circuit fault diagnosis. From 2000 to 2007, Aminian used wavelet transform (WT) to preprocess the impulse response of the CUT and then realised the fault diagnosis of analog circuits by neural networks [3][4][5]. In 2008, Tan extracted features from the feasible domain based on wavelet packet transform (WPT) and finally completed the fault diagnosis of analog circuits by probabilistic neural networks [6]. In 2010, Cui used WPT to preprocess the response signal of the CUT, extracted the fault features and finally completed the fault diagnosis of the analog circuit by a support vector machine (SVM) [7]. Yuan preprocessed the responses of the CUT and input the entropy and kurtosis of the responses into the neural network to complete the fault classification, thereby realising fault diagnosis of the analog circuit in 2010 [8]. In 2013, Long combined the mean value and standard deviation of the WT components and the mean value, standard deviation, skewness, peak value, and entropy in the statistical characteristics of original responses to form a feature vector, and then used the least square support vector machine (LS-SVM) to finish the fault diagnosis of the CUT [9]. In 2016, Xiong used ensemble empirical mode decomposition (EEMD) to preprocess the response of the CUT to obtain the amplitude modulation and frequency modulation (AM-FM) components and calculate the peak value and relative entropy of each AM-FM component to form the feature vector, and then they completed fault diagnosis by an extreme learning machine (ELM) [10]. In 2020, He used a cross-wavelet transform (XWT) to obtain the spectrum map of the faulty signal and then fed the spectrum map to a generative adversarial neural network (GAN) to achieve fault diagnosis of the CUT [11]. In 2021, Ji obtained the spectrogram of the response of the CUT by short-time Fourier transform (STFT) and input it to ResNet to complete feature extraction and fault diagnosis of the CUT [12]. In 2021, Yang used WT to preprocess the signal at the output of the CUT and input the preprocessed data into an improved deep convolutional neural network to complete the diagnosis of incipient faults in analog circuits [13].
According to the above methods, it can be concluded that the general process of analog circuit fault diagnosis is data preprocessing, feature extraction, and fault diagnosis. The experimental results of a large number of studies have shown that by preprocessing the response signal of the CUT, the speed and accuracy of fault diagnosis can be effectively improved. Common signal preprocessing methods include STFT, WT, WPT, EMD, EEMD, [14] and empirical wavelet transform (EWT) [15]. Although WT can be used continuously as a time function for signal localization analysis, it can only decompose the low-frequency part of the signal and the level of detail is insufficient. WPT can process the high-and lowfrequency parts of the signal, but cannot perform data-driven frequency partitioning [16]. EMD can realise the adaptive decomposition of the original signal, but it lacks a theoretical basis and is prone to modal aliasing and end effects [17]. Although EEMD can eliminate mode aliasing and end effects, the algorithm is sophisticated and the time complexity is huge. The EWT proposed based on EMD and wavelet theory is not limited by the signal frequency band and can better eliminate mode aliasing and endpoint effects [15]. In fault diagnosis, support vector machines (SVMs) and artificial neural networks (ANNs) are the two most popular fault classification methods. SVM as a classifier requires additional feature analysis, extraction, or fusion, which can increase the complexity of analog circuit fault diagnosis. Compared with SVMs, ANNs can automatically learn the characteristics of the signal without manual intervention for feature analysis and processing.
Inspired by the above papers, a novel analog circuit fault diagnosis method is proposed in this paper, which first applies a multi-input ResNet to analog circuit fault diagnosis. In addition, a square wave is used as the stimulus of the CUT, and then responses are preprocessed by the improved EWT. The multi-input ResNet is used to complete feature extraction and fault diagnosis on the basis of the components decomposed by the improved EWT. This paper is proposed mainly based on the following ideas.

•
The components of the response signal vary among different CUT fault types. The improved EWT can effectively extract each component of the response signal, which is conducive to reducing the input and layer number of the neural network and improving the efficiency of feature extraction and fault diagnosis; • The multi-input ResNet can richly learn the characteristics of each component without extra feature analysis and processing, which is beneficial for reducing the complexity of analog circuit fault diagnosis and improving the accuracy.
The rest of this paper is organized as follows. The second section introduces the analog circuit fault diagnosis method proposed in this paper. The third section verifies the effectiveness of the proposed method by the Sallen-Key bandpass filter circuit, CSTV filter circuit, and leap-frog low-pass filter circuit. Finally, the fourth section concludes and summarises the work of this paper.

Proposed Framework for Fault Diagnosis
Based on the theory of EWT and ResNet, this paper makes subtle improvements to EWT and proposes a multi-input ResNet model. Moreover, the improved EWT and multiinput ResNet are applied to analog circuit fault diagnosis. Figure 1 shows the framework of proposed method. The first step of the method is to take the square wave as the stimulus of the CUT and collect the response of the output of the circuit. Then, the improved EWT is employed to preprocess the collected data and divide the preprocessed data into a training set, validation set, and test set. The multi-input ResNet model is trained with the training set, and the optimal multi-input ResNet model corresponding to the highest verification accuracy is acquired with the validation set. Finally, the test set is input to the optimal multi-input ResNet model, and the result of fault diagnosis is obtained.
Appl. Sci. 2022, 12, 1675 3 of 21 effects [15]. In fault diagnosis, support vector machines (SVMs) and artificial neural networks (ANNs) are the two most popular fault classification methods. SVM as a classifier requires additional feature analysis, extraction, or fusion, which can increase the complexity of analog circuit fault diagnosis. Compared with SVMs, ANNs can automatically learn the characteristics of the signal without manual intervention for feature analysis and processing. Inspired by the above papers, a novel analog circuit fault diagnosis method is proposed in this paper, which first applies a multi-input ResNet to analog circuit fault diagnosis. In addition, a square wave is used as the stimulus of the CUT, and then responses are preprocessed by the improved EWT. The multi-input ResNet is used to complete feature extraction and fault diagnosis on the basis of the components decomposed by the improved EWT. This paper is proposed mainly based on the following ideas.

•
The components of the response signal vary among different CUT fault types. The improved EWT can effectively extract each component of the response signal, which is conducive to reducing the input and layer number of the neural network and improving the efficiency of feature extraction and fault diagnosis; • The multi-input ResNet can richly learn the characteristics of each component without extra feature analysis and processing, which is beneficial for reducing the complexity of analog circuit fault diagnosis and improving the accuracy.
The rest of this paper is organized as follows. The second section introduces the analog circuit fault diagnosis method proposed in this paper. The third section verifies the effectiveness of the proposed method by the Sallen-Key bandpass filter circuit, CSTV filter circuit, and leap-frog low-pass filter circuit. Finally, the fourth section concludes and summarises the work of this paper.

Proposed Framework for Fault Diagnosis
Based on the theory of EWT and ResNet, this paper makes subtle improvements to EWT and proposes a multi-input ResNet model. Moreover, the improved EWT and multiinput ResNet are applied to analog circuit fault diagnosis. Figure 1 shows the framework of proposed method. The first step of the method is to take the square wave as the stimulus of the CUT and collect the response of the output of the circuit. Then, the improved EWT is employed to preprocess the collected data and divide the preprocessed data into a training set, validation set, and test set. The multi-input ResNet model is trained with the training set, and the optimal multi-input ResNet model corresponding to the highest verification accuracy is acquired with the validation set. Finally, the test set is input to the optimal multi-input ResNet model, and the result of fault diagnosis is obtained.

Theory of EWT
EWT is a new method of adaptive wavelet decomposition proposed by Gills in 2013 [15]. The main idea is to extract different modes of a signal by constructing a set of bandpass filters. Figure 2 shows the workflow of the EWT method. The first step of the algorithm is to convert the signal from the time domain to the frequency domain by using the Fourier transform method. Subsequently, we segment the Fourier spectrum by detecting the boundaries automatically to construct a bandpass filter bank. Finally, the AM-FM components of the original signal centred on a specific frequency are obtained by filtering.

Theory of EWT
EWT is a new method of adaptive wavelet decomposition proposed by Gills in 2013 [15]. The main idea is to extract different modes of a signal by constructing a set of bandpass filters. Figure 2 shows the workflow of the EWT method. The first step of the algorithm is to convert the signal from the time domain to the frequency domain by using the Fourier transform method. Subsequently, we segment the Fourier spectrum by detecting the boundaries automatically to construct a bandpass filter bank. Finally, the AM-FM components of the original signal centred on a specific frequency are obtained by filtering. Suppose the Fourier axis of a signal is normalised to [0,2 ] π . To follow Shannon's theorem, the discussion scope is limited to [0, ] π . The Fourier support interval [0, ] π is partitioned into N consecutive segments, and each segment is denoted as   Suppose the Fourier axis of a signal is normalised to [0, 2π]. To follow Shannon's theorem, the discussion scope is limited to [0, π]. The Fourier support interval [0, π] is partitioned into N consecutive segments, and each segment is denoted as Λ n = [ω n−1 , ω n ], where ω n−1 and ω n denote the boundary of each segment, with n = 1, 2 · · · N, ω 0 = 0, π]. N consecutive segments, excluding ω 0 and ω N , still need N-1 boundaries. The remaining boundaries of the divided Fourier spectrum can be determined according to the following:

•
Local maxima other than 0 and π should be found in the spectrum and arranged in descending order; • If the number of local maxima M is less than N, retain all the maxima and reset the number of Fourier segments N to M. Otherwise, retain the first N maxima; • Then, the N−1 boundaries can be defined as the centre of two consecutive maxima.
As shown in Figure 3, the transition zone is defined as the grey hatched area of width 2τ n , where τ n = γω n and 0 < γ < 1. We can ensure that there is no overlap between two consecutive transition zones when γ < min n ( ω n+1 −ω n ω n+1 +ω n ).

Theory of EWT
EWT is a new method of adaptive wavelet decomposition proposed by Gills in 2013 [15]. The main idea is to extract different modes of a signal by constructing a set of bandpass filters. Figure 2 shows the workflow of the EWT method. The first step of the algorithm is to convert the signal from the time domain to the frequency domain by using the Fourier transform method. Subsequently, we segment the Fourier spectrum by detecting the boundaries automatically to construct a bandpass filter bank. Finally, the AM-FM components of the original signal centred on a specific frequency are obtained by filtering. Suppose the Fourier axis of a signal is normalised to [0,2 ] π . To follow Shannon's theorem, the discussion scope is limited to [0, ] π . The Fourier support interval [0, ] π is partitioned into N consecutive segments, and each segment is denoted as   The empirical wavelets are equivalent to bandpass filters with band width Λ n . The empirical scaling functionφ n (ω) and the empirical wavelet functionψ n (ω) can be expressed by (1) and (2), respectively, based on the idea of constructing Littlewood-Paley and Meyer's wavelets. (1) The function β(x) is an arbitrary C k ([0, 1]) function that meets the basic requirements, as in (3).
It has been proven in practice that many polynomials can satisfy this condition, although the polynomial proposed by Daubechies used by Gilles is widely used, as shown in (4).
EWT is analogous to the conventional WT. As shown in (5) and (6), the detail coefficients and approximation coefficients can be given by the inner product with the empirical wavelet function and empirical scaling function, respectively, where ∧ indicates Fourier transform, ∨ indicates inverse Fourier transform, and − represents complex conjugation.
Following this formalism, we can obtain the empirical mode component f k , which is expressed as follows: where * denotes convolution. From the above, it is evident that the AM-FM components composed of f k are directly influenced by segmentation boundaries. Thus, boundaries can determine the decomposition effect of EWT.

Stimulus-Based Improved EWT
In this section, an improved EWT method with a new boundary condition based on stimuli is proposed. In the SBT method, stimuli are very important for simulation, and they must be capable of transmitting fault information between one or more nodes [18]. At present, the two most prevalent excitation signals in analog circuit fault diagnosis are pulse signals [9,10,12,13] and sinusoidal sweep signals [8,11,[19][20][21]. Fault information can be transmitted by pulse signals and sweep signals, and fault diagnosis can be accomplished by analysing circuit response signals. However, the impulse response only contains time domain information; therefore, it is difficult to analyse in the frequency domain. The sweep response of the circuit is a kind of unsteady signal, which increases the difficulty of frequency domain analysis.
Previous studies [22,23] combined multiple sinusoidal signals of different frequencies as the excitation of the CUT and verified the effectiveness of multifrequency analysis in analog circuit fault diagnosis. Inspired by these articles, this paper takes advantage of the characteristic that the square wave signal consists of multiple frequency components of fundamental and odd harmonics, and a square wave is used as the stimulus at the input of the CUT. Assuming that the square wave signal x(t) is of frequency f and amplitude E, (9) is the Fourier series expansion of x(t), where Ω 0 = 2π f . Using the square wave as the excitation of the CUT can not only transmit fault information and meet the needs of multiple frequencies but is also more convenient for the time and frequency domain analysis of the square wave response of the CUT.
The main idea of EWT is to construct a bandpass filter bank to obtain AM-FM components centred on a specific frequency. The traditional EWT arranges the local maximum values in the spectrum in descending order and takes the centre of two continuous local maximum values as the boundary of the spectrum segmentation. Thus, (1) and (2) can be used to construct a bandpass filter bank to obtain component signals.
Analog circuits are particularly complex, and most of them are nonlinear. When a square wave is used as a stimulus, the components of the circuit response are affected by different faults; therefore, the local maxima of the spectrum may be inconsistent in different faults. As a result, the centre frequency of the AM-FM components of the response of the same CUT in different faults is not necessarily the same, which will result in the inability to accurately analyse the impact of different faults on the components, thus limiting the improvement of the analog circuit fault diagnosis accuracy. Therefore, for the stimulus selected in this article, the traditional EWT used for the preprocessing of the response signal at the output of the analog circuit will no longer be applicable. To accurately reflect the effect of different analog circuit faults on the components, this paper uses a priori knowledge on the frequency of the excitation to determine the spectrum splitting boundaries in the improved EWT. Suppose that the Fourier axis of x(t) is normalised to [0, 2π], and the fundamental frequency of the square wave can be denoted as follows: where f s denotes the sampling frequency of x(t). According to (9), the square wave is mainly composed of fundamental and odd harmonics. If the boundary of the splitting spectrum is determined at even times, ω 0 , the components with odd times, f , as the centre frequency can be accurately extracted. Therefore, the boundaries in the improved EWT except for 0 and π can be expressed as follows: The specific implementation steps of the improved EWT are as follows: 1.
According to the characteristics of the CUT, select the square wave signal with frequency f as the excitation of the CUT; 2.
Perform Fourier transform on the response signal at the output end of the CUT, obtain the spectrum and convert the signal to the frequency domain for analysis; 3.
Use ω n as the boundary for dividing the Fourier spectrum; 4.
Obtain the AM-FM components of the signal based on Equations (1) and (2).

Construction Method for the Multi-Input ResNet
In the field of artificial intelligence, ANNs are widely used in fault diagnosis due to their strong expression ability and learning ability. However, with increasing ANN network depth, the training accuracy gradually increased to saturation and then began to degrade rapidly. The deep residual network (ResNet) proposed by He. Kaiming in 2016 can be used to resolve the problem of degradation [24]. ResNet is based on the following concepts:

•
The features obtained by shallow neural networks are not sufficiently abstract. By increasing the layers of the neural network, the abstraction of features can be improved and the training effect for some specific tasks can be improved to some extent.
• With the increase in neural network layers, the training accuracy of the neural network gradually becomes saturated and then rapidly decreases. This degradation problem limits the improvement of neural network training accuracy.

•
In theory, adding identity mapping to the optimal shallow neural network can not only increase the depth of the neural network, but also retain the same training errors as the shallow neural network so that the deeper network can perform better than the shallow network.
Based on these ideas, the problem of gradient degradation can be handled by adding identity mapping to the shallow neural network. The implementation of ResNet is equivalent to fitting an identity map.
The structure of the deep residual learning block is shown in Figure 4. The residual block is realised by a shortcut connection, which is equal to adding the input and output of the block directly and activating the block by the activation function. Therefore, the introduction of the identity shortcut does not increase the computational complexity, nor does it require additional parameters. In fact, identity mapping is ideal and impossible to realise. And it's a desired underlying mapping. Therefore, the deep residual learning block can only be used to infinitely close the identity mapping by underlying mapping. degrade rapidly. The deep residual network (ResNet) proposed by He. Kaiming in 2016 can be used to resolve the problem of degradation [24]. ResNet is based on the following concepts:

•
The features obtained by shallow neural networks are not sufficiently abstract. By increasing the layers of the neural network, the abstraction of features can be improved and the training effect for some specific tasks can be improved to some extent.

•
With the increase in neural network layers, the training accuracy of the neural network gradually becomes saturated and then rapidly decreases. This degradation problem limits the improvement of neural network training accuracy.

•
In theory, adding identity mapping to the optimal shallow neural network can not only increase the depth of the neural network, but also retain the same training errors as the shallow neural network so that the deeper network can perform better than the shallow network.
Based on these ideas, the problem of gradient degradation can be handled by adding identity mapping to the shallow neural network. The implementation of ResNet is equivalent to fitting an identity map.
The structure of the deep residual learning block is shown in Figure 4. The residual block is realised by a shortcut connection, which is equal to adding the input and output of the block directly and activating the block by the activation function. Therefore, the introduction of the identity shortcut does not increase the computational complexity, nor does it require additional parameters. In fact, identity mapping is ideal and impossible to realise. And it's a desired underlying mapping. Therefore, the deep residual learning block can only be used to infinitely close the identity mapping by underlying mapping.   Suppose that the underlying mapping realised by the deep residual learning block is H(x), where x represents the input of the deep residual block. F(x):= H(x) − x is defined as a residual mapping, and then H(x) = F(x) + x. The deep residual block is infinitely close to H(x), which is equivalent to stacking multiple nonlinear layers in the residual block to approximate F(x). It is easier to implement residual mapping with multiple nonlinear layers to approximate F(x) to 0 than to approximate identity mapping with multiple nonlinear layers. sufficiently learn the characteristics of each component. Although the structure of each ResNet unit is the same, their weights and biases obtained by training are different to obtain more abundant fault characteristics under different CUT fault types.
Each ResNet unit consists of a convolution block, 4 residual blocks and an average pooling layer. The convolution block consists of a one-dimensional convolution layer, batch normal (BN) layer, RELU layer, and average pooling layer. The residual block is constructed in the manner described in Figure 4, and the details are shown in [24].  Figure 5. Structure of the multi-input ResNet.

Experimental Validation
In this section, the standard analog filter circuits in ISCAS'97 are selected for validation which are widely used as verification circuits in the field of analog circuit fault diagnosis. Among them, the Sallen-Key band-pass filter circuit, the CSTV filter circuit, and the leap-frog low-pass filter circuit are the most typical ones, which are often selected as verification circuits in most literature, such as [8,10,13,[25][26][27][28], etc. Therefore, these three representative circuits are also chosen for experimental verification in this section.
All the fault diagnosis experiments in this article are performed on a computer with RAM of 16 GB and a processor frequency of 2.4 GHz. Multisim 14.0 is used to simulate the excitation signal, thermal noise and CUT and perform Monte Carlo analysis. The analog circuit fault diagnosis method proposed in this paper is implemented in a PyTorch environment through Python. Each ResNet unit consists of a convolution block, 4 residual blocks and an average pooling layer. The convolution block consists of a one-dimensional convolution layer, batch normal (BN) layer, RELU layer, and average pooling layer. The residual block is constructed in the manner described in Figure 4, and the details are shown in [24].

Experimental Validation
In this section, the standard analog filter circuits in ISCAS'97 are selected for validation which are widely used as verification circuits in the field of analog circuit fault diagnosis. Among them, the Sallen-Key band-pass filter circuit, the CSTV filter circuit, and the leapfrog low-pass filter circuit are the most typical ones, which are often selected as verification circuits in most literature, such as [8,10,13,[25][26][27][28], etc. Therefore, these three representative circuits are also chosen for experimental verification in this section.
All the fault diagnosis experiments in this article are performed on a computer with RAM of 16 GB and a processor frequency of 2.4 GHz. Multisim 14.0 is used to simulate the excitation signal, thermal noise and CUT and perform Monte Carlo analysis. The analog circuit fault diagnosis method proposed in this paper is implemented in a PyTorch environment through Python.

Circuit under Test
In practice, the probability of a single fault occurring in analog circuits is greater than that of multiple faults [25], and multiple failures may be caused by concurrent failures triggered by the failure of a single component. Therefore, only a single fault is considered in this paper. Differences in manufacturing processes introduce tolerances to components in analog circuits; therefore, the tolerance of resistance and capacitance is set at 5% in this paper. When the sensitive components in the analog circuit operate within the tolerance range, the circuit is in a normal state; when the sensitive components in the circuit deviate from the nominal value by 5-10% the components start to fail, but the circuit can still operate normally; and when the sensitive components in the circuit deviate from the nominal value by 30-50%, the circuit malfunctions [19,[25][26][27][28]. To diagnose the faults in this circuit, the 30% deviation of the sensitive component and 35% deviation of the less sensitive component or confusion-prone component from the nominal value are taken as the standard of components' fault setting in this article. Thermal noise with a resistance value of 10 K, temperature of 27 • C, bandwidth of 1 MHz, and signal-to-noise ratio of 10 is added to the input of the circuit to simulate the noise environment in the actual use of the analog circuit. Figure 6 shows the Sallen-Key bandpass filter circuit with a centre frequency of 40 kHz. The square wave signal with a frequency of 10 kHz, duty cycle of 50% and amplitude of 5 V is used as the stimulus of the Sallen-Key bandpass filter circuit. The nominal values of the components in the Sallen-Key bandpass filter circuit are shown in Figure 6. The sensitive components of the Sallen-Key bandpass filter circuit are R2, R3, C1, and C2 [25,27]. Sensitive components, together with R1 and R4, are used for fault setting and they mainly have 13 fault states, which are represented as R1 ↓ , R1 ↑ , R2 ↓ , R2 ↑ , R3 ↓ , R3 ↑ , R4 ↓ , R4 ↑ , C1 ↓ , C1 ↑ , C2 ↓ , and C2 ↑ , and referred to as F0-F12, with F0 indicating that the circuit is not in fault. Table 1 is the specific fault setting in this instance. circuit, the 30% deviation of the sensitive component and 35% deviation of the less sensitive component or confusion-prone component from the nominal value are taken as the standard of components' fault setting in this article. Thermal noise with a resistance value of 10 K, temperature of 27 °C, bandwidth of 1 MHz, and signal-to-noise ratio of 10 is added to the input of the circuit to simulate the noise environment in the actual use of the analog circuit. Figure 6 shows the Sallen-Key bandpass filter circuit with a centre frequency of 40 kHz. The square wave signal with a frequency of 10 kHz, duty cycle of 50% and amplitude of 5 V is used as the stimulus of the Sallen-Key bandpass filter circuit. The nominal values of the components in the Sallen-Key bandpass filter circuit are shown in Figure 6. The sensitive components of the Sallen-Key bandpass filter circuit are 2 R , 3 R , 1 C , and 2 C [25,27]. Sensitive components, together with 1 R and 4 R , are used for fault setting and they mainly have 13 fault states, which are represented as 1

Sallen-Key Bandpass Filter
C ↓ , and 2 C ↑ , and referred to as F0-F12, with F0 indicating that the circuit is not in fault. Table 1 is the specific fault setting in this instance.     Figure 7 shows the CSTV filter circuit with a cut-off frequency of 1 kHz. A square wave signal with a frequency of 200 Hz, duty cycle of 50% and amplitude of 5 V is used as the stimulus of the CSTV filter circuit. The nominal values of the components in the CSTV filter circuit are shown in Figure 7. The sensitive components of the CSTV filter circuit are R1, R2, R5, C1, and C2 [29]. Sensitive components, together with R3 and R4, are used for fault setting and they mainly have 15 fault states, which are represented as R1 ↓ , and C2 ↑ , and referred to as F0-F14, with F0 indicating that the circuit is not in fault. Table 2 is the specific fault settings in this instance. Figure 8 shows the leap-frog low-pass filter circuit with a cut-off frequency of 1.5 KHz. A square wave signal with a frequency of 500 Hz, duty cycle of 50%, and amplitude of 5 V is used as the stimulus of the leap-frog low-pass filter circuit. The nominal values of components in the leap-frog low-pass filter circuit are shown in Figure 8. The sensitive components of the leap-frog low-pass filter circuit are R1, R2, R7, R12, R13, C1, and C2. Sensitive components together with R9 and R11 are used for fault setting and they mainly have 19 fault states, which are represented as

Leap-Frog Low-Pass Filter Circuit
and C2 ↑ , and referred to as F0-F18, with F0 indicating that the circuit is not in fault. Table 3 is the specific fault settings in this instance.   Figure 7 shows the CSTV filter circuit with a cut-off frequency of 1 kHz. A square wave signal with a frequency of 200 Hz, duty cycle of 50% and amplitude of 5 V is used as the stimulus of the CSTV filter circuit. The nominal values of the components in the CSTV filter circuit are shown in Figure 7. The sensitive components of the CSTV filter circuit are 1 R , 2 R , 5 R , 1 C , and 2 C [29]. Sensitive components, together with R3 and R4, are used for fault setting and they mainly have 15 fault states, which are represented as 1 C ↑ , and referred to as F0-F14, with F0 indicating that the circuit is not in fault. Table 2 is the specific fault settings in this instance.   Figure 8 shows the leap-frog low-pass filter circuit with a cut-off frequency of 1.5 KHz. A square wave signal with a frequency of 500 Hz, duty cycle of 50%, and amplitude  of 5 V is used as the stimulus of the leap-frog low-pass filter circuit. The nominal values of components in the leap-frog low-pass filter circuit are shown in Figure 8. The sensitive components of the leap-frog low-pass filter circuit are 1 R , 2 R , 7 R , 12 R , 13 R , 1 C , and 2 C . Sensitive components together with R9 and R11 are used for fault setting and they mainly have 19 fault states, which are represented as 1

Leap-Frog Low-Pass Filter Circuit
and 2 C ↑ , and referred to as F0-F18, with F0 indicating that the circuit is not in fault. Table 3 is the specific fault settings in this instance.

Data Preprocessing
A total of 250 samples are generated by Monte Carlo analysis for the above three CUTs in different faults, and the length of each sample is 1000. According to the ratio of 3:1:1, 250 samples are divided into 150 training samples, 50 verification samples, and 50 test samples to form a training set, a verification set, and a test set for the fault diagnosis of the above three CUTs, respectively. When the CUT is fault-free, the responses are shown in Figure 9. In this paper, the square wave is used as the stimulus of the CUT. Once the frequency of the square wave is determined, the frequency of its odd harmonic components will be determined accordingly. Responses vary from different fault types of the CUT, and there- In this paper, the square wave is used as the stimulus of the CUT. Once the frequency of the square wave is determined, the frequency of its odd harmonic components will be determined accordingly. Responses vary from different fault types of the CUT, and therefore have different effects on the odd harmonic components of the response. Based on repeated experiments, when the number of the CUT response components is set to 5, the fault diagnosis efficiency is the highest. Therefore, this article sets the number of components decomposed by EWT to 5. Figure 10 shows the spectrum segmentation result of the fault-free Sallen-Key bandpass filter circuit response obtained by the improved EWT and the traditional EWT. The stimulus of the Sallen-Key bandpass filter circuit is a square wave of 10 kHz. The main purpose of the EWT method is to accurately extract the components with 10 kHz and odd times of 10 kHz as the centre frequency to better analyse the influence of different types of faults on circuit performance. As shown in Figure 10b, the traditional EWT can extract the first four components with the highest amplitude in the spectrum of response The stimulus of the Sallen-Key bandpass filter circuit is a square wave of 10 kHz. The main purpose of the EWT method is to accurately extract the components with 10 kHz and odd times of 10 kHz as the centre frequency to better analyse the influence of different types of faults on circuit performance. As shown in Figure 10b, the traditional EWT can extract the first four components with the highest amplitude in the spectrum of response signals of the Sallen-Key low-pass filter circuit. The centre frequency of the second component is 10 kHz, and the centre frequency of the fourth component is 30 kHz. However, the fifth component confused the 50 kHz and 70 kHz components with the residual component, and the first and third components were invalid components. As shown in Figure 10a, for the five components obtained by the improved EWT proposed in this paper, the centre frequencies of the first four component signals are 10 kHz, 30 kHz, 50 kHz, and 70 kHz, and the fifth component is the residual component. It can be concluded that the improved EWT can accurately extract the component signal centred at an odd multiple of the stimulus frequency, which is helpful for improving the efficiency of fault diagnosis. Figure 11 shows the AM-FM components of the responses obtained by the improved EWT when there is no fault in the CUT.
Appl. Sci. 2022, 12, 1675 14 of 21 the stimulus frequency, which is helpful for improving the efficiency of fault diagnosis. Figure 11 shows the AM-FM components of the responses obtained by the improved EWT when there is no fault in the CUT.

Multi-Input ResNet Model Training
The structure of the multi-input ResNet model proposed in this paper is introduced in Section 3. In the experiment, the detailed information of the convolution block, residual block, and average pooling layer of a single ResNet unit, as well as the subsequent concat layer and FC layer, are shown in Table 4, where N_class denotes the fault number of a CUT. The number of ResNet units is consistent with the number of components of the CUT response signal; therefore, the multi-input ResNet in the experiment possesses 5 Res-Net units with the same structure. The training epoch of the multi-input ResNet is set to 100, and the training loss and validation loss are calculated by the cross-entropy loss function. The Adam optimiser is selected for ResNet parameter optimisation, and the learning rate of the optimiser is set to 1 × 10 −2 .

Multi-Input ResNet Model Training
The structure of the multi-input ResNet model proposed in this paper is introduced in Section 3. In the experiment, the detailed information of the convolution block, residual block, and average pooling layer of a single ResNet unit, as well as the subsequent concat layer and FC layer, are shown in Table 4, where N_class denotes the fault number of a CUT. The number of ResNet units is consistent with the number of components of the CUT response signal; therefore, the multi-input ResNet in the experiment possesses 5 ResNet units with the same structure. The training epoch of the multi-input ResNet is set to 100, and the training loss and validation loss are calculated by the cross-entropy loss function. The Adam optimiser is selected for ResNet parameter optimisation, and the learning rate of the optimiser is set to 1 × 10 −2 .
The training set is used to train the multi-input ResNet. For each epoch of training, the generalisation ability and classification ability of the multi-input ResNet model trained in this epoch are tested by the validation set. The training and verification losses are calculated by the cross entropy loss function. If the multi-input ResNet model trained by the training set in epoch p is ResNet − Model p , p = 1 · · · 100 and the classification ability and generalisation ability of ResNet − Model p are verified by the verification set, then the verification accuracy of the model in epoch p is Vacc p . After 100 epochs of training and verification, we obtain Model = [ResNet − Model 1 , · · · , ResNet − Model p , · · · , ResNet − Model 100 ] and Vacc = [Vacc 1 , · · · , Vacc p , · · · , Vacc 100 ]. The curves of training loss, training accuracy, verification accuracy, and verification loss in the training process of the multi-input ResNet model based on CSTV filter circuit response signals are shown in Figure 12. When the train-ing loss converges, the multi-input ResNet model corresponding to the highest verification accuracy has the best generalisation ability and classification ability, and the diagnosis effect is the best. If the index of the maximum value of Vacc is ind, the best multi-input ResNet model through 100 epochs of training is Model optima = Model[ind].    Based on the t-SNE, the original response signal of the CSTV filter circuit and the features extracted by Model optima are dimensionalised separately. The visualisation results after dimensionality reduction are shown in Figure 13. From Figure 13a, it is obvious that the discrimination of the original response signals of the CSTV filter circuit is poor and multiple fault types merge with each other and thus are difficult to distinguish. It can be seen from Figure 13b that after feature extraction with Model optima , features of the same fault type present good aggregation, while those of different fault types present large spacing and good differentiation. These findings verify the effectiveness of the multi-input ResNet's fault feature extraction.

Experimental Results and Analysis
The test sets of the three CUTs are input to the optimal multi-input ResNet model corresponding to the CUTs to obtain the confusion matrix shown in Figure 14. Figure 14a shows that the various faults of the Sallen-Key bandpass filter circuit can be distinguished well and there is no confusion or difficulty in distinguishing between different fault types. Figure 14c shows that the confusion between F4 and F10 is serious. Two samples with fault code F9 were diagnosed as the fault with fault code F3, a sample with fault code F13 was diagnosed as the fault with fault code F17, two samples with fault code F14 were diagnosed as the fault with fault code F12 and F18, respectively, and a sample with fault code F18 was diagnosed as the fault with fault code F6. In conclusion, the fault diagnosis result of the leap-frog filter circuit is worse than the other two circuits, which also reflects that the more complex the circuit is, the more confusion is generated between different faults and the fault diagnosis is more difficult.

Experimental Results and Analysis
The test sets of the three CUTs are input to the optimal multi-input ResNet model corresponding to the CUTs to obtain the confusion matrix shown in Figure 14. Figure 14a shows that the various faults of the Sallen-Key bandpass filter circuit can be distinguished well and there is no confusion or difficulty in distinguishing between different fault types. Figure 14c shows that the confusion between F4 and F10 is serious. Two samples with fault code F9 were diagnosed as the fault with fault code F3, a sample with fault code F13 was diagnosed as the fault with fault code F17, two samples with fault code F14 were diagnosed as the fault with fault code F12 and F18, respectively, and a sample with fault code F18 was diagnosed as the fault with fault code F6. In conclusion, the fault diagnosis result of the leap-frog filter circuit is worse than the other two circuits, which also reflects that the more complex the circuit is, the more confusion is generated between different faults and the fault diagnosis is more difficult.

Experimental Results and Analysis
The test sets of the three CUTs are input to the optimal multi-input ResNet mod corresponding to the CUTs to obtain the confusion matrix shown in Figure 14. Figure 14 shows that the various faults of the Sallen-Key bandpass filter circuit can be distinguishe well and there is no confusion or difficulty in distinguishing between different fault type Figure 14c shows that the confusion between F4 and F10 is serious. Two samples wit fault code F9 were diagnosed as the fault with fault code F3, a sample with fault code F1 was diagnosed as the fault with fault code F17, two samples with fault code F14 wer diagnosed as the fault with fault code F12 and F18, respectively, and a sample with fau code F18 was diagnosed as the fault with fault code F6. In conclusion, the fault diagnos result of the leap-frog filter circuit is worse than the other two circuits, which also reflec that the more complex the circuit is, the more confusion is generated between differen faults and the fault diagnosis is more difficult. To test the effectiveness of the analog circuit fault diagnosis method proposed in th paper, the proposed method is compared with the results in [8,10,13]. The fault diagnos results of these three CUTs are shown in Tables 5-7. A sinusoidal sweep signal was use as the stimulus of the CUT in [8], and a single pulse signal was used as the excitatio signal of the CUT in [10,13]. Without preprocessing the CUT response signal, the extracte features are directly input into the neural network to complete the fault diagnosis in [8 EEMD was used to preprocess signals, and then the extracted features were input in ELM to complete fault diagnosis in [10]. WT is used to preprocess signals, and the prepr cessed data are input into the convolutional neural network model to complete featu extraction and fault diagnosis in [13]. To test the effectiveness of the analog circuit fault diagnosis method proposed in this paper, the proposed method is compared with the results in [8,10,13]. The fault diagnosis results of these three CUTs are shown in Tables 5-7. A sinusoidal sweep signal was used as the stimulus of the CUT in [8], and a single pulse signal was used as the excitation signal of the CUT in [10,13]. Without preprocessing the CUT response signal, the extracted features are directly input into the neural network to complete the fault diagnosis in [8]. EEMD was used to preprocess signals, and then the extracted features were input into ELM to complete fault diagnosis in [10]. WT is used to preprocess signals, and the preprocessed data are input into the convolutional neural network model to complete feature extraction and fault diagnosis in [13]. In Table 5, the average diagnostic accuracy of [8] is the lowest. In Table 6, the average diagnostic accuracy of [8] is slightly higher than that of [10]. In Table 7, the average diagnostic accuracy of [8] is only higher than that of [10]. It is clear that preprocessing the CUT response signal helps to improve the accuracy of fault diagnosis. In Tables 5 and 7, the average diagnostic accuracy of [8,10] is lower than that of [13], the proposed method and the traditional EWT combined with multi-input ResNet. Only in Table 6 is the average diagnostic accuracy of [8,10] slightly higher than that of [13]. Therefore, automatic feature extraction based on an ANN can more adequately extract the feature information of the fault than the traditional feature extraction method. In Tables 4-6, the average diagnosis accuracy of the analog circuit fault diagnosis method proposed in this paper is higher than that of the method in [8,10,13] and the method based on the combination of traditional EWT and multi-input ResNet. In summary, the proposed method in this paper can effectively obtain the response signal characteristics of analog circuits under different faults, and it performs well in analog circuit fault diagnosis.

Conclusions
In this paper, a square wave is used as the excitation signal of the circuit under test, which provides another choice for the excitation signal in analog circuit fault diagnosis. EWT is improved based on the stimulus frequency to effectively extract each component of the response signal, thus providing a possibility for more accurate analysis of the influence of different CUT faults on the components. In addition, multi-input ResNet is applied to fault diagnosis of analog circuits, which is used for fault feature extraction and fault classification. This approach applies an ANN for fault diagnosis of analog circuits, and three analog circuits are used to verify the effectiveness of the proposed method.

Conflicts of Interest:
The authors declare no conflict of interest.