1 Introduction

Biosignal monitoring acquires and transmits signals, detects abnormal signals, and checks the user’s health in real time (Meng et al. 2019; Lee et al. 2019a). The electrocardiogram (ECG) signal is a representative biosignal used for the early diagnosis of heart disease, and biosignal monitoring studies on the ECG signal are being actively conducted as the mortality rate due to heart disease increases (Arshad et al. 2016). In addition, it is used for smart home elderly care, security, human activity, and so on (Rhim et al. 2018; Teraoka 2012).

The abnormal beat used for an arrhythmia diagnosis of the ECG signal requires a long-time measurement because its frequency of occurrence is low. In addition, feature values, such as amplitudes, intervals, and segments, are acquired based on the detection of fiducial points (FPs), such as the onset (start of waveform) and offset (end of waveform) of each waveform, and the abnormal beat is classified based on these feature values (Lee and Park 2021b; Lee et al. 2017; Yazdani and Vesin 2016; Lin et al. 2014; Martinez et al. 2010; Illanes-Manriquez and Zhang 2008; Madeiro et al. 2012; Laguna et al. 1994). Therefore, a high sampling frequency is required for accurate FP detection.

To store and transmit a signal acquired for a long time at a high sampling frequency, an effective signal compression technique is required. Signal compression is classified into frequency- and time-domain compression; wavelet-based signal compression (Bera et al. 2020) is a representative frequency-domain compression method. The linear approximation method is a time-domain signal compression technique in which a small number of vertices represent a signal (Lee and Park 2021a; Lee et al. 2019b). In particular, linear approximation includes FPs as vertices and enables effective detection by emphasizing the feature values of the FPs. In addition, as FPs can be detected by analyzing the vertices’ feature values obtained through linear approximation, it has the advantage of not having to detect FPs after reconstructing the compressed signal.

In this article, a method that enables the compression of ECG signals effectively based on the characteristics of linear approximation and detection of abnormal beats without signal reconstruction from an approximated signal is proposed. ECG signals are periodically sampled, so they consist of a large amount of amplitude information. The amplitude information is the same as that of the input signal, but additional time information is required because the vertices of an approximated signal are aperiodic. The time information on the vertices of an approximated signal requires a large amount of data because the ECG signal is measured for a long time, which significantly reduces the compression rate (Lee and Park 2020). In this article, we improve signal compression rate by storing the time difference from the previous vertex instead of the time information of the vertex based on the constraint of the time difference between the vertices used in the linear approximation.

Further, we acquire the width of the QRS complex using the FPs of the QRS complex, which are obtained from the approximated vertices. By confirming that the proposed method enables the detection of abnormal beats, including premature ventricular contractions (PVCs), which increase the width of the QRS complex, we confirmed that the proposed method enables FP detection and abnormal beat detection without signal reconstruction from the approximated signal. Figure 1 shows the flowchart of the proposed method.

Fig. 1
figure 1

Flowchart of the proposed method

The rest of this article is organized as follows. Section 2 introduces the composition of ECG signals and characteristics of abnormal beats. Section 3 introduces the process of linear approximation and FP detection in detail. Section 4 introduces the proposed signal compression method, followed by the abnormal beat detection method. In Sect. 5, we assess the performance of the proposed method experimentally. Finally, we conclude this study in Sect. 6.

2 ECG signal

2.1 Composition of ECG signal

During depolarization and repolarization of the atrium and ventricle, the P-wave, QRS complex, and T-wave are measured in the ECG signal (Huszar 2007). The feature values of each waveform are obtained using the intervals, segments, and amplitude difference between FPs.

Figure 2 shows the composition of the FPs and feature values of an ECG signal.

Fig. 2
figure 2

Composition of FPs and feature values of ECG signal

Among FPs, the R-peak has the highest amplitude value. Therefore, R-peak detection is relatively easy and can be accomplished accurately through postprocessing correction (Pan and Tompkins 1985; James 2015). Based on these characteristics, the R-peak becomes a criterion for classifying beats and is used for detecting other FPs.

