key: cord-0138045-p9eranox authors: Jing, Dongliang; Li, Yongzhao; Eckford, Andrew W. title: An Extended Kalman Filter for Distance Estimation and Power Control in Mobile Molecular Communication date: 2022-05-19 journal: nan DOI: nan sha: 0efacd5aa6239957ed827371a0d601fb7981d3d5 doc_id: 138045 cord_uid: p9eranox In this paper, we consider a mobile molecular communication (MC) system consisting of two mobile nanomachines, a transmitter and a receiver, propelled by a positive drift velocity and Brownian motion in a realistic blood-vessel-type flow regime. Considering the nonlinear movement of the nanomachines, an extended Kalman filter is employed to estimate the distance from the transmitter. Furthermore, based on the predicted distance, to keep the number of received molecules for bit 1 at a stable level, we employ power control on the number of transmitted molecules based on the distance between the transmitter and the receiver and the residual molecules in the channel from the previous transmission. Finally, the optimal detection threshold is obtained by minimizing the error probability. It is verified that a fixed optimal detection threshold can be effective for the power control scheme in the mobile MC. The bit error rate (BER) performance of our scheme is verified via simulation results. In molecular communication (MC), molecules are employed as information carriers, where information can be encoded by the concentration of molecules, the type of molecules, or the the time of release of the molecules. Aside from its role in nanonetworking and and potential nanomedical advances [1] , [2] , MC has been employed to model the spread of infectious diseases via aerosols during the COVID-19 pandemic [3] , [4] . In many proposed applications of MC, transmitters and receivers are mobile, and are assumed to move using Brownian motion [5] , [6] , a situation known as mobile MC. In this direction, previous work has considered systems both with and without flow: in the former case, work has considered channel modelling [7] , mobility in the presence of flow [8] , and analysis of multiple-source interference and inter-symbol interference (ISI) [9] ; in the latter case, work has analyzed mobile transmitters and receivers [10] and the impact on mobility of channel impulse response [11] . In all of these examples, mobile MC presents an extremely challenging communication environment due to the time-varying distance, which governs the system's signal strength and ISI. With knowledge of distance, mitigation techniques can be adopted: various methods have been proposed to mitigate ISI, such as modulation/coding methods [12] , [13] , detection methods [14] - [16] , or both of them [17] , [18] . In [19] , a diffusive mobile MC system is analyzed, where the initial distance at the beginning of the block is used as "outdated" channel state information. Power control can also be used as a mitigation strategy for both varying signal strength and ISI [20] , [21] . In [20] , to mitigate ISI in static MC, the authors adjust the number of transmitted molecules based on the number of residual molecules in the channel. In this paper we focus on power control, and the distance estimation that is required to adopt a power control strategy. Conventional approaches to distance estimation include detecting the peak of the channel impulse response [22] , [23] , jointly estimating distance alongside other parameters [24] , [25] , pilot symbols [26] or feedback [27] . Alternatively, nanomachine localization methods are proposed in [28] - [31] , making the position of the nanomachine known, whether that knowledge is exact or noisy. In [28] , considering ringshaped observing receivers, the location of the transmitter is analyzed in a vessel-like environment for diffusion-dominated motion. In [29] , considering the two-dimensional diffusionbased molecular communication, four localization schemes based on trilateration method are proposed in various scenarios. In [30] , considering a three-dimensional diffusion-based molecular communication system and a transparent, spherical receiver, the transmitter is localized when the locations of the receivers are both known and unknown. In this paper, we use the assumption of localization, i.e., that the terminals have imperfect knowledge of their own position. In static MC, the distance estimation problem reduces to communication, as each terminal may transmit its information to the other. However, this is not the case in mobile MC, where there are two important complications. First, communicating the distance takes a significant amount of time, and the terminals may move in the meanwhile. Second, the realistic flow velocity may depend on the location of the terminals: in particular, in a blood vessel, nanomachines placed at different distances to the center of the vessel will experience different flow velocities [32] . This situation is critical for future nanomedical applications. Addressing these problems, we derive and employ an extended Kalman filter to predict the distance between the terminals, taking into account the location-dependent flow and noisy knowledge of each terminal's position. We then apply the predicted distance to a power control scheme, which improves the performance of mobile MC by adjusting the signal strength and reducing ISI. Compared with [20] , in this paper we control the number of transmitted molecules based on the distance between the transmitter and receiver, which varies with time. The main contributions of this paper are: • We derive and use an extended Kalman filter to predict the distance between the transmitter and receiver, and show that this algorithm has excellent performance in our realistic propagation model. We also show that the computational complexity are is within the expected capabilities of MC systems. • Based on the Kalman-predicted distance, we control the number of emitted molecules based on the distance between the transmitter and receiver and the residual molecules in the channel to keep the number of received molecules at a stable level for bit 1. The optimal detection threshold is derived by minimizing the error probability. • We show that a distance-based power control scheme can keep the optimal detection threshold nearly constant with respect to the distance, thereby simplifying detection and improving performance. The remainder of this paper is organized as follows. In Section II, the system model of the mobile MC system in narrow channels, such as blood vessels, is introduced. In Section III, the distance between the mobile transmitter and the receiver is derived. In Section IV, the extended Kalman filter is introduced for distance prediction. In Section V, the optimal detection threshold is analyzed by minimizing the error probability. In Section VI, a power control scheme is proposed and the performance of bit error rate (BER) is analyzed. In Section VII, simulation results are given which demonstrate the performance of our extended Kalman filter approach and the power control scheme. In this paper, we consider a nanomachine-based MC system consisting of a mobile transmitter and mobile receiver inside a 3-dimensional (3D) fluid medium. As shown in Fig. 1 , we consider a narrow cylindrical tube as our propagation environment; motivated by nanomedical applications, this environment is a simplified representation of a blood vessel. (A true blood vessel would have additional complications, such as obstacles in the form of blood cells, which we do not consider in this paper.) The medium is assumed to have constant temperature and constant viscosity. The transmitter and receiver, depicted in the figure, are modeled as spheres with radius r tx and r rx , respectively. To convey the intended information, signal molecules are released from the center of the transmitter and propagate to the receiver via Brownian motion with flow; moreover, at the same time, the transmitter and receiver are mobile, and move within the medium by Brownian motion with flow. The diffusion coefficients of the transmitter, receiver, and signal molecules are D tx , D rx , and D m , respectively. We assume the fluid stream in the vessel is free of turbulence, which would be the case for a blood vessel far away from the heart. Therefore, the pressure and velocity at any position can be assumed to be constant over time [33] , [34] . Furthermore, there exists flow only along the axis of the vessel, which we define as the x direction. Thus, in the x direction, the nanomachines are affected by Brownian motion and flow, while in the y direction and z direction, the nanomachines are affected only by Brownian motion. The velocity profile of the laminar flow was shown to have a parabolic shape, modeled by the well-known Hagen-Poiseuille equation, derived from the Navier-Stokes equations [35] : where κ is a constant, which varies with pressure in the per unit length and can be expressed κ = ∆p L (in which ∆p is the change in pressure along a vessel section of length L). Moreover, r is longitudinal distance of the vessel, v (r) is the velocity profile, R v is the radius of the vessel, and µ is the fluid viscosity. The velocity profile varies with the distance to the center of the vessel, an example of which is shown in Fig. 2 . As can be seen from the figure, the maximum velocity is achieved at the center of the vessel and decreases with increasing distance from the center of the vessel. It is assumed that the mobile transmitter and receiver perform independent random walks with initial locations L 0 tx = (X 0 tx , Y 0 tx , Z 0 tx ), L 0 rx = (X 0 rx , Y 0 rx , Z 0 rx ) and average drift velocities v 0 tx , v 0 rx , respectively. (Note that the drift velocity is a scalar, since the only drift is in the x direction, and that drift velocity is a function of Y and Z.) After k steps, the transmitter's location is denoted as L k tx = (X k tx , Y k tx , Z k tx ) and velocity as v k tx (and similarly for the receiver, with rx in the subscript). The transmitter sends information bits b tx = [b tx,1 , b tx,2 , ..., b tx,k ] to the receiver, where b tx,k ∈ {0, 1} denotes the information bit in the kth bit interval. An on-off keying (OOK) modulation scheme is employed to transmit the information bits: at the beginning of the kth bit interval, the transmitter releases either N tx molecules to transmit symbol 1, or zero molecule to transmit symbol 0. On the receiver side, in this paper we consider a passive receiver which is commonly assumed to be transparent, so that the molecules can enter and leave the receiver via free diffusion. The receiver nanomachine can sense molecules once the molecules arrive in its observation volume, but it does not affect the diffusion of the molecules in any way. Therefore, the receiver does not affect the flow in the channel. What is more, the effect of the receiver on the flow in the channel is commonly ignored, see e.g. [36] . To detect a bit, the receiver senses the number of molecules within its observation volume to determine whether bit 0 or bit 1 is transmitted. If the number exceeds the pre-set threshold, the information is decoded as bit 1; otherwise, bit 0 is decoded. In this paper, for simplicity, we consider the dispersion regime described in [32] , described as follows. Let v eff be the mean velocity of the fluid, expressed as: v eff = |∂ x P|R 2 v /(8η), where ∂ x P is the pressure gradient, R v is the radius of the blood vessel, and η is the viscosity of the fluid; furthermore, let d k x be the distance between the transmitter and receiver in the x direction during the kth step [37] . Then in the dispersion regime, we make the assumption that Under this assumption, released molecules fully diffuse across the cross section of the vessel while also moving along the x direction by flow and Brownian motion. In this regime, considering the uniform concentration assumption where the distance between the transmitter and receiver is large relative to the largest dimension of the receiver, the channel impulse response can be expressed as [32] , [36] where V rx is the volume of the receiver, and D tot = D eff + D rx , where D eff is the Aris-Taylor effective diffusion coefficient and given by The observation probability is the probability of observation of one output molecule at time t at the receiver when the transmitter is stimulated in an impulsive manner at time t 0 = 0. Simplifying the notation, P k−i+1 for probability of molecules released at the beginning of ith bit interval and observed during the kth bit interval (i < k) (i.e. P 1 denotes the probability of molecules released at the beginning of ith bit interval and observed during the same bit interval). As d k x is a key parameter in (2) , in the next section we focus on the analysis of this distance. In mobile MC, the distance between the transmitter and receiver is an important parameter. The distance varies with time, which also causes the channel impulse response to vary. In this section, we characterize the movement of the nanomachines and focus on the effect on the distance between the transmitter and receiver. Consider a 3D Brownian motion in discrete time, with flow and Brownian motion in the x direction and only Brownian motion in the y and z directions. At time k, the increment in each direction for nanomachine n (n ∈ {tx, rx} for transmitter and receiver, respectively) can be expressed as ∆X k n , ∆Y k n , and ∆Z k n . In our model, we assume that the motion of the nanomachine in the y and z directions affects the flow velocity in the x direction, so we first analyze the motion of the nanomachines in the y and z directions. We assume that the Brownian motion is given by a discrete-time Wiener process, with discrete time interval T . Considering nanomachine n, the increments ∆Y k n and ∆Z k n are (independent) increments of a discrete-time Wiener process, which follows normal distribution, B k n ∼ N(0, 2D n T ), where D n is the diffusion coefficient of the nanomachine. Thus, where Y 0 n and Z 0 n are the initial position in the y direction and z direction, respectively; and where Y 0 n and Z 0 n are independent. In the x direction, the nanomachine is affected by Brownian motion as well as flow, where the flow depends on the longitudinal distance of the nanomachine to the center of the vessel. This distance can be expressed as Therefore, the flow velocity in the x direction of nanomachine n during step k can be expressed as (see (1)). With these definitions, the increment ∆X k n is composed of a Brownian motion component B k n and a flow component where V k n = v k n T , and v k n is given by (6) . The value of v k n is assumed to be constant during the k step. Thus, in the x direction, the position of nanomachine n after k steps, with initial position X 0 n , is given by After time k, the distance between the transmitter and the receiver in the x direction can be expressed as where X k rx and X k tx are the positions of the receiver and transmitter at the kth time slot, respectively, and X k rx is dependent on the sum of squares in y and z directions. Our estimation method uses the extended Kalman filter, which is described in detail in the next section. This algorithm requires feedback of the receiver's position, for which we consider two cases: • With feedback: The position of the receiver nanomachine is encoded and constantly fed back to the transmitter nanomachine using an appropriate feedback method. Such as in [38] , a nanomotor with speed over 310 mm/s is considered, which is much larger compared to the drift velocity within the blood vessel, therefore, the latency can be considered to be low. What is more, in [39] , a photoacoustic computed tomography method is presented to locate and navigate a nanomotor in vivo in real time. Thus, an external method can be employed to feed back the positions of the receiver to the transmitter with real time, and prediction can be employed between position measurements. To simplify our analysis, we assume that the transmitter receives feedback information consisting of the receiver's (time-delayed) position. • With update: The transmitter is aware of the receiver's initial position, but otherwise uses its own estimates as feedback to the algorithm. It should be clear that the case with feedback is a bestcase scenario for the transmitter's knowledge of the receiver's position, while the case with update is a worst-case scenario. Limited feedback may be available in a practical system: several recent papers have explored feedback of receiver positions [39] - [43] , or one-way feedback using kinesins walking on microtubules [44] , [45] , inspired by transport of cargo in eukaryotic cells [46] (for a related experimental technique, see [47] ). With limited, irregular feedback, the performance of an actual system will be between the two feedback assumptions given above. As noted in the introduction, the terminals have a noisy estimate of their own positions in space, and can communicate with each other to estimate their distance. However, as described in Section III, the distance changes with time, and the flow rate depends on the position of each terminal in space. Thus, we need to use the out-of-date observations to predict the actual positions of the receiver nanomachine. These previous positions represent the state variables in our prediction algorithm. Considering (2) , in this section, we mainly focus on the distance estimation in the x direction d k x . Therefore, the position of the receiver nanomachine is predicted and employed to estimate the distance d k x . As positions in the x direction are based on a quadratic equation in the y and z coordinates (see (5)-(7)), the system is nonlinear. Such a problem is ideally suited to an extended Kalman filter, which can be applied to nonlinear problems by locally making a linear approximation algorithm that has been shown to be effective for the state sequences of dynamic systems [48] , [49] . The importance of using an extended Kalman filter is that our framework can be generalized to include more complex features of motion, such as controlled nanomachine motion and viscous friction, which can be investigated in future work. The receiver's state at time k is its location L k rx , that is, consistent with our notation in the previous section. The position of the receiver nanomachine based on the system model in the x direction can be expressed in a difference equation as where (12) follows from (5)- (6) . In the y and z directions, as there is no drift, the position is much more simply expressed as From these difference equations, it is important to note that, firstly, the next location X k rx is in a dynamical relationship with each coordinate in and secondly, that this relationship is quadratic. These features are appropriate for the use of an extended Kalman filter. It is also clear that the process noise w (k) is given by the Brownian , which is a Gaussian random vector for each k, with covariance matrix Q = √ 2D rx T I, where I is the identity matrix. Therefore, the extended Kalman filter estimates the state of the considered mobile molecular communication system modeled by the discrete-time state equation where f is the state transition function which evolves the state given the previous state L k−1 rx . With feedback: The observation models are used to predict the next state of the extended Kalman filter and can be expressed as: where n n (k) is observation noise (for example, the position sensed by the receiver is noisy and inaccurate). Since only the motion is observable, the observation model H is the identity matrix, and the observation is then expressed simply as Z (k) = L rx (k) + n n (k). The observation noise n n (k) is an IID Gaussian process with diagonal covariance matrix R, n n (k) ∼ N(0, R). Deriving the extended Kalman filter in the special case of our problem, from (12)- (15) , the state update is given by a vector equation The state transition matrix of the extended Kalman filter is the Jacobian matrix of f : The Kalman filter is implemented through a pair of iterations, one on covariance matrices (used to calculate the Kalman gain), and one on the estimates and predictions themselves. Each iteration has a predict and an update step. These are described below. For the first iteration, define a pair of iteratively updating covariance matrices: andP (k|k − 1), the predicted covariance matrix, andP (k|k), the state covariance matrix. What's more,P (k|k − 1) associate to the Jacobian matrix of the state transition function F (k), the state covariance matrix P (k − 1|k − 1), and process noise covariance matrix Q. SupposingP (k − 1|k − 1) is given, the predict step is given byP This covariance matrix is used to calculate the Kalman gain K(k), given by Next, the update step is given bỹ which can then be fed back to (21) to complete the iteration on these covariance matrices. For the second iteration, we also define a corresponding pair of quantities related to the underlying position of the nanomachine: the state predictionL k|k−1 rx , and the state estimateL k|k rx . These iterations use the Kalman gain K(k), obtained from the first iteration. GivenL k−1|k−1 rx , the predict step is given bŷ with f (·) given by (17) , and the update step is given bŷ recalling the observation model Z n . This iteration is then fed back to (24) . To complete the specification of the iterative algorithm, we must specify the initial estimate forL 0|0 rx and the initial covariance matrixP (0|0). These are given byL The distance prediction is from the transmitter side and we assume the position of the nanomachine is known to itself. Based on the position in the x direction, we can get the predict distance d k px between the transmitter and the receiver based on the system model: where F = [1, 0, 0]. With update: When there is no physical feedback signal, the transmitter employs the predicted positionsL k|k−1 rx in (24) as the observed states L rx (k) of the Kalman filter in (16) . Therefore, the observation model in (16) is modified to The other steps are the same as the extended Kalman filter with feedback. In the analysis of the computational complexity of the extended Kalman filter, we consider the number of multiplication (Mult.) and addition (Add.) operations performed during the estimation process. For the 3D predicted state and 3D observation vector, the computational complexity of the extended Kalman filter in terms of these operations is given in Table I . In terms of the computational complexity of the extended Kalman filter scheme, our method is comparable to and even lower than other algorithms proposed in the molecular communication literature. For example, filter methods are also proposed in DBMC. Wiener and extended Kalman filter detection methods are proposed for DBMC in [50] . To target tumors in the body, in [51] , a computationally complex gravitational search algorithm and particle swarm optimization algorithm are proposed to locate the tumor. Based on [52] and the rapid development of nanotechnology, it is reasonable to believe that nanomachines can perform moderately complex functions such as the one we propose. We use the sample mean of the error magnitude in order to evaluate and compare the performance of distance estimation. This is given by where e j is the error in the jth time slot. For the extended Kalman filter prediction, e j = d j px −d j x , where d j x is the actual distance between the transmitter and receiver in the x direction during the jth step. V. POWER CONTROL AND PERFORMANCE ANALYSIS Using our distance prediction results, here we derive a power control scheme and the optimal detection threshold, which together ensure high performance for mobile MC systems. We first describe a power control scheme to maintain a constant number of received molecules for transmitted bit 1 even as distance changes. Then, based on the statistical properties of the received molecules and hypothesis testing method, we derive the optimal threshold, and finally we conduct a probability of error analysis for the system. As the number of received molecules depends on distance from transmitter to receiver, the varying distance in mobile MC has a significant impact on performance. A strategy to counteract this effect is to employ power control, i.e., to stabilize the average number of molecules at the receiver N rx,k , by manipulating the number of transmitted molecules N tx,k . Here we derive a power control scheme based on the distance estimates provided by our extended Kalman filter. We first obtainN rx,k . In the kth time slot, after N tx,k molecules are released by the transmitter, the total number of molecules measured by the receiver can be expressed aŝ In (30), the calculation ofN rx,k is separated into two terms: the first part is the number of molecules transmitted at the beginning of the current time slot and received during the current time slot, while the second part is the number of molecules received in the current time slot but transmitted from the previous time slots (i.e., ISI). In (29)- (30) , note that the arrival probabilities P k−i+1 vary with the distance between the transmitter and the receiver. Power control can be performed at each time instant k by solving (30) for N tx,k . We can write In the power control scheme, based on (31) ,N rx,k is now the target average number of received molecules (set as a system parameter); P k−i+1 is the transmitter's estimate of arrival probability k − i + 1 time instants after transmission, which is a function of the transmitter's distance estimates; and N tx,i is the number of molecules transmitted at time i. All the quantities on the right side of (31) are available to the transmitter, as are the distance estimates from the extended Kalman filter. To analyze the optimal detection threshold and the system performance, in this subsection, we work on the statistical properties of the received molecules N rx,k . In the kth time slot, after N tx,k molecules which controlled by the transmitter based on (31) are released by the transmitter, the statistical properties of molecules observed by the receiver can be expressed as where N c rx,k is the number of molecules transmitted at the beginning of the current time slot and received during the current time slot, N I rx,k is the number of molecules received in the current time slot but transmitted from the previous time slots (i.e., ISI), and N n rx,k is the counting noise. Mathematical models for each quantity are given below. Let N tx,k information molecules released by the transmitter at the beginning of kth time slot and received by the receiver during the current time slot follow a binomial distribution [53] , given as N c rx,k ∼ Binomial (N tx,k , P 1 ) . Considering that the number of molecules N tx,k is large, the binomial distribution can be approximated by a normal distribution, and can be expressed as The ISI N I rx,k accounts for the molecules transmitted from previous time slot and received during the current time slot, expressed as where ) . (36) The particle counting noise N n rx,k is a random process representing fluctuations in the measured concentration due to single events of particles entering/leaving the receptor space [54] . To determine an appropriate value, we follow methods given in [55] : the counting noise is assumed to follow a Gaussian distribution N n rx,k ∼ (µ n,k , σ 2 n,k ) with mean µ n,k = 0 and variance σ 2 n,k which is dependent on the expected number of molecules received by the receiver, and can be expressed as σ 2 n,k = N rx,k /V rx , where N rx,k is the number of received molecules during the kth bit interval, and V rx is the volume of the receiver. Symbol detection can be formulated as the binary hypothesis testing problem where H 0 and H 1 denote the null and alternative hypothesis corresponding to the transmission of bit 0 and 1, respectively, during the kth time slot. Considering that the received molecules N c rx,k , N I rx,k and N n rx,k are assumed to be independent and follow the normal distribution, their sum N rx,k also follows the normal distribution. Therefore, N rx,k for the different hypotheses are distributed as where µ 0,k and σ 2 0,k represent the mean and variance of the received molecules, respectively, under hypothesis H 0 , and µ 1,k and σ 2 1,k represent the mean and variance of the received molecules, respectively, under hypothesis H 1 . In this paper, we assume the same probability to transmit bit 0 and bit 1, therefore, the mean µ 0,k , µ 1,k and variance σ 2 0,k , σ 2 1,k at time k under hypothesis H 0 and H 1 can be expressed as: = N tx,k P 1 + 1 2 The full derivation of the mean and variance of the µ 0,k , µ 1,k , σ 2 0,k and σ 2 1,k are shown in Appendix A. A threshold may be used to distinguish H 0 and H 1 ; here we derive the optimal threshold. At the receiver, the symbol detected in the kth time slot is: where N th is a preset detection threshold. As the b rx,k corresponds to either b tx,k = 0 or b tx,k = 1. Therefore, the hypothesis H 0 and H 1 for N rx,k can be expressed as: So the false alarm probability P F and detection probability P D can be expressed as where µ 0,k , µ 1,k , σ 2 0,k and σ 2 1,k are given from (38) - (44) . Based on the false alarm probability P F and detection probability P D , the detection error probability P e can be expressed as (51) where Pr(b tx,k ) is the probability to transmit bit 0 or 1. By minimizing P e , the optimal detection threshold can be expressed as Assuming bits 0 and 1 are equiprobable (i.e., Pr(b tx,k = 0) = Pr(b tx,k = 1) = 1 2 ), the optimal detection threshold N th,opt can be expressed as where C = µ 0,k σ 2 1,k −µ 1,k σ 2 0,k − 2σ 2 0,k σ 2 1,k ln σ 0,k σ 1,k . The existence of optimal detection threshold and its derivation are shown in Appendix B. In this section, we analyze the average bit error probability considering our power control and symbol detection scheme. An error occurs if b rx,k = b tx,k , where b rx,k denotes the bit received in the kth time slot, and b tx,k denotes the bit transmitted at the beginning of the same time slot. As in the power control scheme, the number of transmitted molecules in the kth time slot based on the predicted distance and molecules transmitted from the previous time slots. Therefore, the average number of received molecules during the kth time slot dependent on the current and previous transmitted bits, and in full generality, the probability of error may be written P e = (btx,1,...,b tx,k )∈{0,1} k Pr (b tx,1 , . . . , b tx,k ) · Pr (error | b tx,1 , . . . , b tx,k ) . Note that the number of terms in this sum is exponential in k. In practice, due to the long duration of the impulse response in MC channels, the probability of error for the current bit can meaningfully depend on dozens or even hundreds of previous bits. Thus, exact calculation of (54) may be computationally infeasible. To estimate the probability of error, we instead use an approximation that takes advantage of our power control scheme, which stabilizes the the average number of received molecules. To start with, we expand (54) as where N rx,k (b tx,1 , . . . , b tx,k ) is the random variable reperesenting the number of received molecules, given transmitted bits 1 through k; the terms differ in that the final decision is performed on b tx,k , comparing with threshold N th,opt . Now, since power control will keep the mean number of received molecules constant, we make two approximations: first, we replace N rx,k (b tx,1 , . . . , b tx,k ) by its averageN rx,k , effectively taking the average inside the sum. Thus, we have Pr (b tx,i = 1) Pr N rx,i ≤ N th,opt |b tx,i = 1 +Pr (b tx,i = 0) Pr N rx,i > N th,opt |b tx,i = 0 where P D,i and P F,i denote the probability of detection and false alarm at the receiver in the ith time slot, respectively. Secondly, we approximate P D,i and P F,i as arising from a Gaussian random variable (a reasonable and widely-used approximation since the number of molecules is large, even if the underlying random variables are not IID), so that these quantities can be written as Thus, the average bit error probability over the k time slots for the same probability to transmit bit 0 and bit 1 can be expressed as Fig. 3 : The distance to the center of the vessel and the corresponding velocity of the nanomachines. The distance and velocity of the terminals vary slowly but significantly. Initial positions of the transmitter and receiver: L 0 tx = (0, 6 · 10 −5 m, 6 · 10 −5 m) and L 0 rx = (10 · 10 −5 m, 5 · 10 −5 m, 5 · 10 −5 m), respectively. In our simulation results, we show that this approximate calculation of P e is highly accurate, and nearly indistinguishable from simulation results. In this section, numerical and simulation results are presented to verify our distance prediction and power control schemes, using the channel model discussed in Section II. The diffusion process is divided into discrete time slots of duration T , and simulation parameters are listed in Table II , except the initial positions of the nanomachines, which are given in the captions of each figure. In Fig. 3 , we illustrate how the drift velocities of the transmitter and receiver change in an example trajectory. From the figure, we see that the location and drift velocity both vary with time, as indicated in (6) . While these changes are slow, they are significant and must be handled by the estimator. Moreover, the figure illustrates that each of these nanomachines can experience different drift velocities as a result of their different positions in the nonuniform flow. In Fig. 4 , we illustrate the performance of the extended Kalman filter with feedback. For comparison, we use the distance derived from the noisy position estimates of each 10 terminal, without using the Kalman filter. These position estimates are given by (24) , and we call the resulting distance the measured distance. Note that these same position estimates are fed to the extended Kalman filter, and the distance estimates from the filter are called the predicted distance. We also compare with the ground truth actual distance. As can be seen from Fig. 4 , the predicted distance is much closer to the true distance than the measured distance. It is interesting to note in the figure that the predictor correctly tracks the actual distance, even though the slope of the distance curve changes, indicating a change in drift velocity. To further illustrate the accuracy of the algorithm, the measurement error (i.e., difference to the actual value) for the measured and predicted distances are compared in Fig. 5 . We can see clearly that the extended Kalman filter prediction error is much lower than the attenuation-based measured distance. In the simulation results, the mean of the measured distance error and the extended Kalman filter prediction error are 0.24473 µm and 0.082697 µm, respectively. The amplitude of fluctuation of the measured error is roughly (0, 1.5) µm, while that of the prediction error is less than (0, 0.3) µm. These results confirm our expectations of strong performance from the extended Kalman filter. In the remaining figures, we analyze the optimal detection threshold and the performance of power control. In Fig. 6 , we show how the optimal detection threshold varies with distance under different number of transmitted molecules and power control scheme. For a given distance, the larger number of transmitted molecules, the optimal detection threshold is also larger. Moreover, as the distance increases, the optimal detection threshold decreases, but the decrease while using power control is much smaller. Therefore, in the mobile MC, for a constant number of transmitted molecules, calculation of the optimal detection threshold should be performed in every step to mitigate ISI, while for the power control scheme, a preset optimal detection threshold can achieve good performance. In Figures 7 and 8 , we illustrate the performance of power control using the optimal threshold. In Fig. 7 , we illustrate the effect of power control by comparing the mean number of transmitted molecules with distance for one bit. For comparison, we illustrate constant values of N tx of N tx = 8 · 10 4 , N tx = 10 · 10 4 . Meanwhile, in Figure 8 , we consider how the BER varies with detection threshold, both with and without power control, at a distance of d x = 1.5 · 10 −4 m, and using the same constant N tx values as in Figure 7 . We can see from the simulation result, the BER of our power control scheme is better than that of the constant number of transmitted molecules schemes at their corresponding optimal detection threshold, specifically 5 · 10 −3 , emphasizing the utility of optimal power control at each distance. Though the optimal detection threshold for power control scheme shown in Fig. 6 varies slightly with distance, as shown in the red circle of Fig. 8 , the performance of the power control scheme still outperforms the best performance when a constant number of transmitted molecules is used. Therefore, the simulation result proved the feasibility of a optimal detection threshold with the variation of distance for power control scheme. In Fig. 9 , we show how the BER varies with distance under different numbers of transmitted molecules for signal-to-noise ratio (SNR) of 15, which is defined as the ratio of the number of received molecules N rx and the Gaussian counting noise variance σ 2 n at the receiver. We compare BER using both N tx = 8 · 10 4 and N tx = 10 · 10 4 using an optimal detection threshold (i.e. the optimal detection threshold is calculated in every step as a function of distance), and N tx PC schemes. For N tx PC, we compared the power control schemes based on the extended Kalman filter distance and the actual distance. We can see that the power control scheme achieves nearoptimal performance with feedback, and good performance Fig. 9 : The BER versus distance between the transmitter and the receiver, for power control (PC) and non-PC. The initial positions of the nanomachines are the same as in Figure 7 . with update. Considering BCSK with a constant number of transmitted molecules, the best performance is achieved at a particular distance: this is because, for a given transmission power and detection threshold, the optimal distance is unique. Meanwhile, the power control scheme takes advantage of the residual molecules from the previous bit interval and reduces the molecules that accumulate in the channel, so that the performance is better than BCSK with an optimal detection threshold. However, for BCSK with power control, the ISI increases as the distance decreases, so the performance is better as distance increases. This is reflected in the performance observed in Figure 9 . In this paper, we considered a mobile MC system, and analyzed that system with a realistic blood-vessel-type propagation model, in which the transmitter and receiver experience different flow velocity. An extended Kalman filter was employed to predict the changing distance between the transmitter and the receiver. Based on the predicted distance, to keep the number of received molecules for bit 1 at a stable level, we performed power control to reduce the residual molecules in the channel to mitigate ISI. We also verified the effectiveness of a constant detection threshold for mobile MC by the proposed power control scheme. Finally, we analyzed the BER performance of the mobile MC system. Simulation results verified the effectiveness of distance prediction and power control in mobile MC systems. The mean of the received molecules under hypothesis H 0 during the kth time slot µ 0,k can be expressed as: µ 0,k = µ I,k + µ n,k . As µ I,k is the mean number of received molecules from time slot 1 to k − 1, it can be expressed as µ I,k = E k−1 i=1 N I rx,i . Meanwhile, µ n,k is the mean of the counting noise at the receiver which follows a Gaussian distribution with zero mean and the variance σ 2 0,k depends on the average number of received molecules. Therefore, (60) can be expressed as and E N I rx,i can be expressed as E N I rx,i = Pr (b tx,i = 1) E N I rx,i |b tx,i = 1 + Pr (b tx,i = 0) E N I rx,i |b tx,i = 0 As we assume the same probability to transmit bit 0 and bit 1, which means Pr (b tx,k = 0) = Pr (b tx,k = 1) = 1 2 , then The variance of the received molecules under hypothesis H 0 during the kth time slot σ 2 0,k can be expressed as: and σ 2 I,j can be expressed as As therefore, The mean of the received molecules under hypothesis H 1 during the kth time slot µ 1,k can be expressed as: The variance of the received molecules under hypothesis H 1 during the kth time slot σ 2 1,k can be expressed as: Considering the same probability to transmit bit 0 and bit 1, and the fact Q (x) = 1 2 erfc x √ 2 , the error probability P e can be expressed as: The optimal detection threshold can be expressed as: Therefore, the optimal detection threshold N th,opt can be achieved by ∂P e / ∂N th = 0. Letting the quantity in (74) be equal to zero, the equation can be expressed as: Then, (75) can be expressed as: Taking the logarithm of both sides of (76), Therefore, the optimal detection threshold N th can be expressed as: where C = µ 0 σ 2 1 −µ 1 σ 2 0 − 2σ 2 0 σ 2 1 · ln σ0 σ1 . A comprehensive survey of recent advancements in molecular communication Moving forward with molecular communication: from theory to human health applications Resource allocation for multi-user molecular communication systems oriented to the internet of medical things Modeling of viral aerosol transmission and detection Methods and applications of mobile molecular communication On flow-induced diffusive mobile molecular communication: First hitting time and performance analysis Molecular communication in fluid media: The additive inverse gaussian noise channel Concentration-based demodulation scheme for mobile receiver in molecular communication Optimal transmitted molecules and decision threshold for drift-induced diffusive molecular channel with mobile nanomachines Statistical analysis of received signal and error performance for mobile molecular communication Diffusive mobile mc with absorbing receivers: Stochastic analysis and applications A concentration-time hybrid modulation scheme for molecular communications Isi-aware channel code design for molecular communication via diffusion Csi-independent non-linear signal detection in molecular communications Iterative signal detection for diffusion-based molecular communications K-means clustering-aided noncoherent detection for molecular communications Generalized molecularshift keying (gmosk): Principles and performance analysis Molecular type permutation shift keying for molecular communication Stochastic channel modeling for diffusive mobile molecular communication systems Isi mitigation techniques in molecular communication Power control for isi mitigation in mobile molecular communication Distance estimation in concentration-based molecular communications Distance estimation schemes for diffusion based molecular communication systems Parameter estimation of inverse gaussian channel for diffusion-based molecular communication Parameter estimation of diffusive molecular communication with drift Initial distance estimation and signal detection for diffusive mobile molecular communication Measuring distance from single spike feedback signals in molecular communication Transmitter localization in vessel-like diffusive channels using ring-shaped molecular receivers Localization schemes for 2-d molecular communication via diffusion Nanomachine localization in a diffusive molecular communication system Multiple transmitter localization via single receiver in 3-d molecular communication via diffusion Modeling duct flow for molecular communication A molecular communication system in blood vessels for tumor detection Channel modelling of molecular communications across blood vessels and nerves An introduction to fluid dynamics Channel modeling for diffusive molecular communication-a tutorial review Theoretical microfluidics Highly efficient mof-based self-propelled micromotors for water purification A microrobotic system guided by photoacoustic computed tomography for targeted navigation in intestines in vivo Micro/nanomachines: from functionalization to sensing and removal Recent progress on micro-and nanorobots: Towards in vivo tracking and localization Artificial micro/nanomachines for bioapplications: biochemical delivery and diagnostic sensing Multifunctional biohybrid magnetite microrobots for imaging-guided therapy Molecular communication: uni-cast communication on a microtubule topology Design of selforganizing microtubule networks for molecular communication Microtubule binding kinetics of membrane-bound kinesin-1 predicts high motor copy numbers on intracellular cargo Cargo loading onto kinesin powered molecular shuttles Stochastic stability of the discrete-time extended kalman filter Nonlinear filters: beyond the kalman filter Wiener and kalman detection methods for molecular communications Nanorobots-assisted natural computation for multifocal tumor sensitization and targeting Progress in nanorobotics for advancing biomedicine Energy model for communication via diffusion in nanonetworks Diffusion-based noise analysis for molecular communication in nanonetworks Receiver design for molecular communication