Skip to main content
. 2017 May 30;17(6):1240. doi: 10.3390/s17061240
Algorithm 3: Step by step construction of the vital signal from the best fit signals
(1) Initialization
Find “k” best-fit signals whose R-square values are above certain set threshold, say R-square_min = 0.3.The size of each best-fit signal is 256 samples. So, we have a matrix of best_fitmatrix (k×256). In our example, k = 9.
(2) for iterations=1:last_zero_crossing
If (iteration == 1)
Then Find the first zero-crossing fast time index (zero_crossings) of all the “k” best-fit signals. And find the sub-signal component, which has the maximum value of zero_crossings
For our example, first_zero_crossings are found to be as follows:
first zero_crossings=[234 231 223 231 230 235 224 220];
max_zero_index=max (zero_crossings) = 235;
k_max_crossing=argmaxk(zero_crossings)=6
Construct the vital signal according to the following expression, the result is shown in Figure 8.
constructed_vital_signal(1:max_zero_index)=best_fit_matrix(k_max_crossing,1:max_zero_index)
For our example; Figure 8 show the construction of first sub-signal component of the vital signal:
constructed_vital_signal(1:235)=best_fit_matrix(6,1:235);
Else if (iteration > 1) Find the next zero-crossing fast time index (zero_crossings) of all the “k” best-fit signals
for i=1:k
Append the ith sub-signal component to the previously constructed vital signal.
Find the correlation of the resulting signal
correlation(i)=autocorr([constructed_vital_signal; ith sub_signal_component]);
end
max(width_correlation(i)); i=1:k
Append that sub-signal component to the previously constructed vital signal, which has maximum correlation as found by the above expression.For our example, when iteration = 2:
second zero_crossings = [354   359   351   344   347   360   354   351];
After we appended each sub-component to the previously constructed vital signal and found the correlation of each signal, it was found to be:
correlation =[17.1  13.3  18.3  9.3  16.2  23.8  18.2  22.8];
kmaxcorr=argmaxk(correlation)=6
max_corr_index=argmaxzero_crossings (correlation)=360
Here the 6th signal sub-component shown the maximum correlation with the previously constructed signal. Now we append the next sub-signal component of the 6th signal to the previously constructed vital signal to find the constructed_vital_signal as follows in Figure 9.
constructed_vital_signal(end:max_corr_index)=best_fit(k_max_corr,end:max_corr_index)
where end=length(previous constructed vital signal)+1
For our example:
constructed_vital_signal (236:360) = best_fit_matrix (6, 236:360);
(3) Check, if: there are further zero crossings, then go to step 2
Else; stop the loop;
Save; the constructed_vital_signalThe final vital signal obtained is given in the Figure 10.
end