Pharmaceutical & medical
The DPT is somewhat difficult to implement because the basis functions are comprised of sets of complex functions that are mostly incommensurate and differ one from another by the sample period. An efficient DPT transform uses the basis phase angles shown in Figure 3. This is the form that was used in the implementations herein.
MATLAB Proof of Concept Model Equation 4 was implemented in a MATLAB script. An example plot is shown in Figure 4 using sine and cosine functions as inputs with amplitudes of ±1 and periods of 45 ms, 79 ms, and 175 ms. The MATLAB script was limited to periods between 400 ms (200 periods/min) and 2 s (40 periods/min). A fixed total of 5000 data samples were processed for this example. Since the input data are sinusoidal wave- forms with unity amplitudes, the amplitudes of each period are also unity. One can easily see the great resolution that this transform offers.
Figure 1. Fourier transform sine basis functions where the red is the first harmonic (1 Hz), blue is the second (2 Hz), and green is the third (3 Hz).
The DFT basis functions have the same ordinate value as the previous Nth
ordinate value for each
harmonic shown in Figure 1. This occurs because all the harmonics in the DFT are commensurate such that the higher harmonics are exact multiples of the lower harmonics.
The term N in the DPT must be modified for each period since the periods are not simply multiples of each other, yet vary by one sample period as shown in Figure 2.
Both of the sliding forms DFT and the DPT require an implementation that has circular or recurrence buffers that hold a fixed number of the most recent samples. One buffer is used when the input data is real, while two buffers are employed when the input data is complex. The ith
sample of the DPT transform
can be written as shown in Equation 3. Where the term RBS is the recurrence buffer size,
TL is the length of the longest period, and TN is the period of the current basis element being processed.
Doing this allows the beginning and ending ordinate values for each basis period to have the same value. The period s extends from the minimum period to the maximum period chosen to cover the periods in the sampled data. The implementation utilises a set of basis functions that are the incremental phase angles of the complex sinusoids shown in Figure 2.
Figure 3. Period transform basis phase angles showing the values of the complex phase angles for increasing number of sample periods per minute. The ascending curve shows the cosine phase angles and the descending curve shows the sine phase angles.
The phasors are easily derived using Equation 4, where s is the set of periods from the minimum chosen period to the maximum chosen period in steps of the sample period.
Algorithm Implementation
The sliding DPT transform is implemented as an IIR filter and has a signal flow diagram of a comb filter followed by a resonator, as does the implementation of the sliding form of the DFT. The comb filter delay of N samples causes the transient response to be N–1 samples in length. Heart rate tuned comb filters have been used by others with some success. Since the components of the DPT complex basis functions or phase angles are not all harmonically related, the end points of these functions do not always form continuous functions in the sample space as the DFT does. However, implementing the DPT as a sliding transform wraps the basis functions, allowing the component basis functions to become continuous. As the data and basis functions slide by, and the correlation is computed, basis function continuity is maintained.
Figure 2. Period transform complex sinusoidal basis functions for three adjacent sin and three adjacent cos functions. This example assumes that these
Instrumentation Monthly January 2025
In a sliding window algorithm, a window of length N is slid over a data array of indeterminate length. In the case of the DPT, two recurrence buffers are maintained because the DPT can process both real and imaginary input data. If the input has only a real component, which is often the case, only one recurrence buffer is used. However, the results can still be complex depending on the phase relationship between the input and the basis functions. The results are stored in two ensemble buffers, each with a length of the chosen maximum period.
Figure 4. Amplitude spectrum showing the values from three sets of input sinusoidal data that are incommensurate relative to each other.
The results for a sinusoidal cosine wave with a period of 73 periods per minute and with amplitude of 4.5 are shown in Figure 5. In this example, a recurrence buffer with a length of 1500 data points was used. Note that there are some small errors, with an amplitude error of 0.366 per cent and a period error of 0.234 per cent. The size of these errors is generally acceptable for biomedical applications. These errors are of no consequence with peripheral capillary oxygen saturation (SpO₂) measurements since the SpO₂ is calculated ratiometrically with the ratio of ratios of the red and infrared spectrophoto- metric signals. See Equation 6 and Equation 7.
Figure 5. The sliding period transform for a cosine waveform with a period of 73 periods per minute and amplitude of 4.5. The amplitude error is
RESULTS
Sliding Window DPT Use in Pulse Oximetry
For sliding window algorithms to operate properly Continued on page 84...
83
Page 1 |
Page 2 |
Page 3 |
Page 4 |
Page 5 |
Page 6 |
Page 7 |
Page 8 |
Page 9 |
Page 10 |
Page 11 |
Page 12 |
Page 13 |
Page 14 |
Page 15 |
Page 16 |
Page 17 |
Page 18 |
Page 19 |
Page 20 |
Page 21 |
Page 22 |
Page 23 |
Page 24 |
Page 25 |
Page 26 |
Page 27 |
Page 28 |
Page 29 |
Page 30 |
Page 31 |
Page 32 |
Page 33 |
Page 34 |
Page 35 |
Page 36 |
Page 37 |
Page 38 |
Page 39 |
Page 40 |
Page 41 |
Page 42 |
Page 43 |
Page 44 |
Page 45 |
Page 46 |
Page 47 |
Page 48 |
Page 49 |
Page 50 |
Page 51 |
Page 52 |
Page 53 |
Page 54 |
Page 55 |
Page 56 |
Page 57 |
Page 58 |
Page 59 |
Page 60 |
Page 61 |
Page 62 |
Page 63 |
Page 64 |
Page 65 |
Page 66 |
Page 67 |
Page 68 |
Page 69 |
Page 70 |
Page 71 |
Page 72 |
Page 73 |
Page 74 |
Page 75 |
Page 76 |
Page 77 |
Page 78 |
Page 79 |
Page 80 |
Page 81 |
Page 82 |
Page 83 |
Page 84 |
Page 85 |
Page 86 |
Page 87 |
Page 88 |
Page 89 |
Page 90 |
Page 91 |
Page 92 |
Page 93 |
Page 94 |
Page 95 |
Page 96