{'fraction_non_alphanumeric': 0.03548457667906366, 'fraction_numerical': 0.011944869831546707, 'mean_word_length': 4.789133738601824, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Distributed Adaptive Filtering on Wireless Sensor Networks with Shared Medium Competition

Wireless Sensor Networks (WSN) are of significant importance with increasingly diverse and viable applications. They gained even more traction after the IEEE 802.15.4 standard was defined. Distributed adaptive filtering algorithms have added statistical inference to WSN applications, employing techniques that extract data from distributed devices. In contrast, most adaptive filtering contributions do not consider realistic features of the subjacent telecommunications network protocols. Similarly, the telecommunications area typically does not take into account interesting abilities of adaptive filtering algorithms. In this paper, we explore this gap between the two study areas, allowing the development of network-protocol-aware distributed adaptive filtering techniques. In order to explore network realistic behaviors, this paper focuses on distributed inference problems. More specifically, we propose two new diffuse adaptive algorithms, aware of the characteristics of the Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) protocol, namely: (i) Variant Reuse of Coefficients Least Mean Squares (VRCLMS) algorithm; and the (ii) Reuse of Coefficients Least Mean Squares (RC-LMS) algorithm in the Adapt-Then-Combine (ATC) modality. These two new algorithms will bring some advantages, specifically when information is delayed because of too much packet loss. Another advantage will be the addition of the spatial information diversity contribution in the VRC-LMS algorithm.


Introduction
Wireless Sensor Networks (WSN) composed of intelligent sensors (possibly distributed over vast geographic regions [1]) have presented key contributions to the area of big data [2]. The combination of the huge growth in data volume with the advent of more efficient communication technologies promotes powerful schemes that address big data-related challenges [1]. This paper focuses on: (i) distributed inference problems that generaly occur on such types of networks [3]; and (ii) the design of distributed adaptive filtering algorithms incorporating realistic features of communication protocols. Adaptive filtering algorithms were chosen because of their low computational complexity, robustness to dynamic configurations, and ability to handle noisy information [4]. Typically, researchers of signal processing area do not address communication techniques from the perspective of distributed inference problems [5]. Similarly, the theoretical models used in signal processing to predict the behavior of distributed algorithms ignore the characteristics of protocols normally implemented in real devices. This paper intends to bridge the gap between adaptive filters and WSN. Accordingly, we associate metrics normally employed in the area of adaptive filtering (e.g.: the mean deviation error) with measurements typically used in the area of sensor networks (e.g.: network lifetime), through simulations that evaluate the impact of shared access protocols. We chose to employ state-of-the-art simulations, implemented in Network Simulator 3 (NS-3) [6].
In addition, we also take into account in the design of adaptive filtering algorithms, realistic communication protocols, such as the CSMA/CA protocol commonly used in WSN [7]. More specifically, we propose the utilization of the coefficient reuse technique [8]. This allows for better performance in steady state. As older information is less reliable, we will adopt a coefficients reutilization aware of the current network characteristics. Such awareness will allow for a more intense reuse of recent information alongside a greater attenuation of the impact of older information, the latter of which may be the result of collisions and packet retransmission. Such a design of a distributed inference method, contemplating the specificities of communication modes in a shared environmnent, is an unexplored area, located at the intersection between sensor networks, signal processing and distributed optimization. This paper is structured as follows. Section 2 depicts the fundamentals of adaptive filtering algorithms. Section 3 will describe one type of cooperation strategy in WSN which is referenced as the one with better performance among the main 15 techniques. Section 4 presents the concepts of coefficient reuse, which may benefit the estimation process under adverse conditions. Section 5 makes an overview of the IEEE 802.15.4 standard, highlighting its main characteristics such as the ones related to measuring parameters such as packet loss or power consumption. These features are then used as motivation for the proposed communication-protocol-aware adaptive filtering algorithm derived in Section 6.1. Section 7 shows the obtained results. Section 8 presents the concluding remarks of the paper.

