A Concept of the Non-Stationary Filtering Network with Reduced Transient Response

Featured Application: Presented ﬁltering structure can be used to improve the operation and dynamics of ﬁlters. Abstract: This paper presents a concept of the non-stationary ﬁltering network with reduced transient response consisting of the ﬁrst-order digital elements with time-varying parameters. The digital ﬁlter section is based on the analog system. In order to design the ﬁltering network, the analog prototype was subjected to the discretization process. The time constant and the gain factor were then temporarily varied in time in order to suppress the transient response of the designed ﬁltering structure. The optimization method, based on the Particle Swarm Optimization (PSO) algorithm which is aimed at reducing the settling time by a proper parameter manipulation, is presented. Simulation results proving the usefulness of the proposed concept are also shown and discussed.


Introduction
Nowadays, digital and analog filters are both commonly used for analysis and signal processing. Their effectiveness and quick operation allow them to eliminate unwanted noise or signal components. Many of their designs, implementation methods, and programming are well known [1][2][3][4]. In the case of digital filters, there are many different approaches (e.g., time window method or bilinear transformation).
In this paper, the concept of creating a filtering system-called a network due to the similarity of its construction to one-way (recurrent) neural networks-is presented. Each element in the network is the same, with one high-pass and one low-pass output. The final structure is defined by weights. Their value affects which signal is forwarded to the next layer of the network. A network composed of these non-stationary elements has the ability to shape frequency characteristics without any restraint, and is also characterized by proper accuracy of the filtering process. This allows for the possibility of expansion which enables operation with even the most complex signals.
Furthermore, it is known that in filters with time-invariant parameters, there are only a few possibilities to shorten the time of the transient state. However, the introduction of time-varying parameters (i.e., the time functions of the time constant and the gain factor) allows a prominent reduction of the settling time without altering their spectral properties. This paper proposes a new method of selecting optimal parameters of the functions that vary the filter coefficients, where all necessary values are specified by the chosen algorithm, in this case the Particle Swarm Optimization (PSO) algorithm [5][6][7]. Using artificial intelligence methods is popular when it comes to filtration and methods are constantly being developed [8][9][10][11][12]. This procedure avoids many unnecessary calculations and helps to automatize and optimize the research. In order to avoid internal feedbacks, a layered structure was presupposed, which is an improvement compared to the previous concept of the network. This paper is organized into sections. In Section 2, the first-order element is presented in both analog and digital. In Sections 3 and 4 a description of the network structure is discussed. The first part explains the general construction while the second places emphasis on the parameters and the fitness function of the algorithm. Section 5 shows the varying functions used during the studies. Network operation and examples of filtration are shown in Sections 6 and 7. The conclusions summarizing the study are given in Section 8.

First-Order Element as a Basic Part of the Network
In the first phase of the research, the first-order analog element was selected as the fundamental network component. It was characterized by two outputs: low-pass and high-pass. This can be described by the following system of equations: where: x(t)-input signal subjected to filtration; z(t)-high-pass output signal; y(t)-low-pass output signal; T d -time of derivative (defines the lower limit of the high-pass frequency); T-time constant (defines the upper limit of the low-pass frequency); f −1 T (t)-function varying the time constant coefficient; f k (t)-function varying the gain coefficient; k ∞ -gain coefficient with the time approaching infinity.
The results of the preceding research [13][14][15] have shown that filters with time-varying parameters work undoubtedly better in the time domain than filters with time-invariant parameters. The quality of their operation is determined by the time after which the error value of the output signal is no greater than the assumed accuracy, α. Replacing the time constant with the time function and the gain coefficient with the gain function significantly shortens the duration of the transient state without changing the filters properties in the frequency domain.
The functions of the gain factor and the time constant are described as follows: where h T (t) and h k (t) are the step responses of the second order element with time-invariant parameters. The function varying the parameters allows for the creation of the time function of the time are a multiplication of their value change. Both functions have to obtain the value specified in the spectral assumptions in time no longer than the duration of the transient state. The easiest way to accomplish this requirement is to set the value of damping factor β between 0.71 < β < 1. The damping factor is responsible for suppressing oscillation, with higher values making it work better. The function varying the parameters used in the paper generated a step response of the second-order inertial element. This form was accepted due to previously conducted studies and its current state of art in the field. In order to transform the continuous-time system model mentioned above to the discrete-time system, the bilinear transform was used. The bilinear transformation maps the s-plane (Laplace transform) to the z-plane (Z transformations). Although this transformation is non-linear, it is useful considering that it maps the entire s-plane axis to the z-plane unit circle. After specifying the requirements for the designed digital filter, using the applicable mapping, the proper equation forms were obtained. Obtained equation: where the low-pass filter coefficients are: and the high-pass filter are: The next step was to implement prepared elements and connect them into the network. Simulations were carried out in order to analyze operation of the network, its speed, and its effectiveness.