Each beat is classified through the R-peak; two methods are generally used for separating the beats. The first method divides the beats into the region of 275 ms before and 375 ms after the R-peak (Li et al. 2010). This R-peak centered region includes the P-wave, QRS complex, and T-wave, which are mainly used for ECG signal analyses. However, some data samples are missing. The second method divides the beats using the RR interval, thereby minimizing the approximation error by approximating all data. Figure 3 shows the two methods of beat separation.

Fig. 3
figure 3

Beat separation methods: a centering on the R-peak and b RR interval

In this article, the beats are separated according to the RR interval (Fig. 3b).

2.2 Characteristics of abnormal beat

Abnormal beats due to arrhythmia appear as a change in the shape or period of a waveform in an ECG signal. Figure 4 depicts an example of a typical abnormal beat: PVC.

Fig. 4
figure 4

Example of PVC

As shown in Fig. 4, PVC (V) has a short RR interval and deformed QRS complex compared with a normal beat (N). The variation of the RR interval can be determined through the R-peak detection. To detect a deformed QRS complex, various features, such as the amplitude and kurtosis of the R-peak and the width of the QRS complex, are used, or the abnormal beats are classified by learning the normal beat’s shape (Ou et al. 2020). In addition, a deep learning method using convolutional neural network architecture has been used for abnormal detection (Ozdemir et al. 2020).

In this study, we employed the width of the QRS complex to use the information on the FP for the onset and offset of the QRS complex acquired via linear approximation.

2.3 FP detection

Abnormal beat classification is divided into shape- and feature-based classifications. Feature-based classification requires each waveform’s FPs (Fig. 2). As mentioned above, among the FPs, the R-peak has the largest amplitude value in the beat, so it is easy to detect, and the detection is reliable. A representative R-peak detection method is Pan’s method. The R-peak detection results are used to classify beats, and the amplitude and RR interval of the R-peak are used for abnormal beat detection.

Based on the R-peak detection results, various FP detection methods, such as the onset and offset of the QRS complex and P-wave are being studied. However, unlike the R-peak, the onset and offset of the QRS complex and P-wave are non-local extremum points, so they are ambiguous and difficult to detect. To detect FPs, an auxiliary signal is acquired using a method, such as differentiation (Laguna et al. 1994) or Hilbert transformation (Manriquez and Zhang 2007). Thus, it is necessary to reconstruct the compressed signal because the existing FP detection methods require an auxiliary signal. In addition, there is a problem of having a different FP detection result from that of the input signal due to the reconstruction error.

To mitigate the abovementioned issues, we propose an efficient signal compression method using linear approximation. In addition, we confirm that abnormal beats can be detected by detecting FPs and acquiring the feature values without signal reconstruction based on the characteristics of the FP detection using only the approximated vertices.

An embedded device acquires an ECG signal, compresses the preprocessed signal through linear approximation, and transmits the signal. The preprocessing consists of noise suppression to detect a stable beat (Mohd Apandi et al. 2020), R-peak detection to separate the beats, and beat separation according to the RR interval (Fig. 2b). The analysis device detects FPs and acquires feature values without signal reconstruction from the approximated signal as well as analyzes feature values to detect abnormal beats. In this article, we confirm that abnormal beats can be detected from an approximated signal using the width of the QRS complex obtained from the detection of the onset and offset of the QRS complex.

3 Linear approximation

An approximation is a representative signal compression method in the time domain; linear approximation and B-spline are typical methods. Approximations effectively express a signal using a small number of vertices. B-spline is widely used because it guarantees signal continuity and has a low reconstruction error; however, the amount of computation and storage usage significantly increase, making it difficult to implement in embedded devices. In addition, B-spline requires FP detection after signal reconstruction because the location of knots does not coincide with FPs. By contrast, the linear approximation method is simple to implement in an embedded device but also represents the FP that is the boundary between the baseline and the waveform as a vertex.

Figure 5 shows the concept of the linear approximation method.

Fig. 5
figure 5

Illustration of linear approximation: a existing method and b linear approximation

As shown in Fig. 5a, the detection of FPs, such as the onset or offset, is difficult because the FPs do not have a maximum or minimum amplitude. In addition, it is ambiguous to determine an FP because the samples around FPs have similar feature values.

However, linear approximation has the advantage of representing the FP corresponding to the boundary between the waveform region with large amplitude change and the baseline region with small amplitude change as a vertex (Fig. 5b) because it represents a signal with a small number of vertices. In addition, it is possible to emphasize the feature values of vertices by representing them as a few vertices.