Adaptive Filtering Fundamentals
The design of digital filters from a well-defined specification is a mature area of digital signal processing [9]. In practice, however, there are situations where specifications are not available and/or may vary over time. Usually, adaptive coefficients are used in these cases, resulting in the field known as adaptive filtering [10][11][12].
It is up to an adaptive filtering algorithm to update the filter coefficients. This is done in order to progressively perform the desired information extraction operation. Such updating is commonly guided by a cost function which, in supervised contexts, is dependent on a reference signal d(k) [13]. The structure of an adaptive filter, in the context of system identification, is presented in Figure 1. Although the scope of this work focuses in the identification of systems, it should be emphasized that adaptive filtering techniques have a wide range of applications, such as adaptive control, echo cancellation [14], noise cancellation [15], channel equalization [16], beam conformation [17] and time series prediction [12]. In Figure 1, x(k) represents the input signal (which must also excite the plant to be identified) and y(k) consists of the filter output. This output must progressively emulate d(k), called the desired signal. The magnitude of the discrepancy between the reference signal and the output of the filter is correlated with the quality of the filter at a given iteration. Such a discrepancy is usually incorporated into an error signal e(k) defined as where where N ∈ N is the filter size, the vectors x(k) and w i (k) are as follows . . . and where w i (k) is the i-th adaptive coefficient at the k-th iteration. It should be noted that identity (2) assumes a tapped-delay structure, which is often the one adopted in adaptive filtering algorithms. An adaptive filter undertakes changes in its coefficients oriented by minimizing a stochastic cost function (or, equivalently, an instantaneous cost function). Among the cost functions frequently found in the literature, the most common is the instant quadratic error, which is a stochastic approximation of the mean square error [10,11,13,18]. When this cost function is used, we have as result the Least Mean Squares (LMS) algorithm. This algorithm can be developed, therefore, from a simplification of the cost function, defined as where E [·] consists of the operator of statistical hope.
In the ideal case (i.e., when we use the cost function of Equation (5)), the gradient vector of the cost function can be described as where R x corresponds to the correlation matrix of the input signal and b x is the autocorrelation vector between the desired signal and the input signal [19]. Equation (6) expresses the solution to the defined cost function in (5) as where w * is a vector of dimensions N × 1. This solution is known in the literature as Wiener's solution, which consists of an analytical formula that determines the coefficients responsible for minimizing the cost function (5), or that in other words, represents the solution for the minimization of the mean square error [11].
As the statistics R x and b x are usually unknown, it is necessary to stochastically approximate them by means of: Substituting equations (9) and (10) in (6), one obtains In this way, by means of the stochastic gradient technique, one obtains the following update equation: which is described in Algorithm 1.
end for 7: end procedure In the context of distributed adaptive filtering, it can be described as a degenerate case in which the update of the adaptive algorithm occurs in a single node. If necessary, the size of the learning factor β can be selected to vary with time, so that the new sequences (in the form β(k)) obey the following rules simultaneously 1 [10,18]: However, these sequences slowly converge to zero, in addition to decreasing when k → ∞, interrupting the adaptation process [18]. For this reason, we will adopt in this work a constant learning factor β. In order to deepen the performance analysis of the LMS algorithm in cooperative networks, it is necessary and relevant to perform an analysis of the Mean Square Deviation (MSD) metric. In Expression (12), w(k) approaches w ⋆ as time elapses. Formally speaking, we can not assert that w(k) tends to w ⋆ , because convergence is impossible due to the ubiquitous presence of additive noise (or measuring) ν(k) [20].
It should be noted that the LMS algorithm can also be derived by means of a methodology complementary to the stochastic gradient strategy. Such a methodology employs a deterministic optimization problem whose solution is exact (without resorting to approximations). Thus, we have the following linear constraint optimization problem: where e p (k) is known as posteriori error, being defined by which evaluates the error of the linear prediction performed on the data pair {d(k), x(k)} after the update generated by this same pair of data [9]. The cost function F w(k + 1) in (14) penalizes solutions w(k + 1) too far from the current vector w(k). Such a bias is important because w(k) incorporates information from many previous data pairs, and therefore it is unlikely that only a pair of data {d(k), x(k)} will be able to provide a solution that is very divergent from the current one. This conservative principle, however, is not enough to specify the new vector of adaptive coefficients w(k + 1). This requires the specification of the linear constraint (14), whose locus is a hyperplane to which w(k + 1) must belong (note that the posteriori error is a linear function of w(k + 1)). Geometrically, the intersection of this hyperplane with a sphere specifies the solution w(k + 1). As a consequence of this result, the sphere becomes the one with the smallest radius (due to the principle of minimum distortion implicit in the definition of F w(k + 1) ).
The use of the Lagrange multiplier technique allows us to rewrite (14) equivalently as which is an unrestricted problem whose solution coincides with that of (14). For the minimization of (16) to take effect, it is necessary to set its gradient with respect to w(k + 1) to zero, which, after some manipulations, gives us: In order to finally arrive at the LMS update equation -see Eq. (12) -it is necessary to prove that λ 2 = βe(k), which can be easily proven by applying (17) to the linear constraint of (14). For simplicity, we omit the details.
The energy of the deviation vectorw (k) is measured by the MSD metric, and the definition of which is given by The MSD is an important performance metric, as it measures the size of the deviation variation E w(k) 2 over the iterations [21]. It is widely known in the literature that small values of the β learning factor engender better performance (i.e., a lower MSD) in the steady state [10,18], and consequently a greater probability of finding small values (in magnitude) of the error e(k).
In this case, assuming β is small and some common hypotheses in the literature [12], we can conclude that where σ 2 ν is the additive noise variance. It is worth noting that (20) corresponds to the non-cooperative mode of operation; i.e., the metric of equation (20) denotes the MSD value individually measured on a node that autonomously implements the adaptive algorithm of [18].
The convergence rate r of E w(k) 2 towards the permanent regime is often measured by [10,18,21]: As can be seen, (21) is explicitly dependent on the lower eigenvalue λ min of R x ; the lower the value of r ∈ (0, 1), more faster will be the convergence.
Taking the mean over all nodes (and assuming that the measurement noise variance is the same for all nodes), we can rewrite equation (20) as Note that (22) corresponds to the performance of the nodes in a non-cooperative network topology [18]. Equation (22) allows one to observe that the average MSD is proportional to noise-node variances. However, as network nodes observe the growth of data transmission under the same model w ⋆ , it is natural that cooperation between nodes is beneficial to the network with respect to data metrics or estimators [18]. Section 3 emphasizes that, in the context of diffuse adaptation, Eq. (12) is fundamental for elaborating alternative strategies [10]. 18

