In compressed sensing, the reconstruction quality of a signal is not only related to the selection of the measurement matrix but also to the reconstruction algorithm of the signal. A good reconstruction algorithm can more closely approximate the original signal and reduce the error before and after reconstruction. In this study, we mainly considered the SWOMP algorithm and improved it.
3.3.1. Stagewise Weak Orthogonal Matching Pursuit Algorithm
The SWOMP algorithm [
23] is an extension of the OMP algorithm, which selects the optimal atom for changing the index set according to the requirements of the inner product criterion metric. Unlike the OMP algorithm, only one maximum value is selected from the correlation vector at a time. SWOMP sets a threshold value when selecting an atom. Each iteration selects an atom greater than or equal to the threshold in the correlation vector and selects the corresponding atomic index. Incorporating atoms into the index set and support set improves the efficiency of the refactoring. In addition, SWOMP is also different from the stagewise orthogonal matching pursuit (StOMP) algorithm [
24]. When selecting an atom, the selection of the threshold value is related to the residual coefficient by using the "weak selection" method, which reduces the requirement for the measurement matrix. Moreover, the OMP algorithm needs to input the sparsity
k as a priori information, but the sparsity
k value is often difficult to obtain. The SWOMP algorithm does not need the sparsity
k value, and the signal can be reconstructed by setting the appropriate threshold and the number of iterations. Therefore, the SWOMP algorithm has a comparative advantage when reconstructing cardiac signals.
The reconstruction steps of the SWOMP algorithm are as follows.
SWOMP algorithm: |
Input parameters: observation y, measurement matrix Φ, number of iterations S, threshold value . |
Output parameters: sparse signal . |
Initialization: signal margin r = y, sparse signal , index set , number of iterations k = 1, support set . |
(1) Calculate the correlation coefficient . |
(2) Select a value greater than in u and constitute the serial number corresponding to the selected value to form set . |
(3) Update the index set and the support set; let and . If , stop iteration, and turn to Step (6). |
(4) Calculate the least-squares solution of , and update the residual . |
(5) Let k = k + 1. If , return to Step (2); otherwise, stop iteration. |
(6) Output sparse signal. |
Here,
has a value range of
and the threshold
,
represents the atom of the corresponding index set in the measurement matrix, and
is the reconstructed sparse signal. In order to verify the reconstruction performance of SWOMP, the redundant dictionary was selected as the sparse representation, the Gaussian random measurement matrix was used to observe the signal, and the SWOMP algorithm was used to reconstruct the signal.
Figure 3a,b shows the reconstruction effects of the ECG and PPG signals under the SWOMP algorithm, respectively. The CSR of the ECG signal was 0.7 with a threshold value of
; the CSR of the PPG signal was 0.5, with a threshold value of
. It can be seen from the figure, before and after reconstruction, that the characteristics of the ECG and PPG signals were basically retained without obvious distortion.
However, the SWOMP algorithm also has some defects. The SWOMP algorithm selects the atomic update support set according to the established threshold value , and the number of iterations S also needs to be artificially set. These two values are usually set empirically, which makes the SWOMP algorithm quite unstable. Because, usually, the choice of value has a great influence on the reconstruction effect of the algorithm, if the value of is too large (small), the number of selected atoms will be too small (more), which will result in poor signal reconstruction. Similarly, the selection of iterations number S also has an effect on the number of atoms selected. Moreover, the SWOMP algorithm selects multiple atoms larger than the threshold value at one time, unlike the OMP algorithm, which selects the best matching atom at one time. Although the reconstruction efficiency is improved and the requirement for the measurement matrix is reduced, the accuracy of reconstruction decreases when the selected atoms are not particularly suitable. So, the SWOMP algorithm needs further improvement in terms of atomic number selection.
3.3.2. Improved Stagewise Weak Orthogonal Matching Pursuit Algorithm
First, two propositions are given:
Proposition 1: When the measurement matrix Φ satisfies the constraint equidistant property (RIP) with the parameter
, if
, then
is the true proposition [
25].
Proposition 2: The inverse of Proposition 1. When the measurement matrix Φ satisfies the constraint equidistant property (RIP) with the parameter , if there is , then is also a true proposition.
Here, is the estimated sparse value, k is the actual sparse value, is the index set corresponding to atoms, is the transpose of , and is the set of atoms in the corresponding index set in the measurement matrix.
According to Proposition 2, an initial sparsity estimate
is obtained, and
is selected as the initial minimum value of the atom. If the initial number of selected atoms is less than
, the modified threshold value
is reselected to the atom, ensuring the minimum value of the selected atom [
26]. At the same time, combined with the idea of the sparsity adaptive matching pursuit (SAMP) algorithm [
27], the algorithm can iterate adaptively according to the initial step size and initial residual. It is no longer necessary to set the iteration number
S according to the empirical value. The iterative process is divided into several stages, and the phased selection of atoms in the support set is achieved according to the step size. As the iteration proceeds, the step size is updated and the support set is expanded. The iteration termination condition of the new algorithm is that the number of atoms in the support set will reach a certain number
. In order to prevent the number of atoms from being overselected, and to ensure the reconstruction accuracy, a number of reconstruction experiments were performed on ECG and PPG signals. From the experiments, it was found that the accuracy of reconstruction can be guaranteed when the maximum number of atoms does not exceed M/2. So, the maximum number of atoms was selected as M/2 in the improved algorithm and
(
M was the measured number). At the same time, after the atoms were selected at the threshold, the atoms were arranged in descending order to ensure that the most-matched atomic value was selected in the first place, so as to improve the reconstruction accuracy of the algorithm.
The steps of the improved sparsity weak adaptive matching pursuit (SWAMP) are as follows.
Input parameters: observation y, measurement matrix , threshold , initial step size , . |
Output parameters: sparse signal . |
Initialization: signal margin , sparsity , sparse signal , index set , , support set , maximum atomic number . |
(1) Calculate the correlation coefficient u by the formula , and select an index corresponding to the maximum values from u to be stored in the index set . |
(2) If , then ; turn to Step (1). |
(3) Select T in that are greater than . If , decrease the threshold value α; turn to Step (3). If , increase the threshold value ; turn to Step (3). |
(4) Sort the selected atoms in Step (3) in descending order and select the first values. The corresponding serial numbers of the selected values constitute the set , so and . |
(5) Determine the initial residual for initialization stage . |
(6) Select T values greater than in , combine the sequence numbers corresponding to the selected values into a set , and judge the selected atoms in descending order. If the number in set is less than or equal to the current step length L, turn to Step (7); if the number is greater than L, select the first L values and turn to Step (7). |
(7) Update the index set and the support set, let , and check the number in . If it is greater than , terminate; otherwise, . |
(8) Calculate the least-squares solution of and update the residuals . |
(9) Check the margin . If , terminate; otherwise, , , and turn to Step (6); |
(10) Output sparse signal . |
In order to more accurately compare the performance of these two reconstruction algorithms, a signal-to-noise ratio (SNR) was introduced as an evaluation index [
28]. The SNR is defined in Equation (1):
where x is the original signal and
is the reconstructed signal. At the same time, the SWAMP and SWOMP algorithms were simulated and analyzed. The experiment followed the previous data, choosing the redundant dictionary as the sparse representation and the Gaussian random measurement matrix as the observation matrix. The range of the threshold was [0.60, 0.95], the compression ratio was 0.7, and the sparsity
k was 100. To reduce the effect of the uncertainty of the random measurement matrix, the average was determined from 20 repetitions of the process.
Figure 4a,b shows the number of atoms selected by the SWAMP and SWOMP algorithms under different threshold values. It can be seen from
Figure 4a,b that when the threshold is small, the SWOMP algorithm excessively selects atoms; when the threshold is large, the SWOMP algorithm selects fewer atoms. Because the maximum expansion set of atomic selection is set, the atomic selection of the SWAMP algorithm is relatively stable, which is within the range of the maximum number of atoms specified by the algorithm.
Through the above analysis, we know that the choice of atomic number affects the reconstruction quality of the algorithm.
Figure 5a,b shows the SNR of the algorithm at different threshold values. It can be seen from the figure that when the threshold values of ECG and pulse signals were taken as [0.65, 0.95], the SNR of the SWAMP algorithm did not change much and was stable within a certain range, and the reconstruction accuracy was higher than that of SWOMP. However, the SNR of SWOMP varied greatly, and only when the threshold value was greater than 0.85 did it have a higher SNR, indicating that the SWAMP algorithm has higher reconstruction accuracy and is more stable than the SWOMP algorithm.
In order to further verify the reconstruction performance of the SWAMP algorithm, the matching rate (MR) and root mean squared error (RMSE) were used to evaluate the quality of the reconstructed signal. The definition of the MR is shown in Equation (2) and the definition of the RMSE is shown in Equation (3):
where x is the original signal and
is the reconstructed signal. Comparing the RMSE and MR values of the two algorithms under different compression ratios, the smaller the RMSE value, the larger the MR value, and the better the reconstruction performance of the algorithm.
Table 1 and
Table 2 show the reconstruction performances of the ECG and PPG signals under different compression ratios and compare them. It can be seen from the tables that, under the same compression ratio, the MR value of the SWAMP algorithm was greater than that of the SWOMP algorithm, and the RMSE value of the SWAMP algorithm was less than that of the SWOMP algorithm, indicating that the reconstruction effect of the SWAMP algorithm is better than that of the SWOMP algorithm, and that it has better reconstruction performance.
The quality of an algorithm is also closely related to the reconstruction time. Reconstruction time is another indicator for judging the performance of a reconstruction algorithm.
Figure 6a,b shows the ECG and pulse signal run times for the SWAMP, SWOMP, and OMP algorithms under different compression ratios.
It can be seen from
Figure 6 that, because the threshold value was corrected and the minimum atomic selection value
k was selected, the SWAMP algorithm’s run time was increased compared with the SWOMP algorithm, but the difference was not large. The run time was fast compared with the OMP algorithm, which ensured the reconstruction efficiency of the algorithm. At the same time, the SWAMP algorithm was more stable than the SWOMP algorithm, and the reconstruction accuracy was also improved. So, the SWAMP algorithm had better reconstruction performance.