Description of the Structure: Weights, Layers, and Values of the Time Constant
In this paper, the concept of a time-invariant network was proposed. The analyzed filtration network consisted of digital non-stationary first-order elements organized in layers and weights w mn at the input of each layer. Parameters of individual elements were predetermined. Figure 1 presents an example block diagram of such a network.
Appl. Sci. 2019, 9, x FOR PEER REVIEW 3 of 10 requirements for the designed digital filter, using the applicable mapping, the proper equation forms were obtained. Obtained equation: and the high-pass filter are: = 2 ⋅ + ; = 2 ⋅ − = 2 ⋅ ⋅ ; = 2 ⋅ ⋅ . The next step was to implement prepared elements and connect them into the network. Simulations were carried out in order to analyze operation of the network, its speed, and its effectiveness.

Description of the Structure: Weights, Layers, and Values of the Time Constant
In this paper, the concept of a time-invariant network was proposed. The analyzed filtration network consisted of digital non-stationary first-order elements organized in layers and weights wmn at the input of each layer. Parameters of individual elements were predetermined. Figure 1 presents an example block diagram of such a network. In the steady state condition, the gain coefficient kn of each element has a value equal to 1. The time constants of the n-elements structures were established based on the following formula: .

5)
The input signal multiplied by the proper weight value selected by the algorithm at range between [0, 2] was given to the inputs of the elements. It was assumed that there were at least two elements in each layer. After that, the outputs of the elements were added together and given to the next layer. This structure was inspired by recurrent neural network (RNN) which is a class of In the steady state condition, the gain coefficient k n of each element has a value equal to 1. The time constants of the n-elements structures were established based on the following formula: 20 . The input signal multiplied by the proper weight value selected by the algorithm at range between [0, 2] was given to the inputs of the elements. It was assumed that there were at least two elements in each layer. After that, the outputs of the elements were added together and given to the next layer. This structure was inspired by recurrent neural network (RNN) which is a class of artificial neural network. This approach allowed for avoidance of feedback between individual elements.

Description of the Structure: Optimization Algorithm
In this paper, the genetic algorithm PSO (Particle Swarm Optimization) was used for optimization. Particle Swarm Optimization belongs to the category of Swarm intelligence methods [5], a dynamic optimization tool which can solve very complex optimization problems. The method operates on a population (swarm) of the particles, where each particle is placed at the position in the solution space. The algorithm operates using iterative selection of the best solution with all quality measures taken into account. The method is precisely described in the literature concerning biology inspired algorithms [6,7,16,17].
This research is being undertaken to perform learning of the chosen frequency response and to select a varying function of the parameters. The expected results of this study should reduce the transient states as much as possible. In this paper, a structure consisting of six elements was used. In the first case, we examined a three-layer network, where each layer had two elements. The second two-layer structure had three elements in each layer.
The shaping of the frequency response was developed by choosing the values of the input weights (matrix A) and the output weights (matrix B). It was assumed that weights could be set between values 0 and 2.
The learning process occurred using the time-invariant network. The parameters were varied in time during the transient state which was omitted in the filtration process. After the transition processes were completed, the network became stationary.
In the course of the learning process, the expected amplitude characteristic was assumed. Selection of the weights was conducted by minimization of the error function [18]. The chosen function was the sum of squared error for subsequent values of angular frequency ω. The main advantage of such function was the maximization of large deviations without taking minor errors into account.
where: The examples of configurations and their performance of the analog networks are described precisely in preceding papers [15,19]. To compare the possibilities of the network composed of the same number of elements yet in different configurations, tests were carried out analyzing their dissimilarity.