The input signal is divided into RR intervals based on R-peak detection, and an independent linear approximation is performed for each beat. The linear approximation proposed by Lee et al. (2018) proceeds in three stages—initial vertex selection, additional vertex selection, and error optimization. In addition, Lee et al. (2019c) and Lee and Park (2020) improved dynamic programming used in the optimization step according to the ECG signal’s characteristics.

3.1 Initial vertex selection

First, a point with a large curvature is obtained as an initial vertex using a curvature-based linear approximation (Mokhtarian and Suomela 1998). The curvature is the amount by which a curve deviates from being a straight line, and it is calculated as (1) using the included angle between three points:

$$\delta \left(Y;X,Z\right)=\frac{\overrightarrow{a}\times \overrightarrow{c}}{\left|\overrightarrow{a}\right|}=\frac{\left({x}_{1}-{z}_{1}\right)\left({x}_{2}-{y}_{2}\right)-\left({x}_{2}-{z}_{2}\right)\left({x}_{1}-{y}_{1}\right)}{\sqrt{\left({x}_{1}-{z}_{1}\right)+{\left({x}_{2}-{z}_{2}\right)}^{2}}}, {x}_{1}>{y}_{1}>{z}_{1}.$$
(1)

Figure 6 shows the concept of the curvature calculation process and an example of the approximated signal.

Fig. 6
figure 6

Curvature-based linear approximation: a concept of curvature and b example of an approximated signal

3.2 Additional vertex selection

Curvature-based linear approximation well-expresses an FP as an initial vertex because it is a point with a large curvature. However, if the waveform’s amplitude change is low, it might not be acquired as the initial vertex, as shown in QRS-onset and P-offset in Fig. 6b. To correct this, additional vertices are obtained using a sequential linear approximation for the inside of each initial vertex (O’Connell 1997).

Figure 7 shows the concept of the sequential linear approximation process and an example of the approximated signal of Fig. 6b.

Fig. 7
figure 7

Sequential linear approximation: a concept of method, and b approximation result of Fig. 6b

As shown in Fig. 7a, a vertex is added when the error exceeds the threshold \({D}_{max}\), and the signal was effectively approximated (Fig. 7b).

3.3 Error optimization

Global error optimization calculates the costs for all cases and detects the minimum case as an optimization result. Therefore, the problem of optimizing the position of \(N\) vertices for \(L\) samples generally has a complexity of \(O\left({L}^{N}\right)\). Dynamic programming (Bellman and Dreyfus 2015) is a global optimization technique in which the optimal path between two points is optimized based on Bellman’s optimal principle as the globally optimal path between any two points on the global path. The recursive approach simplifies and optimizes the problem, especially using memoization to remember the computational results, which eliminates redundant operations. Dynamic programming enables high-speed global optimization but requires additional memory for memoization, which consists of cost and base matrices. In this case, the size of the cost and base matrices required for memoization is \(O\left({L}^{2}N\right)\).

Figure 8 shows the cost and base matrices used for memoization of dynamic programming.

Fig. 8
figure 8

Cost and base matrices for memoization of dynamic programming

For a signal with length \(L\), the optimization of the partial signal from \(i\) to \(j\), including the \(k\) vertices, is recursively calculated as follows:

$${C}_{k}\left(i,j\right)=\underset{{v}_{k} \in [1, \cdots ,\mathit{ L}]}{\mathit{min}}\left({C}_{k-1}\left(i, {v}_{k}\right)+{C}_{0}\left({v}_{k}, j\right)\right),$$
(2)

where \({v}_{k}\) denotes the position of the \(k\mathrm{th}\) vertex; when \(k\) = 0, \({C}_{0}\left(i, j\right)\) is calculated as an error between the input signal and the line connecting the ith and \(j\mathrm{th}\) samples.

Figure 9 shows the results of optimization using the dynamic programming shown in Fig. 7b).

Fig. 9
figure 9

Optimization results of Fig. 7(b)

As shown in Fig. 9, the signal is well represented with a small number of vertices, and dynamic programming reduces the reconstruction error.

3.4 Optimization of dynamic programming