Diffuse Adaptive Filtering
Among the modalities of cooperation and exchange of information, the diffuse mode has gained prominence in relation to the incremental and consensus strategy, since it presents superior performance in terms of traceability, convergence rate and stability [10,18,19]. Distributed strategies require the modeling of features associated with the processing, aggregation, and diffusion of information through graphs that are used to generate local interactions between neighboring nodes and allow greater resilience to failures [10]. They have attracted great interest because of their ability to provide organizational models capable of achieving high levels of performance through the use of local adaptive dynamics [22]. The effectiveness of any distributed model will depend on the mode of operation between the nodes [23]. As a result, we will start by describing the network (Section 3.1) and data models, and then proceed to the ATC model of cooperation in networks (Section 3.2).

Network Model
Consider a network composed by M nodes, endowed with computational capabilities. The interconnections are modeled by means of edges and vertices (nodes). The edges represents the bidirectional exchange of information between nodes [18]. The neighborhood of a node is defined as N i , that represents the set of nodes connected to the i-th node, including itself. An undirected graph is assumed, so that if the i-th node is a neighbor of the j-th one, then the j-th node is also a neighbor of the i-th one [18]. A node may have several neighbors connected by means of edges, as described in Figure 2. The purpose of the network is to estimate in real time, and in a distributed manner, the minimizer of the cost function [18] of dimensions N × 1, where these individual costs can be distinct across the nodes or they can be identical [18]. We are interested in a real-time distributed estimation of the optimized parameter vector w ⋆ , which relies on local interactions between nodes.

Data Model
Assume that the i-th node has access to a moving-average model [11]: where ν i (k) represents the noise sample (usually linked to measurement and/or modeling errors) associated with the i-th node at the k-th iteration and contains N consecutive samples of the i-th node input signal.