Optimization of the Varying Function Parameters
The main goal of the varying function optimization was to reduce the simulation time and the computational complexity of the algorithm as much as possible, while simultaneously selecting the proper values of the parameters. Thereby, during the implementation of learning algorithms in the more complex structures, intermediate stages were omitted, which shortened the research process. For this purpose, the PSO algorithm was employed in the same manner as during the selection of the network structure. The varying functions that were used in the paper generated a step response of the second order inertial element. A specific description and analysis of the analog function optimization has been presented previously [20]. In this case, the varying function was discretized. The following form of the formula was obtained: where: To perform a variation of all the parameters (i.e., both the time constant and the gain coefficient), one function was implemented. This operation had no significance on the results, however it considerably reduced the simulation time. An additional modification was also introduced. In order to avoid notable signal overshoots, elements with the lowest time constants remained constant.

Network Operation and Differences between Structures
The network operation was compared using two examples: a band-stop filter and a band-pass filter. The tested system is shown in Figure 1. Parameters k and T of the elements in each layer were the same. The gain coefficient in every component equaled one, and subsequent time constants were calculated using Equation (5). To normalize the parameters of the algorithm, the population was assumed to be five times the number of searched variables, while the number of iterations was 10 times the number of searched variables. Minimization of the error function (Equation (6)) was performed using the PSO algorithm. After selecting the assumed frequency response, the algorithm selected weights and then calculated the error value, which was the difference between the assumed and estimated characteristics. All the presented simulations were conducted using MATLAB. The waveforms for two configurations of layers are shown below.
As one can easily notice, corresponding results differed from each other in a significant way. The limited number of elements and the layered structure were insufficient in some cases, but not all. As shown in the graphs above, the number of iterations was also important, where increasing the number of iterations could automatically improve results.
In Figures 2-5 the frequency responses of the band-stop filter obtained using two-layered and three-layered networks with two and three elements in each layer are presented. The best result was obtained using the first example shown in Figure 2, where the three-layered network with two elements in each layer structure was used. The research involved computer simulations on the network consisting of the same number of elements (n = 6) but in different configurations. Based on the results shown above, one can conclude that a better mapping of frequency response was obtained using arrangement with more layers.
In Figures 2-5 the frequency responses of the band-stop filter obtained using two-layered and three-layered networks with two and three elements in each layer are presented. The best result was obtained using the first example shown in Figure 2, where the three-layered network with two elements in each layer structure was used. The research involved computer simulations on the network consisting of the same number of elements (n = 6) but in different configurations. Based on the results shown above, one can conclude that a better mapping of frequency response was obtained using arrangement with more layers.

Results: Example Filtration of the Selected Signal
To illustrate the operation of the network, filtration of the rectangular signal with additional noise was performed for the best obtained mapping of the reference frequency response (Figure 2).