Lee et al. (2019c) optimized the calculation of the cost and base matrices based on ECG signal characteristics, thereby improving the performance and enabling real-time operation even in embedded devices.

3.5 Improvement based on characteristics of ECG signals

The first and last vertices are fixed as initial vertices corresponding to both ends of the input signal. Therefore, in \({C}_{k}(i,j)\) of (2), \(i\) always becomes 1, and the existing cost matrix \({C}_{k}(i,j)\) can be expressed as \(C(k,j)\), as follows:

$$C\left(k,j\right)=\underset{1 < {v}_{k} <\mathit{ j}}{\mathit{min}}\left(C\left(k-1,{v}_{k}\right)+{C}_{0}\left({v}_{k}, j\right)\right)$$
(3)

By expressing \({C}_{k}(1,j)\) as \(C(k,j)\), the cost matrix of the size of \(O({L}^{2}N)\) is reduced to the size of \(O(NL)\). Thus, \(C(N,L)\) is an optimized error value when \(N\) additional vertices exist between the first and \({L\mathrm{th}}\) last samples, which represents the result of dynamic programming. In addition, the existing dynamic programming method optimizes by a recursive, top-down calculation method. However, improving the cost matrix fixes the area required for the calculation. Thus, the optimization can be done through a bottom-up operation without a recursive approach.

3.6 Adding limit of time difference between vertices

The amount of information is minimized by representing the vertex information as a time difference from the previous vertex. The maximum interval between the vertices is limited by the number of bits (\({N}_{Bit}={2}^{5}\) in this study) to indicate the time difference between the vertices. The cost matrix \(C(k,j)\) is calculated only when the interval between the \(k\mathrm{th}\) and \((k+{1)\mathrm{th}}\) vertices does not exceed \({N}_{Bit}\), as follows:

$$C\left(k,j\right)=\underset{{v}_{k+1}-{N}_{\mathit{Bit}} \le {v}_{k} < {v}_{k+1}}{\mathit{min}}\left(C\left(k-1,{v}_{k}\right)+{C}_{0}\left({v}_{k}, j\right)\right).$$
(4)

The computation for the base matrix is reduced because the time difference between the two vertices is limited by \({N}_{Bit}\).

3.7 Row-wise operation

The base matrix is sequentially called column by column when each component of the cost matrix is calculated in a column-wise operation, i.e., the \(j\mathrm{th}\) column of the base matrix is used only in the calculation of the cost matrix’s \(j\mathrm{th}\) column. Thus, the base matrix \({C}_{0}\left({v}_{k},j\right)\) in (4) can be expressed as follows:

$$C\left(k,j\right)=\underset{{v}_{k+1}-{N}_{\mathit{Bit}} \le {v}_{k} < {v}_{k+1}}{\mathit{min}}\left(C\left(k-1,{v}_{k}\right)+{C}_{0}^{j}\left({v}_{k}-\left({v}_{k+1}-{N}_{Bit}\right)+1\right)\right).$$
(5)

As shown in (5), the memory usage of the base matrix \({C}_{0}^{j}\) can be overwritten by \({C}_{0}^{j+1}\). Accordingly, the size of the base matrix can be minimized from \(O({L}^{2})\) to \(O({N}_{Bit})\) in a column unit vector.

3.8 Auxiliary signal

Without signal reconstruction, FPs are detected using the feature values of the approximated vertices. In this study, we detect the onset and offset of the QRS complex. The QRS interval is acquired from FPs, and abnormal beats are detected using this feature.

Various shapes of the QRS complex, such as downward waveform and the presence or absence of the Q-and S-peaks, make it difficult to detect FPs. To reduce the difficulty of extracting features from the QRS complex’s ambiguous shape, robust FP detection methods using various auxiliary signals, such as differentiating the signal, average filtering, and Hilbert transformation, have been proposed (Illanes-Manriquez and Zhang 2008; Pan and Tompkins 1985). Lee et al. (2018) used the cumulative signal of an approximated signal to preserve the morphological features of the vertices that represent FPs.

First, we obtain the amplitude difference (\({V}^{D}\)), as follows:

$$\begin{array}{c}{V}^{D}=\left\{{v}_{1}^{D}, \dots , {v}_{{N}_{V}}^{D}\right\}, {v}_{i}^{D}=\left({v}_{{x}_{i}}^{D}, {v}_{{y}_{i}}^{D}\right)\\ {v}_{{x}_{i}}^{D}={v}_{{x}_{i}}, {v}_{{y}_{i}}^{D}={v}_{{y}_{i}}-{v}_{{y}_{i-1}}, {v}_{{y}_{1}}^{D}=0.\end{array}$$
(6)

By accumulating the absolute value of the amplitude difference in (6), we generate the cumulative signal, as follows:

$$\begin{array}{c}{V}^{{D}^{^{\prime}}}=\left\{{v}_{1}^{{D}^{^{\prime}}}, \dots , {v}_{{N}_{V}}^{{D}^{^{\prime}}}\right\}, {v}_{i}^{{D}^{^{\prime}}}=\left({v}_{{x}_{i}}^{{D}^{^{\prime}}}, {v}_{{y}_{i}}^{{D}^{^{\prime}}}\right)\\ {v}_{{x}_{i}}^{{D}^{^{\prime}}}={v}_{{x}_{i}}^{D}, {v}_{{y}_{i}}^{{D}^{^{\prime}}}=\sum_{k=1}^{i}\left|{v}_{{y}_{k}}^{D}\right|.\end{array}$$
(7)

The cumulative signal monotonically increases, even if the QRS complex appears as a downward wave or includes Q- and S-peaks that appear as downward or upward waves (Fig. 10).

Fig. 10
figure 10

Comparison of cumulative signal results according to waveform type: a upward QRS complex, b cumulative signal of a, c downward QRS complex, and d cumulative signal of (d)

3.9 FP detection

The onset and offset are the boundaries between the waveform and baseline. The amplitude is low in the baseline region, and the amplitude change rapidly occurs in the waveform region. Thus, the FP in vertices has the following features shown in Fig. 11.

Fig. 11
figure 11

Vertex features for QRS onset

After obtaining the feature values of each vertex, amplitude difference (\({A}_{i}\)), time difference (\({T}_{i}\)), and angles with neighboring vertices (\({\theta }_{{i}_{L}}\) and \({\theta }_{{i}_{R}}\)) (Fig. 11), the vertex with the highest probability of being an FP is determined as follows:

$${v}_{{Q}_{on}}=argmax\left\{\frac{{A}_{{i}_{R}}}{\mathrm{max}\left({A}_{{i}_{R}}\right)}+\frac{{T}_{{i}_{R}}}{0.3}+\sqrt{cos{\theta }_{{i}_{L}}}+{\mathit{sin}}^{2}{\theta }_{{i}_{R}}\right\}.$$
(8)

Similarly, we can obtain the S-offset of the QRS complex. However, compared with the Q-onset, the distribution of the S-offset is unclear due to the influence of irregular T-wave, making it difficult to apply the proposed method. Therefore, in this study, based on the Q-onset detection result, the QR interval, which is the distance from the R-peak to Q-onset, is used instead of the QRS interval to detect abnormal beats.

4 Proposed method

The proposed method consists of three steps. First, to minimize the number of bits of vertices’ time information, a method of storing the time difference with the previous vertex is introduced. Then, after detecting the FP using (8), we analyze the distribution of the feature values of the normal and abnormal beats. Since the normal beats are more and form a normal distribution and the abnormal beats are out of the distribution of normal beat, we determined the threshold values for each feature and detected the abnormal beats.

4.1 Signal compression

Linear approximation of the ECG signal can effectively represent a signal with a small number of vertices. Each vertex of an approximated signal consists of the time and amplitude information. The amplitude is the same as the input signal because the vertex is determined among the existing samples. However, compared with the periodic input signal, the approximated signal comprises aperiodic vertices. Therefore, the approximated signal requires additional storage for time information of the vertex. In addition, the time information requires more storage as the sampling frequency and measurement time increase. Accordingly, if there is no postprocessing for additional time information, there is a problem that the amount of the compressed signal is further increased due to the storage for the added time information.

In this study, to minimize the amount of time information of the vertices, the constraint on the time difference between vertices in Sect. 3.4 is used. We express the time information of the \(i\mathrm{th}\) vertex (\({T}_{i}\)) by accumulating the time difference from the previous vertex (\({T}_{i}\mathrm{^{\prime}}\)) as follows:

