Abstract
The use of sensors is a primary need in robotic systems. There are sensors that generate a signal whose frequency depends on input stimulus. The application of such sensors is desirable due to their short response time, accuracy, and resolution. For proper use of these sensors, adequate frequency measurement is required. The principle of rational approximations is a method for frequency estimation that has advantages over other measurement methods. Some of them include not a fixed sampling time, insensitivity to jitter, and accuracy limited by the reference stability. Nevertheless, there are some measurement parameters with a not well-researched effect in measurement process. The objective of this work is to elucidate how the phase of input signals (measurand and reference) affects the frequency measurement process.
Introduction
During operation, mobile robotic systems accomplish plenty of signal processing tasks that depend on the robot application. Measurement of physical parameters is the way in which a robot receives or perceives environmental conditions. This awareness of the environment allows the robot to fulfill its purpose.
Most of the novel sensing technologies require the use of piezoelectric material-based sensors; some examples have been reported elsewhere. 1 –3 These kind of sensors work under the piezoelectric effect; as a consequence, when these sensors are stimulated, there is a variation of their frequency. 4 For this reason, these sensors are known as frequency domain sensors (FDS). Accelerometers are other examples of FDS used in robots. 5,6 Due to the characteristics of FDS devices, measurement of variations in their natural frequency is the best approach for their applications.
Usually in the systems where FDS are used, implementations of frequency measurement methods or specialized equipment are used. Some frequency measurement methods include conventional counters, reciprocal counting, interpolating reciprocal counting, and time-stamping counter 7 ; other techniques include the methods of dependent count: method for measurement of absolute values, method for measurement of relative values, and universal method of dependent count 8 ; additionally, some of the mentioned techniques have been adapted or implemented for measuring picosecond time intervals. 9
The direction of robotic development aims to develop ubiquitous applications, while the robots can increase their autonomy and intelligence. Improving measurement capabilities is one step to achieve these tasks. For this reason, in this work, one particular aspect of the “principle of rational approximations” is analyzed. This is a method for estimating the desired frequency from a signal, with plenty of advantages over other frequency estimation methods. 7 –9 These improvements include not a fixed sampling time, insensitivity to jitter, and accuracy limited by the reference stability. 10 –15 The application of such a technique has been proposed for several tasks, like sensors for chemical compounds 16,17 or automotive industry. 12
The aim of this work is to provide an analysis of how the phase of signals, during measurement, affects the approximation of an unknown frequency. This value can be generated by a sensor embedded in a robotic system.
Theoretical background
The principle of rational approximations is a method for frequency measurement. This technique has its theoretical fundamentals on number theory, particularly, the mediant fractions. During measurement, a digital multiplication of two input signals is required. As stated by Hernandez Balbuena et al.,
10
a signal to measure (Sx) and a reference (S0) go into an AND gate. This digital multiplication is also known as a signal comparison process. The last generates a third signal (
Considering n as the number of coincidence and Pn and Qn as the quantity of pulses until the nth coincidence for Sx and S0, respectively, an approximation to fx can be obtained in each n coincidence
Considering T0 as the period of the reference signal, the measurement time (Mt) to until any nth coincidence is calculated as
To evaluate the accuracy of measurements, the relative error β can be calculated as
where fe is the nominal or expected frequency value. An analysis of the principle of rational approximations is shown in Figure 1. In general terms, the usual theoretical considerations were used, which will be discussed below.

The principle of rational approximations: (a) signal coincidence process during measurand approximation and (b) relative error.
Under the knowledge that a periodic signal is represented as
where A is the signal amplitude or the peak deviation of the function from zero. f is the signal frequency or the number of oscillations (cycles) that occurs each second of time, and ϕ is the phase which specifies (usually in radians) where in its cycle the oscillation is at
As stated before, for application of the principle of rational approximations, it is required to “discretize” or to “digitize” both input signals; in this process, it is generated as a signal that is on high level during the time corresponding to pulse width τ. Considering equation (4), its discretized form is shown in equation (5), where T is the period corresponding to f and
Equation (5) generates a periodic square wave that keeps the same frequency as equation (4); for this reason, the phase ϕ can be used to express where the square wave starts using
Considering the models provided by equations (4) and (5), the measurand Sx and reference S0 signals can be modeled in terms of measurement time Mt as follows
The parameters
For each coincidence, an approximation to fx is obtained using equation (1). The last allows us to evaluate the accuracy of measurement process through equation (3). Relative error during measurement time is presented in Figure 1(b). As it is expected, β decreases in a time as short as 50 µs. The analysis, as shown in Figure 1, shows the functioning of the principle of rational approximations, which has been reported and analyzed in previous publications. 10,13 –16,18 An important characteristic is that the mentioned reports lack realism. For this reason, the aim of this work is to evaluate the effect of phase from input signals, which is closer to reality than previous reports.
Phase analysis
In order to evaluate how the phase of input signals affects the measurement process, three different cases can be analyzed: a random phase in Sx or S0 and a random phase in both signals. Each case was analyzed using the algorithms proposed in a previous publication, 19 after their implementation in MATLAB. But for the herein proposed computational experiments, the phase of input signals was randomized. This was done after the multiplication of signal period with a random number between 0 and 1. Additionally, the phase value in all cases is lower than one-third of the pulse width. The resulting value was used as the starting time of generated signal. Using the corresponding period, each previously exposed case can be analyzed. For the case where random phase is required in Sx or S0, five signals with random phase were generated. For the third case, five signals with random phase in Sx and S0 were obtained.
Effect of measurand random phase
For the case where random phase is on Sx, results of experiment are presented in Figure 2. Particularly, the relative error is shown in Figure 2(a). The first evident observation is that β has a value greater than zero at the beginning of measurement time, and it decreases over time. According to the general case, illustrated in Figure 1, the worst approximations are obtained at the beginning of measurement process, when

Effect of measurand (fx) random phase
In the same way as discussed in the calculations presented in Figure 1, in the herein presented cases of the phase analysis
Considered measurand phase in each experiment.
A detailed observation of Figure 2(b) indicates that the maximum peaks corresponding to
In general, the results from analysis of relative error variations during measurement time show that when the phase is in the order of
Additionally, variations on the phase magnitude order generate different packets of coincidences which lead to uncertainty in the measurement process. Another important observation is that the best approximations generated at the kernel of the packet of coincidences do not fulfill the condition of
Effect of reference random phase
In difference to previously studied case, now the effect of random phase
Considered reference phase in each experiment.

Effect of reference (S0) random phase
In a similar way to
Another important observation is that in the case when phase is in the order of
Since the reference signal starts with a phase condition difference of zero, the best coincidences have a permanent displacement, but such time overlappings remain the kernel in packets of coincident pulses, which can be observed in the variations of coincidence time
Combined effect of measurand and reference random phase
In the last case, random phase values of
Considered reference phase in each experiment.

Combined effect of measurand (Sx) and reference (S0) random phase (
In cases when
How the relative error behaves is how the desired frequency is approximated. In other words, if β approaches to zero from positive values, the fx value approximates from greater to smaller values. This means that the phase condition can be how the relative error approaches to zero, or how direct frequency measurements are generated.
In these experiments, the phase of signals is considered to be a constant value; for this reason, the maximum coincidence time is given as follows
when the relative error approaches from above zero to zero; in the case of an approximation from below zero to zero is given by
The validity of equations (8) and (9) can be observed in Figure 4(b), where the variations of
Conclusions
For robotic systems, frequency measurement is a task required for different processes; one case is measurement of frequency generated by sensors. The principle of rational approximations is a tool suitable for quantifying the variations in the frequency generated by a sensor under stimulus.
In this work, the effect of phase in the estimation of a desired signal was presented. The principle of rational approximations’ functioning was evaluated under variations in the phase of measurand and reference frequency. As a result, a relationship in the relative error and phase of input signals was discussed. The presented analysis allows to determine which kind of phase condition is presented.
Footnotes
Acknowledgment
The authors thank the Universidad Autónoma de Baja California y Universidad Nacional Autónoma de Mexico for providing facilities for research and experimentation.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Universidad Nacional Autónoma de México under grant DGAPA-UNAM IN107817, PRODEP, and the Consejo Nacional de Ciencia y Tecnología basic-science proposal A1-S-3349.