Results: Example Filtration of the Selected Signal
To illustrate the operation of the network, filtration of the rectangular signal with additional noise was performed for the best obtained mapping of the reference frequency response (Figure 2). The SNR value of the input signals equaled 11.6037. In Figure 6, the comparison between two cases-the network with time-invariant parameters and the network with time-varying parameters-is presented. The introduction of the time-varying parameters to the network improved results, as the duration of the transient state was reduced.
Afterward, the operation of the non-stationary network was tested for removal of undesirable signal elements. Figure 7 presents an input signal which is the sum of the rectangular signal, sine wave from the bandwidth range of the example, and noise signal. Figure 8 shows the result of conducted filtration.  Comparison of system response to rectangular signal for both stationary and non-stationary networks.
The introduction of the time-varying parameters to the network improved results, as the duration of the transient state was reduced.
Afterward, the operation of the non-stationary network was tested for removal of undesirable signal elements. Figure 7 presents an input signal which is the sum of the rectangular signal, sine wave from the bandwidth range of the example, and noise signal. Figure 8 shows the result of conducted filtration. The introduction of the time-varying parameters to the network improved results, as the duration of the transient state was reduced.
Afterward, the operation of the non-stationary network was tested for removal of undesirable signal elements. Figure 7 presents an input signal which is the sum of the rectangular signal, sine wave from the bandwidth range of the example, and noise signal. Figure 8 shows the result of conducted filtration.  As shown above, the network effectively attenuated the sine wave, leaving the noise signal. The output signal also had no problem following the changes of the rectangular signal shape, which was the result of varying the network parameters.

Conclusions
This paper presents a new concept of creating a filtering network consisting of digital non-stationary elements. Assuming that each of the elements is the same, a weight system was implemented to determine the relation between the individual layers. The resulting network structure is easy to modify, which proves its universality.
The research began with the formation of an analog element with two outputs, the low-pass and the high-pass. The next stage of the study was discretization of the filter and its varying function. It is well known that digital filters have some advantages over analog filters. The simplicity of obtaining characteristics of almost any shape as well as design flexibility are just some of the advantages. After the network was built, the filter parameters were varied in time. The time constant T was replaced with the time function and the gain coefficient k was replaced with the gain function. This operation allowed acceleration of the network by stabilizing the signal in a faster and more effective manner.
All the network parameters (i.e., weights on the outputs, inputs of the elements, and parameters of varying function) were selected using the PSO algorithm, which is a well-known optimization tool. Its effectiveness allowed us to determine the best values of the needed parameters. Based on the examples presented, improvement in the operation of the network can be easily seen.
In the future, the proposed concept of the network will be developed. Choosing the right structure for the given requirements is the main aim of the research. The next step is increasing the degree of automation of the filtration process, followed by implementation of the network on digital signal processors (DSP) or field-programmable gate arrays (FPGA).  As shown above, the network effectively attenuated the sine wave, leaving the noise signal. The output signal also had no problem following the changes of the rectangular signal shape, which was the result of varying the network parameters.

Conclusions
This paper presents a new concept of creating a filtering network consisting of digital non-stationary elements. Assuming that each of the elements is the same, a weight system was implemented to determine the relation between the individual layers. The resulting network structure is easy to modify, which proves its universality.
The research began with the formation of an analog element with two outputs, the low-pass and the high-pass. The next stage of the study was discretization of the filter and its varying function. It is well known that digital filters have some advantages over analog filters. The simplicity of obtaining characteristics of almost any shape as well as design flexibility are just some of the advantages. After the network was built, the filter parameters were varied in time. The time constant T was replaced with the time function and the gain coefficient k was replaced with the gain function. This operation allowed acceleration of the network by stabilizing the signal in a faster and more effective manner.
All the network parameters (i.e., weights on the outputs, inputs of the elements, and parameters of varying function) were selected using the PSO algorithm, which is a well-known optimization tool. Its effectiveness allowed us to determine the best values of the needed parameters. Based on the examples presented, improvement in the operation of the network can be easily seen.
In the future, the proposed concept of the network will be developed. Choosing the right structure for the given requirements is the main aim of the research. The next step is increasing the degree of automation of the filtration process, followed by implementation of the network on digital signal processors (DSP) or field-programmable gate arrays (FPGA).