ATC Strategy
The ATC technique uses a data aggregation step that allows the incorporation of information collected from local neighbors into the adaptation mechanism, described mathematically as where c ij is the combination of the coefficients. Index j indicates one neighbor node attached to the i-th node and N i indicates the set of neighboring nodes of the i-th sensor. Figure 3 depicts the block diagram of the ATC strategy.
In cooperative diffusion mode, nodes exchange their local estimates with neighbors and incorporate the estimates collected through linear combinations. These are commonly called in the literature as Constant Combined Weights [24,25]. There are some common choices for selecting such weights in a network composed of M nodes. Many of these techniques are originally derived from graph theory [25].
Among the techniques that can be used, the Metropolis rule [19,25,26] takes the form presented in Expression (28).
where max |N i |, |N j | indicates the maximum cardinality of the neighborhood of i and j. The Laplacian rule [19,27] is given by equation and C is the combination matrix of the dimension coefficients [a kl ], In the case of the nearest neighbor rule [19,28], the combination coefficient c ij is denoted as follows The combination coefficient c ij must satisfy The term diffusion is employed because the intermediate state ψ i (k) allows data to spread across the network, bringing the i-th node information beyond its neighborhood [18]. Algorithm 2 synthesizes the ATC-based classical LMS algorithm. for For each k instant, each node i do 3: end for 6: end procedure 4 Reuse Coefficients Technique One of the main obstacles to the estimation process of an adaptive filtering algorithm is the measurement noise. The fact that it is not zero implies that its variance increases the variance of the adaptive estimator, and hence its mean square deviation. Particularly, in situations where signal-to-noise ratio (SNR) is low, the identification process may be severely impaired. One way to mitigate this problem is to use the coefficient reuse technique (RC) [29], which changes the principle of minimum distortion, taking into account the minimization of a weighted sum of the distances of the new solution vector to the last L solution vectors.
Typically, algorithms with coefficients reuse adopt a normalized update term, giving rise to the RC-NLMS algorithm and its variants, which can present a reuse factor and/or a time-varying learning factor [30,31]. More recently, reference [32] detailed how to obtain a non-normalized algorithm that employs the RC technique.
In this section, we will extend the RC technique to the domain of diffuse adaptive filtering. This extension will be useful when measuring noise (which, we may recall, can incorporate modeling errors) has a high variance, resulting in a better steady-state performance.
Unlike the traditional LMS algorithm, which minimizes the MSE cost function, the NLMS algorithm minimizes the following cost function [32] whose minimization result can possibly differ 2 from the MSE ξ(k) E e 2 (k) , where e(k), is defined in Section 2 as The RC-NLMS algorithm is usually derived using the Lagrange multipliers technique. Consider the following optimization problem: where ρ ∈ (0, 1] and L ∈ N are parameters at the discretion of the designer that regulate the reuse intensity, e(k) is defined by and θ(ρ) can be expressed as The optimization problem (35) can be converted into an equivalent one by the Lagrange multipliers technique, so that we can solve (35) by means of min where λ is the Lagrange multiplier. To minimize (38), we can find the vector w(k + 1) which zeroes the gradient: or, equivalently: The insertion of (40) in (35) allow us to find λθ(ρ) 2 : so that the update equation of the RC-NLMS algorithm is described by The update equation (42) specifies an adaptive filtering algorithm with a normalized update. As this work focuses on nonnormalized algorithms, it is necessary to design an algorithm incorporating coefficient reuse without normalization. This was done recently in [32], an article that proposed the following optimization problem: whose solution gives rise to the update equation of the RC-LMS algorithm 3 [32]: Note that both update equations (42)-(44) were derived using the Lagrange multipliers technique, rather than stochastic gradient. This means that if we want to insert the coefficient reuse technique into the diffuse adaptive filtering algorithms, we must first obtain them by a similar procedure. This work, as described in the previous section, focuses on the ATC algorithm [10]. In the case of ATC, we can interpret its adaptation equation (prior to the combination) as the resolution of the following optimization problem: min whose resolution gives rise to the well-known adaptation equation: It is known that the MSD has a tendency to increase when the noise variance is large [8,33]. This impact is usually overcome by the adoption of coefficient reuse (RC) [31]. The main objective is to propose the minimization of the weighted sum of the square Euclidean norm of the difference between the updated coefficient vector and the L vectors of previous coefficients. The minimization is subject to a linear constraint on the new solution w(k + 1) [29]. Such a method has the advantage of reducing the steady-state MSD with minimal impact at the convergence rate [34]. Therefore, we chose to employ time-varying reuse factors. These allow for a low reuse factor in the transient (thus avoiding losses to the convergence rate) and an intense utilization of coefficients reuse in steady-state. Overall, this contributes to a performance improvement in this region of operation.

IEEE 802.15.4 Standard
It is expected that the addition of protocols traditionally associated with the telecommunications area, the estimation process will integrate more reliable characteristics in real WSN scenarios. These characteristics will be discussed in the following subsections.

Overview
The architecture of the LR-WPAN (Low-Rate Wireless Personal Area Network) standard is structured in three blocks: PHY (Physical), MAC, and Upper Layers. The interfaces between the blocks serve to define their logical connections. Each LR-WPAN device needs at least the PHY layer, which contains the radio frequency transceiver, a low-level mechanism, and the MAC sublayer that provides access to the physical channels for all types of transfers. The upper layers provide support for network configuration, message routing, and the application layer which is responsible for the specific function of the device [7,35,36].