$$\begin{aligned} & T_{i} = \mathop \sum \limits_{k = 1}^{i} T_{i} ^{\prime}, \\ & {\text{where}}\,T_{1}^{^{\prime}} = T_{1} \,and\,T_{i} ^{\prime} = T_{i} - T_{i - 1} . \\ \end{aligned}$$
(9)

The compression ratio (\(CR\)) of an approximated signal is calculated by the ratio between the total bits of the input signal’s amplitude and that of the approximated vertices’ amplitude and time difference as follows:

$$\begin{aligned} CR & = \left( {1 - \frac{Total\, bits \,of \,vertices}{{Total \,bits \,of\, signal}}} \right) \times 100\% \\ & = \left( {1 - \frac{{V_{N} \times \left( {Bit_{A} + Bit_{T} } \right)}}{{L \times Bit_{A} }}} \right) \times 100{\text{\% }}{.} \\ \end{aligned}$$
(10)

4.2 Feature extraction

From the approximated signal, we obtain the onset and offset of the QRS complex. Generally, the distribution of feature values of normal beats is similar to the normal distribution, and the distribution of abnormal beats deviates from the center of the normal beat distribution. Figure 12 shows the distribution of feature values for Datum 119, where PVC abnormal beats occurred.

Fig. 12
figure 12

Histogram of Datum 119’s features: a RR interval, b amplitude of R-peak, and c QR interval

The distribution of the feature values of the normal beat is similar to the normal distribution, and the distribution of the characteristic values of the abnormal beats deviates from the normal beat distribution (Fig. 12).

4.3 Abnormal beat detection

In this study, we detect PVC, which is a typical abnormal beat. As shown in Fig. 12, we can detect PVCs using various representative features—RR interval (\(RR\)), amplitude (\(A\)) of R-peak, and QR interval (\(QR\)). For PVCs, the RR interval is shorter than the normal beats, the amplitude is larger than the normal beats, and the QR interval is longer than the normal beats.

In the abnormal beat detection, the \({i}_{th}\) beat is determined to be an abnormal beat if it satisfies any of the following conditions:

$$\begin{array}{c}{RR}_{i}\le {RR}_{\mu }-{RR}_{\sigma }*R{R}_{k}\\ \begin{array}{c}\left|{A}_{i}-{A}_{\mu }\right|\ge +{A}_{\sigma }*{A}_{k}\\ {QR}_{i}\ge {QR}_{\mu }+{QR}_{\sigma }*Q{R}_{k},\end{array}\end{array}$$
(11)

where \(\mu\), \(\sigma\), and \(k\) are the average, standard deviation, and weight of the feature values, respectively.

5 Experiment

We experimented using the Massachusetts Institute of Technology-Beth Israel Hospital Arrhythmia Database (MIT-BIH ADB) that Physionet provided (Moddy and Mark 1990). The MIT-BIH ADB comprised 48 records, including various types of abnormal beats. Each record was 30 min long with a 360-Hz sampling frequency. We confirmed the performance of the signal compression and then confirmed the performance of abnormal beat detection. The experiments were conducted on Window 10 64-bit, Intel i5-10400, 2.90-GHz CPU, 32-GB DDR4 RAM, and MATLAB R2021a.

5.1 Signal compression

Each record of MIT-BIH ADB comprised approximately 650,000 samples, and each sample contains amplitude information (12 bits). In addition, each vertex contained amplitude information (12 bits) and the time difference from the previous vertex (5 bits).

Table 1 shows an example of a detailed signal compression ratio of Datum 119.

Table 1 Signal compression ratio of linear approximation

The approximation error for the input signal (X) and the approximated signal (Y) with signal length (L) were calculated using percentage root-mean-square difference (PRD), as follows:

$$PRD\left(X,Y\right)=100\%\times \sqrt{\frac{\sum_{i=1}^{L}({X\left(i\right)-Y(i))}^{2}}{\sum_{i=1}^{L}{X}^{2}\left(i\right)}}.$$
(12)

Figure 13 shows the distribution of compression ratio, PRD, and execution time of linear approximation for MIT-BIH ADB’s records.

Fig. 13
figure 13

Distribution of experimental results for MIT-BIH ADB records: a compression ratio, b PRD, and c processing time

