HOW TO IMPLEMENT PPG SIGNAL USING AUTOMATIC MULTISCALE PEAK DETECTION ALGORITHM

7 views (last 30 days)
Let 12[,,,,,]iNxxxxx be a given univariate uniformly sampled signal containing a component of periodic or quasi-periodic peaks. The first step of the automatic multiscale-based peak detection (AMPD) algorithm consists of calculating the local maxima scalogram (LMS). To this end, the signal x is first linearly detrended, i.e., the least-squares fit of a straight line to x is calculated and subtracted from x. Then, the local maxima of the signal x are determined using a moving window approach whereby the window length kw is varied {2|1,2,,}kwkkL with k the k-th scale of the signal and /21LN where z is the ceiling function that gives the smallest integer not less than z. This is realized for every scale k and for 2,,1ikNk according to 1111,0,,otherwiseiikiikkixxxxmr (1) where r is a uniformly distributed random number in the range [0, 1] and α a constant factor (α = 1). For 1,,1ik, and for 2,,iNkN the value r + α is assigned to ,kim. These operations of Equation 1 result in the matrix Algorithms 2012, 5 590 1,11,21,2,12,22,,,1,2,()NNkiLLLNmmmmmmmmmmM (2) where the k-th row contains the value for the window length kw. Thus, all elements of the L × N matrix M are in the range of [0, 1 + α]. The matrix M is called the LMS of the signal x. The second step of the algorithm comprises a row-wise summation of the LMS matrix M ,1Nkkiim, for {1,2,,}kL (3) The vector 12[,,,,,]iLγ contains the information about the scale-dependent distribution of zeros (and thus local maxima). The global minimum of γ, argmin()k, represents the scale with the most local maxima. This value λ is used in the third step of the algorithm to reshape the LMS matrix M by removing all elements ,kim for which k > λ holds, leading to the new λ × N-matrix ,()kimrM, for {1,2,,}iN and {1,2,,}k. In the last step of the algorithm, the peaks are detected by (i) calculating the column-wise standard deviation of the matrix rM according to 122,,11111ikikikkmm, for {1,2,,}iN (4) and (ii) find all indices i for which 0i  holds. These values are stored in the vector ˆ12[,,,,]qNppppp with ˆN the total number of detected peaks of the signal x. p refers to the indices of the detected peaks. We found empirically that for quasi-periodic input signals the highest frequency max()f of the oscillation should not be larger than 4 times the lowest frequency min()f, i.e., maxmin4ff. Thus, using this AMPD algorithmic framework, every value of a given signal 1 2 [ ,,,,,] i N x xxx x  is detected as a peak when the column-wise standard deviation of the matrix r M meet the criterion 0i . Figure 1 summarizes visually the steps of the AMPD algorithm and Figure 2 shows an example of applying the AMPD algorithm to a simulated noisy multicomponent signal x , defined as 1 2 [ ,,,,,] i N x xxx x  , with 123{sin(2/)sin(2/)sin(2/)}iSSSixaffbffcffd for {0,0.1,,}iN where 800HzSf,110Hzf,270Hzf,35Hzf, a = 1, b = 1, c = 0.5, d = 0.1 and  a normally distributed random number in the range [0, 1

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!