Energy Structure
Typically, the sensors that make up a network are powered by batteries, whose amount of power is limited. In this way, monitoring the energy usage and the useful life of the network become important metrics in WSN. In order to support simulations involving different forms of energy, NS-3 provides some models of power consumption for network devices. The models represent the energy sources connected to the nodes, and can assume linear characteristics 4 , or nonlinear ones 5 [37]. Since WSN are characterized by a very low transmission cycle, some articles on microsensors denote that the greatest energy expenditure is in the transitions of the radio between one state and another [38,39]. In this way, the energy model used in this work takes into account the transition time and the energy between the transceiver states, which are presented by a state machine of the physical layer depicted in Figure 4. This representation will serve as a computational template for the network lifetime. The metrics employed, namely, stable state power, transient time, and power measurement consider the information extracted from the transceiver device datasheet CC2420 (40), which is compatible with the IEEE 802.15.4 network standard.
In order to have access to the average node consumption, it is necessary to trace the instantaneous power consumption when transitions between transceiver states occur. Among the transitions that can occur at the physical level, we are particularly interested in the end-of-transmission and reception operations, respectively defined as BusyTx → TxOn and BusyRx → RxOn (Figure 4). Each tracked event will be recorded in an array where we will indicate line by line each operation being performed, namely: t (transmission), r (reception) and d (drop); the index of each node of the network n id , the end instants of each transition and the final energy level e f and previous e i . The energy attributes are measured in Joules. This is in accordance with the model of the basic-energy-source simulator [41].
Each network event mentioned in Figure 4 is associated with an energy level, the efficiency of which is associated with the type of transceiver to be used [42]. For most transmitters, there is no difference between the On and Busy states with respect to the transceiver circuit [42]. The level of energy consumed in each state depends on the current and time spent. This information can be extracted from the datasheets of the electronic elements, such as the transceiver radio CC2420: The lifetime of the network is calculated as soon as the power of the node assembly is completely dissipated, making more transmissions an impossible task. This method is ensured through a frame transmission replaying structure as e f > 0, using the lr-wpan-radio-energy-model 6 .

Shared Medium Protocol
The IEEE 802.15.4 standard can employ two mechanisms to increase the likelihood of success in data transmission [7], they are: ALOHA and CSMA/CA. In what concerns access to the shared medium, our emphasis will be placed on the CSMA/CA mechanism (Carrier Sense Multiple Access with Collision Avoidance). Its adoption is well established and its characteristics are well known [43][44][45]. Fundamentally, the CSMA/CA protocol is capable of identifying multiple carrier accesses to avoid possible collisions.
Only one node of the network is allowed to transmit information at a given instant. All nodes in wireless applications must compete through the medium using the CSMA/CA mechanism. As a result, a node that has an information to be sent should map the channel and check if it is free. If the channel is free, the information is transmitted, otherwise it should queue the request and continue mapping until it becomes free for a new request.
This work considers the realistic network behavior of the CSMA/CA, and evaluates the impact of the shared medium dispute on the proposed distributed adaptive filter.

Spatial Diversity of Information
The aggregation of data in a network is fundamentally important for solving distributed inference problems in several fields of science [18,46]. In sensor network contexts, where the energy cost of communication is often greater than the energy cost of computing, and energy resources are limited, methods such as directed diffusion can achieve significant energy savings through the use of data aggregation identified by attribute/value pairs [47]. Thus, only nodes that have data that match the criteria of interest can forward the information to the nodes [47]. These benefits have been theoretically [48] and experimental [49] proven.
In the context of social networks, for example, it is said that social relations between individuals can affect the economic development of the community [46]. Although the correspondence between network diversity and social and economic wellbeing has not yet been quantified in general, recent studies [46] have shown the existence of a relationship between the composite measure of diversity and the socio-economic percentile. Namely, it has been shown that social networking diversity is a strong signature of economic development .
In the area of network security, privacy is often guaranteed by encrypting the source data before propagating the signal to the environment [50]. This area of science is called the security encryption methodology and is usually implemented at the application layer of the network. However, these methods may experience cryptographic attacks because unauthorized nodes are under the same coverage area. In this sense, many studies have been intensifying network security studies in the physical transport layer, by allocating intermediate nodes distant from a possible network invader but still near the signal source [50,51]. In this way, many intermediate nodes can safely decode the source signal, and then form a beam that hides the wanted signal from a possible intruder. This contributes to maximizing the secrecy of the information in the destination [50,52].
As mentioned in previous paragraphs, the spatial diversity of information has been the object of study in several areas, bringing various contributions to the scientific community. In the following sections, we will formulate two algorithms that are aware of the characteristics of an WSN, namely: (i) the ATC algorithm with coefficient reuse, whose purpose is to reveal the credibility of the most recent information in detriment to older information in a distributed context; and (ii) the diffuse VRC-LMS algorithm. The latter of which has a ̟ l,k parameter. This was incorporated so that nodes that contemplate a greater diversity of spatial information in the neighborhood will have more credibility for the distributed inference process, when compared against nodes imbued with less spatial diversity of information.

