3.2.1. Data Pre-Processing
The pre-processing of the raw phase data consists of two steps, phase ambiguity removal and phase unwrapping, aimed at solving the problem of the phase ambiguity problem introduced by the RFID system hardware and the carrier phase winding problem during signal propagation.
As mentioned in
Section 2.1, the phase data returned by the Impinj Speedway R420 reader is introduced with a
radian ambiguity, which will seriously affect the processing and analysis of the phase data in this paper. Therefore, we solve the
radian ambiguity problem first, and the method is shown in Algorithm 1.
Algorithm 1: Disambiguation of Phase Data |
input: Phase data sequence , threshold |
output: Disambiguated phase data sequences |
|
The radian phase ambiguity is detected based on whether or not there is a radian jump in the phase value at the current moment, and if so, the radian phase ambiguity has occurred at the current moment. In this paper, the phase ambiguity is divided into the following two cases:
(1) The true phase value at the current moment satisfies , then the phase value returned by the reader at this time is .
(2) The true phase value at the current moment satisfies , then the phase value returned by the reader at this time is .
For case (1), it is judged whether the phase data has the radian ambiguity according to whether the value of is within the interval . If the radian ambiguity occurs, should be .
For case (2), it is judged whether the phase data has the
radian ambiguity according to whether the value of
is within the interval
. If the
radian ambiguity occurs, the
is calculated as follows:
where
is the previous moment phase value, in this paper
represents a smaller value (threshold) and an appropriate
can be selected according to the actual situation. Based on a large amount of empirical results, in this work,
is set to 1.8, where the effect of phase ambiguity removal is better at this time. To prove the effectiveness of the algorithm, we used it to filter the actual human respiratory signal in
Section 4.2.1 and selected only a small fraction of the result to improve observability. The effect of
radian phase disambiguation is shown in
Figure 7.
The second step is to perform phase unwrapping for the phase wrapping problem. The phase wrapping problem refers to the fact that the carrier phase jumps when it reaches the period boundary, thus creating ambiguity. For example, the carrier phase jumps from
to 0 or from 0 to
. The method for phase unwrapping is shown in Algorithm 2.
Algorithm 2: Phase Unwrapping |
input: Phase data sequence , threshold |
output: Phase sequence after unwrapping |
|
The idea of the algorithm is as follows. Under the premise that the human body’s breathing motion will not cause a large jump in the carrier phase, when the phase wrapping phenomenon occurs, the phase value
at the current time and the phase value
at the previous time should satisfy
. If the phase wrapping is detected,
is calculated according to Equation (
8) for unwrapping. We also selected a small fraction of the actual human respiratory signal in
Section 4.2.1 for testing, and the unwrapping effect is shown in
Figure 8.
At this point, the radian phase ambiguity problem introduced by the RFID system hardware and the wrapping problem of the carrier phase during signal propagation has all been solved. Now, the pre-processed phase data can be used to extract the respiration frequency and monitor the respiration condition of the human being.
3.2.2. Respiratory Rate Extraction
The standard respiratory frequency analysis is divided into two main types: frequency-domain analysis and time-domain analysis [
35]. The frequency-domain performs a Fourier transform of the respiratory signal, and the respiratory frequency estimate is the frequency corresponding to the maximum power in a reasonable respiratory frequency range (4∼60 bpm) [
36]. The time-domain analysis identifies reliable breathing as the period of the signal between two pairs of maxima, only one of which is below zero [
37]. In this paper, respiratory rate extraction is divided into three steps: DC (zero frequency) component removal, Butterworth bandpass filtering and Fast Fourier Transform (FFT).
When the reader receives the backscattered signal from the tag, the receiver circuit will introduce a DC component into the respiratory signal [
38]. The DC component will affect the subsequent processing of the phase data in this paper. For example, the DC component will cause abnormal values in the initial part of the filtering results of the Butterworth bandpass filter used in this paper as shown in
Figure 9, and the waveform in
Figure 9a is plotted with the initial phase data returned by the pre-processing of Algorithms 1 and 2. The experimental scenario is shown in
Section 4.2.1, the tag is deployed on the chest and the distance between the human being and antenna is 1.8 m. It can be deduced from Fourier transform that the DC component in the breathing signal is the mean value of the signal sequence. Therefore, subtracting the mean value of the signal sequence from each sample value in the signal sequence can remove the DC component in the respiratory signal.
We found in our experiments that although the DC component has been removed, there is still a large amount of low-frequency noise around the DC component. This phenomenon can be seen in
Figure 10b, and the initial phase data is also the result of Algorithms 1 and 2. Due to the large low-frequency noise near the DC component, we cannot get the desired result only by removing the DC component. If we want to extract the low-frequency respiratory information, it is necessary to use a band-pass filter to remove both low-frequency noise and high-frequency noise in the respiratory signal. We select the Butterworth bandpass filter as it has a magnitude response that is maximally flat in the passband and monotonic overall. This smoothness comes at the price of decreased rolloff steepness, while Elliptic and Chebyshev filters generally provide steeper rolloff for a given filter order. Since the human respiratory rate is about 0.2 Hz∼0.27 Hz [
30], the passband range is set to 0.1 Hz∼1 Hz [
15,
36] in order to ensure that the spectrum in the respiratory rate range will not be lost.
Figure 10 shows the initial phase data, the 1st to 4th order Butterworth bandpass filtering results of the initial phase data and their spectrums.
It can be seen from
Figure 10 that the 2nd-order Butterworth bandpass filter has been able to reduce the low-frequency noise in the respiratory signal well and highlight the respiratory rate. Starting from the 5th-order Butterworth bandpass filter, the filtered data will be distorted. In summary, if the order of the Butterworth bandpass filter is too high, the data will be distorted. For the Butterworth filter, the frequency response curve in the passband is maximally flat and ripple-free, while it decreases to zero in the stopband [
39]. Moreover, the higher the order of the Butterworth filter, the faster the decay of the frequency response curve in the stopband. As can be seen from the
Figure 10d,f,h,j, the frequency response of the respiratory signal within 0 to 0.1 Hz (the cut-off frequency) becomes smaller and smaller as the order of the Butterworth bandpass filter increases. We found in our experiments that the second-order Butterworth bandpass filter can already eliminate the low-frequency noise well enough compared to the first-order Butterworth bandpass filter as can be seen from
Figure 10d,f. At this point, increasing the order of the Butterworth bandpass filter again will not result in a significant improvement as shown in
Figure 10f,h,j, but will instead increase the computational complexity of the system. Therefore, this paper selects the 2nd-order Butterworth bandpass filter to extract the respiratory rate.
FFT is the main method for extracting respiration rate, and the frequency that corresponds to the maximum power is the respiratory rate we want. To obtain the respiratory rate of the human being, this paper performs FFT on the filtering results of the 2nd-order Butterworth filter. As shown in
Figure 11, the frequency 0.234616 Hz with the largest amplitude in the spectrum is the respiratory rate of the human being.
So far, this chapter has completed the extraction of the human being’s respiratory rate through the following three steps: removing the DC component in the respiratory signal, 2nd-order Butterworth bandpass filtering and FFT.
3.2.3. Waveform Reconstruction
In the actual environment, the waveform of the phase data may not be ideal, and it is difficult to display the respiratory state of the human being in real time. This section proposes a method to reconstruct the respiratory waveform, which consists of wavelet decomposition, differential processing and curve fitting.
First, wavelet decomposition [
40] is performed on the result of 2nd-order Butterworth bandpass filtering. Wavelet decomposition can effectively remove the high-frequency components in the respiratory signal, extract the low-frequency components of interest in this paper, and analyze the respiratory status of the human being. Wavelet decomposition is to express the signal as a linear combination of wavelet functions in the signal space
, and
can be written in the following form:
where
is the initial scale function space,
are the subspaces from the 0th-order wavelet to the nth-order wavelet tensor, and ⨁ is Exclusive OR function. With each wavelet decomposition, the scale function is reduced by 1 order, and the resolution of the respiratory signal in the frequency domain is reduced to 1/2 of the original. The wavelet decomposition process is given by:
where
is the wavelet function term,
is the scale function, and
is the wavelet function generated by
and some set of coefficients
defined as follows:
In RFID technology, the sampling frequency of the reader is affected by a variety of factors, such as the distance between the reader antenna and the tag, the orientation of the tag and the type of tag, etc. The sampling frequency of the reader is not a constant value. In this paper, the number of layers
n of wavelet decomposition should be selected according to the specific sampling frequency
of the reader. For the human respiratory signal, this paper has found that the reconstruction waveform is more ideal when the frequency resolution of wavelet decomposition is within 0.6 Hz∼2.0 Hz. Because the human respiratory rate is approximately 12 to 16 bpm [
30], in order not to miss the information related to human respiration, we chose a value of 18 bpm (0.3 Hz), which is slightly larger than 16 bpm and easy to calculate, as the lower bound. According to the Shannon Sampling Theorem [
41], in order to recover the complete respiratory signal, our sampling frequency
. In addition, in order to prevent the mixing of high-frequency noise, our sampling frequency
because the human respiratory rate generally does not exceed 60 bpm (1.0 Hz). Therefore, the number of layers
n of wavelet decomposition should satisfy Equation (
12). The calculation of
n can be deduced as shown in Equation (
13), where
represents the integer field. The reason for taking the maximum value is that we prefer the frequency after wavelet decomposition to be closer to 0.3 Hz (18 bpm) which is a relatively common respiratory rate. For easy understanding, we have given an example in
Figure 12, the sampling frequency of the reader
which can be calculated from the timestamps and the number of samples. According to Equation (
13),
, and the wavelet decomposition result is shown in
Figure 12f. When
, there is high-frequency noise in the waveform as can be seen in
Figure 12a–e. When
, the respiratory information will be lost as can be seen in
Figure 12g,h.
The Daubechies wavelet [
42] has better regularity, the smooth error introduced by this wavelet is relatively small. The db1 wavelet (Haar wavelet) does not have symmetry and will produce some phase distortion when performing signal analysis and reconstruction. In addition, the smoothness of the Daubechies wavelet increases as the order increases, but the computational effort increases. Considering the above reasons, we use the Daubechies 2 (db2) wavelet in this paper. The initial phase data returned by bandpass filtering (input for wavelet decomposition) and the result of 5-layer wavelet decomposition are shown in
Figure 12. It can be seen that for the 5-layer wavelet decomposition, all the high-frequency details of the respiratory waveform have been removed and only the low-frequency contours are retained. Based on this phenomenon, the idea of reconstructing the respiratory waveform in this paper is to find the maximum values and minimum values of the 5-layer wavelet decomposition result, consider the resulting extreme values sequence as the peaks and troughs of the respiratory waveform, and use this extreme values sequence to reconstruct the respiratory waveform. In
Figure 12b, the maximum values and the minimum values of the 5-layer wavelet decomposition result are represented by blue ▴ and red ▾, respectively.
The magnitude of the phase change during a respiratory activity should not be too small. Based on this principle, the current extreme values used to reconstruct the respiratory waveform should satisfy Equation (
15), and this paper filters the extreme values sequence accordingly.
where
is the current extreme value,
is the previous extreme value,
is the average of the maximum values,
is the average of the minimum values, and
is a constant of proportionality (
is 0.5 in this paper).
Then, a differential processing is performed on the extreme value sequence
. The differential processing can reduce the irregular fluctuation of the phase data and highlight the change trend of the phase. The result of differential processing is
, where
. In a respiratory activity, for the adjacent peaks and troughs in the phase sequence, the phase value at the peak should be greater than the phase value at the trough. Based on this principle, any two adjacent values of the differential processing results should satisfy Equation (
16), and this paper filters the differential processing result accordingly.
Finally, Cubic Spline Interpolations [
43] is applied to the result of the differential processing to obtain the final reconstructed respiratory waveform. The final result is shown in
Figure 13, which shows that the reconstructed respiratory signal can show the respiratory status of the human being more clearly.
At this point, this chapter has completed the reconstruction of the respiratory waveform of the human being through wavelet decomposition, differential processing and Cubic Spline Interpolation.