The mean of the compression ratio was 87.19% (7.05:1), which confirmed excellent performance. Generally, the quality of PRD is rated as 0–2%: very good and 2–9%: good (Zigel et al. 2000). Datum 222, the 41st datum in Fig. 13, had the worst PRD (1.82%) but was classified as very good. The average processing time of the linear approximation was approximately 13.24 s. Considering that the input signal was acquired at approximately 30 min in length with 2300 beats, real-time processing was possible with an execution time of approximately 5.8 ms/beat.

5.2 Abnormal beat detection

We detected the onset of the QRS complex from the linear approximated signal using (8). Then, we obtained the QR interval from the Q-onset to R-peak.

Figure 14 provides an example of the results of the proposed method.

Fig. 14
figure 14

Example of results of the proposed method for Datum 119

To confirm the performance of FP detection from the linear approximated signal, we confirmed the PVC detection performance using (11). First, we confirmed the detection result using only the QR interval feature. Then, we compared the result using the R-peak’s amplitude and RR interval features with the result when the QR interval feature was additionally used. Considering that the QR interval was used, we experimented on records, which contained the abnormal beat that had a wider QR interval than the normal beat.

We evaluated classification performance by measuring sensitivity (\(Se\)) and specificity (\(Sp\)) according to true positive (\(TP\)), true negative (\(TN\)), false positive (\(FP\)), and false negative (\(FN\)). \(TP\) and \(TN\) were the correct classification results of abnormal and normal beats, respectively. Meanwhile, \(FP\) and \(FN\) were the misclassification results for normal and abnormal beats, respectively. \(Se\), \(Sp\), and accuracy (\(Ac\)) measure the nondetection, overdetection, and correct total beat detection rates, respectively, as follows:

$$Se=\frac{TP}{TP+FN}, Sp=\frac{TN}{TN+FP}, Ac=\frac{TP+TN}{TP+TN+FP+FN}.$$
(13)

Table 2 shows the abnormal beat detection result using the QRS interval.

Table 2 Abnormal beat detection result using the QR interval

As shown in Table 2, we can detect many PVCs from the approximated signals using only the QR interval feature.

Table 3 shows the abnormal beat detection performance for the records in Table 2 when the R-peak’s amplitude and RR interval are used instead of the QR interval.

Table 3 Abnormal beat detection result using R-peak’s amplitude and RR interval

Table 4 shows the abnormal beat detection performance when the QR interval is additionally used.

Table 4 Abnormal beat detection result using R-peak’s amplitude, RR interval, and QR interval

Comparing the results of Tables 3 and 4, we confirmed that the overall detection result was improved. In particular, the non-detection that affected false diagnosis was significantly reduced.

Non-detected and over-detected beats occur due to ambiguous feature distribution between normal and abnormal. In addition, in some beats, error in feature values occurs due to erroneous detection of FPs. These misdetections occur when the FP does not appear well as a vertex because the number of vertices used for approximation is insufficient, or, conversely, when the number of vertices is excessive and neighboring vertices are not acquired correct feature values.

Therefore, in future research, it is necessary to research about reliable determination of the number of vertices suitable for detecting the FP, and to further improve the method for determining neighboring vertices to minimize distortion caused by noise or baseline movements.

6 Conclusion

In this article, we demonstrated effective signal compression and abnormal beat detection based on a linear approximation. Using the constraint of the time difference between vertices used in the existing linear approximation method, we improved the signal compression rate. Experimentally, we confirmed the excellent performance of the compression rate, PRD, and execution time of the proposed signal compression. In addition, by analyzing the vertex of the approximated signal to detect the FP of the QRS complex and detecting PVC abnormal beats using the width of the QR interval, we confirmed that the proposed method enabled the abnormal beat detection without signal reconstruction. Therefore, we expect the proposed method to be effective in signal analysis in low-memory embedded devices due to the characteristic of detecting abnormal beats without compressed signal reconstruction.

In future studies, by additionally detecting the FPs of the P- and T-wave from approximated signals, we will extend the types of abnormal beat that can be detected from the linear approximated signal. Further, we will modify the proposed method for determining the number of vertices, which is determined regardless of the compression ratio or reconstruction error, to improve the efficiency of signal compression and emphasize FP features rather than the surrounding vertices.