Proposal of an ATC Algorithm with Reuse of Coefficients
First, the ATC update process needs to be adapted in the derivation paradigm of adaptive filtering algorithms. This is done through the solution of a deterministic problem. Subsequently, we can insert the technique of coefficients reuse, through the definition of the following problem 7 : Using the Lagrange multiplier allows for the minimization of (47) by finding the minimum of the following cost function: The minimization of (48) can be performed by zeroing its gradient with respect to ψ i (k + 1), that is so that the following identity may be established Applying the constraint of (47) to (50), it is possible to get the value of the Lagrange multiplier λ: Substituting λ into (50) (using (51)), one obtains This equation describes the update of the proposed RC-LMS algorithm (in the ATC modality). When the measurement noise presents high energy, the oscillations of the adaptive estimator contribute to increase the MSD, which can be critical in several applications [31]. In this case, the insertion of the coefficients reuse (as described in (52)) can improve the performance in the permanent regime. Notice that parameter L allows for controling the magnitude of reuse. More specifically, the higher the value of L, the greater the reuse (and therefore better performance in steady state). Parameter ρ ∈ (0, 1] in turn, regulates the weight given to more recent vectors, so that a value of ρ near 1 gives equal importance to L previously estimated vectors (i.e., w i (k − l) to l ∈ {0, 1, . . . , L − 1}, while values of ρ closer to zero give little importance to vectors w i (k − l) that are more distant with respect to time.

VRC-LMS Algorithm
The previous subsection presented a new algorithm that inserted the RC methodology in the ATC method. However, such a proposal does not consider the characteristics of the communication protocol. In order to derive a protocol-aware distributed adaptive filtering method, it is necessary to note in the first place that in a context of shared medium access, not all of the transmited information will arrive to the nodes within range. This is due to package loss, which may be a result of collisions. In the following, a more sophisticated version of the proposed RC-ATC-LMS algorithm is advanced, which is aware of the packet loss phenomenon.
An undesirable feature of the RC-LMS algorithm is the reduction of the convergence rate [53]. Reference [30] compensated this behavior between the MSD and the convergence rate through the dynamic adjustment of the reuse order L(k), which can be incorporated into the diffuse context as follows: so that the limit η is chosen according to the MSE of the theoretical steady state of the algorithm LMS [54], with constant β. In order to derive the update equation of the VRC-LMS algorithm, the proposed problem starts by minimizing the following equation: where s i,k L−1 l=0 ρ l ̟ l,k . In the k-th iteration, the i-th node uses a time-variant reuse factor equal to L i,k . Thus, L i,k previous vectors w T i (k − l) (for l ∈ {0, . . . , L i,k − 1}) are taken into consideration. Our proposal consists in weighting each one of these vectors by a factor ρ l ̟ l,k , which consists of a product of two terms.
Assuming a parameter ρ < 1, the first of these terms (ρ l ) gives greater weights to more recent vectors, which are assumed to carry more reliable information. In the particular case where ρ = 1, such a term gives equal credibility to each of the L i,k vectors in the past. The adoption of this factor (ρ l ) is typical in coefficient reuse algorithms [31].
However, in the context of distributed adaptive filtering aware of shared access characteristics of the environment, one knows that vector w T i (k−l) is calculated by a combination of |N i,k,l | vectors, where the neighborhood cardinality |N i,k,l | is time variant due to the fact that packet loss is stochastic. Vectors w T i (k − l) whose neighborhood presents more cardinality are more reliable, as they aggregate more information in spatial terms. That motivates the proposal of the second term (̟ l,k ), which emphasizes contributions of vectors that contain greater spatial diversity of information. It is worth emphasizing that the insertion of such a term is another contribution of this work.
Since the i-th node in the k-th iteration reuses L i,k previous vectors w i (k − l), we define the largest value of neighborhood cardinality in this time window (with L i,k vectors) as Thus, using ̟ max i,k as the denominator of normalization, we propose that the weighting related to the amount of aggregate spatial information is defined by Therefore, the weighting factor associated with vector w i (k − k) is given by After replacing the weighting factor (58) in equation (52) and adjusting the L vectors to be variant in time, that is, the algorithm starts to reuse L i (k) vectors, additionally, substituting θ(ρ) by 1 s i,k in (52), the update equation from diffuse VRC-LMS algorithm can be denoted as: 7 Simulation Structure and Results

Simulation Set-Up
The general simulation functions are illustrated in Figure 5 which are divided into: (1) LR-WPAN model: divided in PHY, MAC, positioning and energy; (2) Simulation: generates the necessary files for proposed algorithms; (3) Proposed Algorithms: block where the simulation data is delivered as input data for the distributed VRC-LMS and RC-LMS algorithms; (4) Metrics: responsible for generating comparative performance charts.
The positioning model has the task of allocating node positions in a given area. In this model, we consider that the position of the nodes must be randomly allocated within a disk area. The respective control attributes are: random variable ρ, X and Y. The PHY model tracks physical layer transitions (i.e.,the state machine of Figure 4) namely BusyTx → TxOn and BusyRx → RxOn. These correspond, respectively, to the end of transmission and reception. Associated with the transitions of the physical layer is the energy calculation. The energy model is responsible for making the product between the time spent and the energy level of each state. This calculates the amount of energy spent by a transmission or reception in the physical layer incorporating features of the CC2420 device (40). The energy model also calculates the network lifetime, which corresponds to the time required for the energy of all nodes to reach zero (at which time the simulation is terminated).
The MAC Model performs all the operations of the second network layer, that is, all the results from the media access control performed by the CSMA/CA protocol. Through a Trace tool (also shown in Figure 5), the MAC sublayer events are tracked. 26 These are structured through a matrix composed by S lines and m columns, with {n = 1, . . . , 5} and m → ∞. The data in the first column corresponds to the operating mode op id of the physical layer at the given instant, where the value may vary between t (transmition), r (reception) and d (drop). The second column corresponds to time instant T, in seconds, where the operation of the first column is running. The third column corresponds to the node index n id , whose operation is being carried out. The fourth column indicates the sequence number of the frame being transmitted, received or that has been dropped (drop). Often in networks, the data stream is not ordered, so the sequence number guarantees the reconstruction of the information in the recipient. Through this method, we can consider whether a frame is older or newer. Finally, the fifth column indicates the physical address associated to the communication interface of each node. This address is unique and registered in hexadecimal format, i.e., no two devices have the same information. In the block where the proposed algorithms act (shown in Figure 5), a function called readDataTrace was created, whose role is to read the data from matrix S. A second function called extractInformationLine, is responsible for importing the reference data into the algorithms.

Results
We consider that all nodes are within the range of communication, that is, they are positioned in a geographical area so that all devices can communicate with each other. Accordingly, the positioning model is configured so that the nodes are located in radius circle equivalent to 50 m. In the following sections, we will evaluate the performance of the proposed algorithms by combining adaptive filtering and telecommunications metrics. The results will be presented through a table containing the summarization of the main network attributes presented after the simulation in NS-3. The attributes list contains: number of collisions, transmissions and receptions, number of nodes, average frame size, network life (which corresponds to the end of simulation after the energy level of all nodes reach zero), transfer rate and energy level of nodes. Performance comparisons between the RC-LMS algorithms distributed in the ATC mode will be presented, and the VRC-LMS algorithm will be aware of the characteristics of a WSN.

Scenario 1
The first scenario consists of a network containing 20 nodes, according to Figure 6. In this scenario, we verified the performance of the RC-LMS distributed algorithm in the ATC mode and the VRC-LMS algorithm using the following adaptive filtering parameters: RC-LMS with L = [1, . . . , 4] and VRC-LMS with L max i = 4. The other parameters are applicable to both algorithms: β = 10 −1 , ρ = 0.9, σ 2 ν = 10 −6 , w * (z) = 1 − 0.8z −1 + 0.2z −2 . The results were obtained through a single network experiment in NS-3, that is, the simulation of the LR-WPAN Model runs out one time and results are printed into the trace tool, which we may refer as the NS-3 domain simulations. These results are carried out to the proposed algorithms, which are optimized through 200 independent Monte Carlo attempts. Metrics are represented in Figure 7. As for the network parameterizations, we summarize them in Table 1.
In this point-to-point topology, we ensure that all nodes are under the reach of each other. The communication method in this case consists of each node sending 40 bytes of information to the broadcast address, with a 100 ms interval between each transmission, that is, maintaining a transfer rate of approximately 3.2 kbits/s. The goal is to get the message sent by a node to be received by the other nodes in the network. Because the transmissions are broadcast to all nodes in 100 ms intervals between each send, we will call this intercalated broadcast scenario. It can be seen that the performance of the VRC-LMS algorithm (yellow solid curve) shows a convergence rate in the transient close to the RC-LMS case in the ATC mode with L = 1 (corresponding to the traditional LMS algorithm), and a performance in the steady state above the other cases of the curves of the RC-LMS algorithm in the ATC modality with L = [1, . . . , 4]. Since the VRC-LMS algorithm adopts the use of L max i , a possible loss of the convergence rate in the transient is compensated by a reduced reuse of coefficients. Consequently, a higher reuse of coefficients in the steady state results in improved performance of the MSD. Due to the configuration of the network parameters summarized in Table 1, this scenario does not include many collisions because it does not present shared medium saturation. In the next scenario, we will explore a case of greater channel utilization by reducing the window between one transmission and another, while maintaining the average frame size, network topology, number of nodes, and power level.

Scenario 2
Scenario 2 uses the same adaptive filtering specification as Scenario 1 with the same network topology. However, in order to explore a possible channel saturation, we reduced window time between one transmission and another to 50 ms, which generates a transfer rate approximately twice as large as the first scenario (≈6.4 kbits/s).
In the Figure 8, for L = [2, . . . , 4], we have a slower convergence rate in the transient, coupled with a more stable performance in the permanent regime. As in Scenario 1, through the adoption of L max i , the VRC-LMS algorithm compensates for a possible 27   The remaining attributes are applicable to both algorithms: β = 10 −1 , ρ = 0.9, σ 2 ν = 10 −6 , w * (z) = 1 − 0.8z −1 + 0.2z −2 . The network topology also follows the allocation illustrated in Figure 6.
Differently from the previous scenarios, we have changed the transmission method, in which all nodes simultaneously transmit to the broadcast address. As in Scenario 2, since the algorithm that holds the access control to the channel is saturated due to many requests, we intend to increase the number of collisions in order to evaluate the performance of the proposed algorithms. Therefore, we will call this scenario as the simultaneous broadcast. Table 3 summarizes the network parameters. One can readly see that the number of collisions is greater than the number of successful transmissions. In addition, we kept the information transmission rate at 3.2 kbits/s, average frame size at 40 Bytes, power level and number of network nodes is similar to previous scenarios. In Figure 9 we can see the evolution of the MSD curve, which has a behavior similar to Scenario

Scenario 4
In this simulation set-up, the number of nodes is increased to 50 (see Figure 10) and the average frame size is restricted to 40 bytes, with a transfer rate of 3.2 kbits/s. The adaptive filtering parameters used were: RC-LMS with L = [1, . . . , 4] and VRC-LMS with L max i = 4. The other attributes are applicable to both algorithms: β = 10 −1 , ρ = 0.9, σ 2 ν = 10 −6 , w * (z) = 1 − 0.8z −1 + 0.2z −2 . The results were also obtained through a single experimental network realization in NS-3, while the results of the proposed algorithms are the result of 200 independent Monte Carlo attempts. It is worth to make a parallel between the evolution curve of MSD versus the number of iterations shown in Figure 12 and the collision dispersion presented in Figure 11. In the abscissa axis of the Figure 11, we have the time scale in seconds, and in the coordinate axis we have the number of collisions. We can see a concentration of collisions between (100, 200). Both parameters proposed in this work contribute to the inference process: L max i contributes to a more vertiginous rate of convergence in the transient allied to a better performance in the permanent regime by increasing the coefficients reuse. ̟ l,k contributes to the use of spatial information diversity. Namely, the high number of collisions contributes so that more nodes have less relevant information for the estimation process. In this way, the performance of the solid curve in yellow presented similar learning to the case of the RC-LMS algorithm in the ATC modality with L = 1 (red solid curve) in the transient, and a superior performance in the permanent regime. In addition, it is noticed that, although the signal-to-noise ratio has increased (due to the number of collisions), there was not a large deviation of the MSD that compromised the stability of the learning process of the algorithm.

Conclusions
Adaptive filtering algorithms typically have robust self-learning ability and tracking features. Due to these characteristics, they have been applied in several problems, especially when the statistical characteristics of the signal under study are not known or are time-variant. This paper incorporates features derived from realistic behaviors that occur in communication processes into the design of a distributed adaptive identification algorithm. Namely, when the information is delayed, which may happen due to collisions or other network effects, older information becomes less reliable, which permits one to adopt a reuse of coefficients based on the current characteristics of the network. This premise allowed a more intense reuse of recent information in the context of diffuse adaptive filtering, whose implementation is one of the contributions of this work. Also aligned to WSN scenarios, we adopted a coefficient of spatial diversity, in order to add the estimates of network sensors in the neighborhood. This term had not been used yet within the VRC-LMS algorithm in the literature.
The distributed adaptive filtering methods with coefficients reuse incorporate the dispute for the shared medium considering a more realistic fashion. This was done through the NS-3 simulator. To the best of our knowledge, this is the first time that such a method is discussed. We ran simulations, varying several network parameters, and the proposed method outperforms the traditional ATC distributed LMS algorithm.