1. Introduction
In some measurement methods, the value of a physical impact is measured by determining the value of a flat curve shift from its reference position. The flat curve, in its turn, is the intermediate measurement result and is the dependence of one measured value on another one. This class of tasks regularly occurs in spectroscopy, reflectometry, fiber optic measurement systems, etc. For example, in spectroscopy, a flat curve is a spectrum part, while in reflectometry, it is a time dependence of the signal’s amplitude. Information about the magnitude of the physical impact on sensors, which are based on resonant structures (fiber Bragg grating [
1,
2,
3], Fabry–Perot interferometer [
4,
5,
6], ring [
7,
8,
9,
10] or other resonators [
9,
11,
12]), is defined through their spectrum shift. Similar tasks also occur in distributed fiber-optic measuring systems. The physical impact magnitude is determined by the frequency shift of the Stokes (or anti-Stokes) component of the stimulated Brillouin scattering [
13,
14,
15], and the position of the physical impact is determined through the comeback time of the reflected impulse.
In fiber optic measuring systems, the intermediate result of measurements is the dependence of the light amplitude on either frequency or time. The spectrum shift value is commonly determined using the Fourier transform, but the error in the shift determination is the multiple of the data sampling step. Hence, the key factor that affects the measurement accuracy is the discretization (sampling) step of the measured data.
Each successive generation of devices provides smaller sampling steps and more detailed access to measurement data. At the same time, in both optical spectroscopy and optical reflectometry, an infinite decrease in the data discretization step is impossible. Moreover, the increase in the resolution of all classes of devices entails an almost exponential increase in their cost. To improve the determination accuracy of the resonance position in the reflection spectrum of fiber Bragg gratings, various approaches have been proposed. These approaches are associated with the methods of sub-pixel processing of spectrum data [
16,
17,
18], which make it possible to increase the resolution by one or one and a half orders of magnitude compared with the physical resolution of a spectrum analyzer [
19]. It was reported that the accuracy of the FBG central wavelength determination can be increased by 31 times compared to the spectrometer resolution of 405 pm using the mass center method [
17]. It is also shown that the 3-dB Bandwidth algorithm improves the accuracy by 5.3 times, and the Gauss curve fitting algorithm provides a twofold increase in accuracy.
A comprehensive review of the sub-pixel processing methods in application to FBG interrogation is presented in [
20]. For the sampling resolution of 156 pm and a noise level of −60 dB (which is very close to the current study), the following results were obtained using different sub-pixel processing techniques: 3-dB Bandwidth method provides the error of 28.7 pm (5.4 times improvement), Centroid (center of mass) method gives 5.8 pm error (26.9 times improvement), second-order polynomial fit results in 2.2 pm error (70.9 times), Gaussian fit method (with resampling) demonstrated 3.7 pm error (42.2 times), Karhunen–Loève transform (KLT) method provides 0.18 pm error (866.7 times). In general, the 3-dB Bandwidth method offers the least accuracy improvement in the case of a coarse spectrometer resolution. Despite the biggest accuracy gain of the KLT among the abovementioned methods, its computational complexity makes it unfavorable in real-time sensing applications. Direct methods (3-dB Bandwidth and Centroid) and curve fitting methods (second-order polynomial and Gaussian) require less computational power, taking two orders of magnitude less of computational time than the KLT, although being inferior in terms of accuracy.
Due to the special consideration of nonlinear distortions of a spectrum, the resolution can be further improved by another order of magnitude but only in a narrow range [
21]. Similar approaches of the sub-pixel spectrum data processing can be used in distributed fiber-optic sensing tasks that use Brillouin spectrum shift determination [
22]. However, for some cases, the performance of the mentioned methods is insufficient.
There is a well-known phase correlation method [
23,
24] for the optical flow determination, which is a general-purpose algorithm for determining image displacement. It is effective even with fast movement and random shifting, including image rotation. Unlike many algorithms, the phase correlation method is resistant to noise and other defects that are typical for medical or satellite signals and images. The use of the mathematical apparatus of the phase correlation method for the shift determination of an image, which is given discretely, is limited by its accuracy. The phase correlation method allows one to determine the image shift with an error not exceeding the resolution of the original data. There are extensions of the phase correlation method that improve its accuracy [
25]. They are based on refining the position of the peak in the subpixel zone, when the position of the maximum is approximated by a simple linear combination of the peak pixel and its nearest neighbors, which again reverts to the initial task of definition of the peak value using a subpixel processing method considered above. The extensions of the phase correlation method are based on the assumption that the integer shift has already been found, and the compared images differ only in the subpixel shift. This approach makes it possible to increase the accuracy of the bias determination but does not eliminate the need to perform the direct and inverse Fourier transforms. In addition, this approach does not solve the main spectroscopy task when it is necessary to determine the position of the maximum in the spectrum as accurately as possible.
In this work, we propose a solution that eliminates the need to perform Fourier transforms, both direct and inverse, thereby significantly reducing requirements for computational power in comparison with the phase correlation method.
To increase measurement accuracy, the researchers propose a usage of sensitive elements with narrow spectral characteristics, the resonance position localization of which can be carried out with higher accuracy in comparison with conventional sensing elements. The sensitive elements of this class include fiber Bragg gratings with discrete phase shifts, the spectral width of which is an order of magnitude smaller than the spectral width of the reflection spectrum of the entire Bragg structure [
26,
27,
28]. Optical elements developed on the basis of the ring resonators serve the same purposes, since the Fano-type resonance formed in such elements has a very narrow reflection spectrum [
8,
11,
29]. It must be noted that there are no similar approaches to add the narrowband spectral components to the Brillouin spectrum in distributed sensor systems.
The accuracy of fiber optic measuring systems can be increased using microwave–photonic methods [
16,
30,
31], which transfer the measurement process from optical to microwave frequency range. It is also possible to increase the accuracy of the measurements using the technologies of addressed fiber Bragg structures, which have been actively developed recently [
32]. However, microwave–photonic measurement methods do not cover the reflectometry tasks. Despite the noticeable results achieved in microwave photonics and addressed measurement techniques, the task of increasing the measurement resolution is still relevant. Moreover, whatever the physical resolution of the instruments can be, one always wants to get the maximum available measurement accuracy.
We have set the task to determine the shift (including the slight shift) of a flat two-dimensional curve describing a one-dimensional signal, given as a finite number of discrete samples at regular intervals, with an accuracy of three and more orders of magnitude greater than the data sampling step, when only plane-parallel shift of the curve occurs without distortion of its shape.
The paper is organized as follows. Firstly, we present a complete mathematical description of the proposed method for spectrum shift determination. Secondly, the algorithm of the method application is summarized. Thirdly, the results of simulations are presented that verify the performance of the method. Finally, a modification of the algorithm is proposed that can be used to find a global maximum of an arbitrary curve on a selected interval, which also can be applied in spectroscopy.
2. Mathematical Background
Consider a functional dependence
y =
f(
x), which determines the magnitude of the physical impact on the sensitive element of the measuring system in the unperturbed state. At the same time, the specific form of this functional dependence is unknown. A change in the magnitude of the physical impact leads to a plane-parallel shift of the functional dependence. This shift is described as
d =
f(
x + Δ
x) + Δ
y, where Δ
x and Δ
y are the shift parameters. Let us designate the functional dependence
y(
x) in the unperturbed state as the reference one, and
d(
x) as the shifted one. Both dependencies,
y(
x) and
d(
x), are presented with discrete data sets, {
yi} and {
di}, (
i = 0,
N), on the same uniform coordinate grid, {
xi}. The grid sampling step is
h =
xi+1 −
xi,
Figure 1. The following notations are used in
Figure 1:
xi is the abscissa sampling set;
nA is the index of the right and
nB is the index of the left boundary of the controlled part of the dependence, respectively;
h is the sampling step;
yi are the amplitudes of the reference curve (marked in blue);
di are the amplitudes of the shifted curve (marked in green);
D(Δ
x, Δ
y) is the shift vector, which is the same for all points of the curve. The function
f(
x) can be arbitrary; however, a number of easily fulfilled requirements must be met. The function
f(
x) must be defined, continuous and differentiable an infinite number of times at any point
x of the segment [
x0,
xN]. The task is to determine the shift vector
D, namely the shifts, Δ
x, along the abscissa axis and, Δ
y, along the ordinate axis.
The reference and the shifted spectra are the values of the same function
f(
x), which is continuous and everywhere differentiable on the segment. Therefore:
Let us take advantage of the requirement that
f(
x) is the same function for both data sets, and it is infinitely differentiable at each point. Therefore, the values of the function
f(
xi + Δ
x) can be represented as the Taylor series near each
xi:
where
nD is the number of derivatives used in the approximation of the series; o(Δ
xnD+1) is the remainder term of the Taylor series, the error of which has the order of (Δ
x)
nD+1. Neglecting a small value of the remainder term of the Taylor series in Equation (2) and substituting Equation (2) into the second Equation in Equation (1), we obtain:
Equation (3) gives the system of N equations, which contains (2 + nD∙N) unknowns— namely, Δx, Δy and nD∙N derivatives f(n)(xi) (n = 1, nD and i = 1, N).
A derivative of any order can be approximated with finite-difference relations with a predetermined order over a given discrete pattern of points. For central (symmetric) finite differences on the pattern of
nP = 2∙
nS + 1 points {
xi−nS,…,
xi,…,
xi+nS}, the derivative can be represented as a linear combination of the function values at the pattern points [
33]:
where
Ck are the coefficients of the linear combination;
pi,n denotes the approximation of the
n-th order derivative of the
f(
x) at the
xi point. Central finite differences do not allow one to approximate the derivatives at the interval ends at points with indices
i = 0,
nS − 1 and
i =
N,
N −
nS. To approximate the derivatives at the points, which are close to end, the non-symmetric finite differences (the “forward” and “backward” finite differences, for example) can be used. However, it is possible to restrict the consideration by the controlled interval in the assumption that the controlled interval [
xnA,
xnB] is strictly inside [
xnS,
xN−nS].
The coefficients
Ck of the linear combination in Equation (4) in the case of central finite differences can be found as the solution of the linear system of equations:
where
A is the matrix of the linear system of equations,
B is the free terms vector and
C is the vector of coefficients.
Under the conditions of the above notation, the matrix
A is defined as [
33]:
The vector of free terms is defined as:
where
nD is the derivative order, δ(
x) is the delta function. All coefficients of the vector
C can be calculated for an arbitrary order derivative
nD on an arbitrary equidistant symmetric pattern containing
nP points, provided
nD ≤
nP − 1. Otherwise, the free term vector
B calculated with (7) is equal to zero, and Equation (5) has a trivial solution. The approximation order of the derivative is determined with the value of (
nP −
nD + 1).
Thus, the reference data set {yi} (i = 0, nP−1) allows determining the derivatives pi,n up to any pre-assigned maximum order nD, calculated as finite differences on a symmetrical pattern containing nP points, at all internal grid points xi (i = nS, N − nS).
Therefore, considering the notation made and the pre-calculated derivatives, Equation (3) can be rewritten:
for all the points of the controlled area. In Equation (8), the designations for the calculated derivatives are used, and the limits of the index
i, which determine all points of the controlled area, are changed versus Equation (3). As a result, Equation (8) gives (
nB −
nA + 1) equations for determining only two unknowns, namely Δ
x and Δ
y—the coordinates of the shift vector
D(Δ
x, Δ
y). Finding a solution of the overdetermined system is carried out using the least squares method, by minimizing a convex positive definite functional:
The requirement of the minimum in Equation (9) is equivalent to the system of equations composed of two equal to zero partial derivatives of Φ(Δ
x, Δ
y) with respect to Δ
x and Δ
y:
The system of Equation (10) allows solving it regarding the unknown variables separately. The desired variable Δ
y can be explicitly expressed from the second Equation (10):
Substituting Δ
y from Equation (11) into the first Equation (10) gives an algebraic equation of one variable to determine the Δ
x:
Moreover, Equation (12) is a polynomial of degree 2∙nD − 1, and the solution of this equation is equivalent to finding all the roots of the polynomial T(Δx), which in a general case has exactly 2∙nD − 1 roots. An odd degree of a polynomial T(Δx) guarantees that there is at least one real root of Equation (12).
4. Algorithm Verification
The algorithm verification was carried out on the model task of determining the shift of the central wavelength of a fiber Bragg grating. It was assumed that the fiber Bragg grating has the Gaussian shape of the reflected spectrum in the amplitude–frequency plane:
where
x is the wavelength, μ
0 is the central wavelength, σ is the standard deviation,
yS is the minimum value,
aN is the amplitude of the noise component and
A is the maximum of the amplitude.
The amplitude of other-than-zero value can be chosen arbitrarily, and it does not affect the task solution. However, to make the model closer to real physical parameters, the amplitude value is taken equal to
A = 10
4 dimensionless quantities. The amplitude of the noise component,
aN, as a rule, does not exceed 0.1% of the maximum amplitude value, and the minimum value in the spectrum,
ys varies in the range from 0 to 20% of the maximum amplitude value. Other simulation parameters are selected as close as possible to the operating conditions of the assembled interrogator based on the spectrum analyzer I-MON-512 [
21]. Namely, the number of spectral points is
N = 510; the left end of the spectral range is λ
Min = 1510 nm; the right end of the spectral range is λ
Max = 1595 nm; the sampling step of the resulting spectrum is
h ≈ 0.167 nm. The central wavelength of the fiber Bragg grating is taken equal to μ
0 = 1550 nm, with σ = 0.2. The maximum range of the spectrum-controlled segment is selected equal to 4 nm, which determines the indices of the left,
nA = 227, and right,
nB = 251, borders of the controlled segment. The maximum spectrum shift does not exceed 4 nm (μ
0 ± 2 nm). The number of pattern points,
nP, is varied up to 17. The maximum amount of the Taylor series,
nD, is varied up to 14. It is ensured that the approximation of the derivative by finite differences is not lower than the third order of smallness.
The reflectance spectra of a fiber Bragg grating with the simulation parameters are shown in
Figure 2; the blue line indicates the reference spectrum, and the green line indicates the spectrum with the shift of 0.5 nm.
Previously, for each value of the spectrum shift with a step of 0.1 nm in the range from −0.5 to 0.5 nm, the target function
T(Δ
x) is tabulated to determine its behavior,
Figure 3. The shape of the dependence
T(Δ
x), shown in
Figure 3, guarantees the existence of a single real root of Equation (12) in the required range. Since the function
T(Δ
x) is defined everywhere on the segment, it has different signs at the edges of the segment, hence its root in the segment can be found by the iterative bisection method. As the criterion for stopping iterations, it is necessary to use the proximity to zero of the interval for finding the root, instead of the proximity to zero of the objective function values.
Setting the requirement that the absolute error in finding the root of Equation (12) must not exceed ε = 10
−14 m, let us set an arbitrary spectrum shift in the range from −0.5 to +0.5 nm. Then we generate a shifted spectrum and obtain its values at control points. Based on the data of the shifted spectrum, we calculate its shift relative to the reference spectrum. Thereafter, we build the dependence of the actual shift value on the obtained shift value based on the proposed algorithm and calculate the absolute error in the offset determination. The dependence of the absolute shift determining error on the actual shift is shown in
Figure 4.
Based on the analysis of the data shown in
Figure 4, one can conclude that the maximum error in the spectrum shift determination does not exceed 0.15 pm. It is one and a half orders of magnitude higher than the capabilities of most of the other methods for approximating the shift of the fiber Bragg grating central wavelength.
Table 1 presents a comparison of the obtained results to the performance of existing sub-pixel techniques in similar conditions (sampling step of 156 pm and noise level of 0.1%) [
20].
The best approximation results of the proposed method are obtained using the amount of the Taylor series up to 13–15 orders, with the 17-point pattern, which ensures the approximation of finite differences with an error from 2 to 4 orders of smallness. The usage of 19 or more-point patterns for approximation causes certain difficulties. In such a case, the matrix of Equation (5) is poorly defined because the determinant of the matrix is huge. Thus, the solution of the linear system of equations causes noticeable difficulties, which entails the impossibility to calculate the coefficients of the derivatives’ approximations. The usage of finite differences of the first order approximation decreases the accuracy of the method. Similar experiments with the curve shift determination in other tasks show that the proposed algorithm makes it possible to determine the spectrum shift with a resolution approximately four orders of magnitude greater than the data sampling step.
5. Algorithm Modification
In many problems of applied physics, there is no need to solve the problem of determining the shift vector of a plane curve in the given formulation. In particular, in the problems of spectroscopy, fiber optic spectroscopy, fiber optic sensors and reflect- and refractometry, the most common task is to determine the position of the single global maximum of the curve on a selected segment with the highest possible accuracy. It allows adding one more requirement to the problem statement: let the given curve
y =
f(
x) have only one global maximum in the segment [
xnA,
xnB]; moreover, the segment [
xi,
xi+1] of the position of the maximum has been determined in advance (
Figure 5). The task is to find the position of the global maximum located inside the segment [
xi,
xi+1]. The value of the function at a point
T arbitrarily taken inside the segment [
xi,
xi+1] with coordinate
xi + Δ
x can be written according to Equation (2), where Δ
x ∈ [0,
h] (where h is the sampling step). The problem is to find the Δ
x value for which the function
f(
xi + Δ
x) takes on its maximum.
This requirement means that the derivative of
f(
xi + Δ
x) with respect to Δ
x must be equal to zero. Differentiating the left and right parts of Equation (2) with respect to Δ
x and discarding terms of small orders, we obtain a nonlinear algebraic equation:
the solution of which allows us to determine the value of Δ
x, assuming that the value of all derivatives at the point
xi is known or obtained with the finite difference method.
The presence of only one local maximum on the segment of the search for the root Δx ∈ [0, h] ensures the existence and uniqueness of the solution of Equation (14). Equation (14) is nonlinear, so its solution can be obtained only numerically.
We tested the modified algorithm under the conditions of the task. Three iterative methods (bisection, Newton–Raphson and Levenberg–Marquardt) were tested to solve it. The initial approximation for Δx was taken equal to Δx0 = h/2 for all iterative methods, which ensured a relatively fast convergence of each method. The error in the determination of the curve maximum position for all three methods turned out to be no higher (often even lower) than the same error in the determination of the shift of the curve relative to its reference position.
The modified algorithm allows one not only to reduce the computational load but also to consider the possible change in the curve shape at each measurement stage.
6. Conclusions
The proposed algorithm has numerous advantages. Firstly, it does not contain any complex calculations and can be implemented even on the simplest microcontroller. Secondly, the main computational complexity falls on the Initial Step and is performed only once. Thirdly, in the process of each measurement step, the task is only to find an existing real root of the polynomial. Fourthly, the simple bisection method can be used to solve the task, which ensures the root founding in no more than 30–35 iterations, depending on the required accuracy. Despite the apparent simplicity of the mathematical apparatus, the proposed algorithm makes it possible to increase the actual resolution of the spectrum analyzer by almost four orders of magnitude. Fifthly, the advantage of this method is its independence from the intensity fluctuations.
This method can be useful in various spectroscopic applications. For example, the chemical environment affects the Raman peak of chemical bonds; another example can be fluorescent probes, where peak shift is usually correlated with the quantity of measurements. Specifically, the fluorescence spectrum shift determination is often correlated with the broad emission spectra.
In addition, the proposed method can be applied in distributed sensing systems based on Brillouin scattering to enhance the measurement resolution. In all the mentioned applications, the current method can be used to enhance the precision of the spectrum shift determination.
The disadvantages of the proposed method are the necessity of a preliminary measurement of the spectrum and the impossibility of the central wavelength position determination of an arbitrary spectrum.
The proposed modification of the algorithm is applicable for tasks of finding the global maximum of the curve on a selected interval. The modified algorithm allows one to significantly reduce the computational load of the algorithm. Firstly, the modified algorithm does not require a reference curve, relative to which the offset is determined and, as a result, the requirement to store the reference curve in memory. Secondly, there is no need to calculate (even once) the derivatives of all orders of the reference curve at each point of the spectrum. The only requirement is to calculate derivatives of all orders at one of the points xi (or xi + 1) which is the boundary of the interval for finding the maximum. Thirdly, the modified algorithm allows one to consider the possible change in the shape of the obtained curve at each measurement stage. All these advantages make the modified algorithm very attractive for its use in spectroscopy applications.