4. Wavelet packet-based ECG anonymisation approach

#### 4.1. Overview of wavelet packet transform

Wavelet packet transform has been used in many applications of biomedical signal processing, for example, feature extraction, noise reduction, data compression and QRS detection. Furthermore, wavelet packet transform has long been used for ECG signal analysis. A wavelet packet function [18] is defined as

$$
\varphi\_{j,k}^{\boldsymbol{n}}(\mathbf{t}) = 2^{\frac{1}{2}} \boldsymbol{\varphi}^{\boldsymbol{n}}(2^{\boldsymbol{t}}\mathbf{t} - \boldsymbol{m}),\tag{1}
$$

where j and m are the scale (frequency) and the translation (time) parameters, respectively, and n ¼ 0, 1, 3, … is the oscillation parameter. The structure of wavelet packet (WP) decomposition is described as a binary tree structure E; each node is described as ð Þ j; n , where j is a node's scale level and n is a node's number on the corresponded level. The root node 0ð Þ ; 0 of the WP tree corresponds to the entire frequency range, 0; f s 2 h i, where <sup>f</sup> <sup>s</sup> is the ECG sampling frequency of the ECG signal. Each internal node of the WP tree ð Þ j; n ∈ E is called a parent node that is divided into two child nodes: the first and the second nodes are associated with low-pass h mð Þ and high-pass g mð Þ filters. These nodes forms a quadrature mirror filter (QMF) pair [19].

The scaling function ωð Þt and the mother wavelet φð Þt for the wavelet packet when n ¼ 0, 1 and j ¼ m ¼ 0 are given by

$$
\varphi^0(t) = \omega(t), \varphi^1(t) = \psi(t). \tag{2}
$$

The other wavelet packet functions for n ¼ 2, 3, … and j ¼ 1 are shown as follows:

$$
\phi^{2n}(t) = \sum\_{m} h(m) \phi^{n}\_{j,m}(t),
\tag{3}
$$

$$
\varphi^{2n+1}(t) = \sum\_{m} \operatorname{g}(m) \varphi^{n}\_{j,m}(t). \tag{4}
$$

By substituting Eq. (1) into Eq. (3) and (4), we can get

from the repository is completely able to obfuscate features related to cardiovascular condition

Therefore, this method provides higher ECG security by compromising larger key size (approximately 50%) as can be seen in Figure 6. Figure 5 shows that the reconstructed ECG signal does

Both methods described above suffer from long key size and lack of complete obfuscation to the ECG data. The long key size requires wider bandwidth during transmission process of the key to the ECG repository. On the other hand, lack of complete obfuscation results in trivial interpretation of the anonymised ECG signal. Therefore, due to these two main reasons, other

Wavelet packet transform has been used in many applications of biomedical signal processing, for example, feature extraction, noise reduction, data compression and QRS detection. Furthermore, wavelet packet transform has long been used for ECG signal analysis. A wavelet packet

> 1 <sup>2</sup>φ<sup>n</sup> 2<sup>j</sup>

where j and m are the scale (frequency) and the translation (time) parameters, respectively, and n ¼ 0, 1, 3, … is the oscillation parameter. The structure of wavelet packet (WP) decomposition

<sup>t</sup> � <sup>m</sup> , (1)

methods based on the wavelet packet were proposed and developed.

Figure 6. Removed (selected for encryption) coefficients for method 2.

4. Wavelet packet-based ECG anonymisation approach

φn j, <sup>k</sup>ðÞ¼ t 2

and person identification.

48 Wavelet Theory and Its Applications

not contain any ECG features.

function [18] is defined as

4.1. Overview of wavelet packet transform

$$
\phi^{2n}(t) = \sqrt{2} \sum\_{m} h(m) \phi^n(2t - m),
\tag{5}
$$

$$
\varphi^{2n+1}(t) = \sqrt{2} \sum\_{m} \mathcal{g}(m) \varphi^n(2t - m),
\tag{6}
$$

where the low-pass filter gives h mð Þ¼ <sup>1</sup>ffiffi 2 <sup>p</sup> h i ωð Þt ; ωð Þ 2t � m , and the high-pass filter gives g mð Þ¼ <sup>1</sup>ffiffi 2 <sup>p</sup> h i ψð Þt ;ψð Þ 2t � m . The operator h i :; : stands for the inner product. The wavelet packet coefficients of the ECG signal, x tð Þ, are expressed as follows:

$$Q^n\_{\vec{\gamma}}(m) = \left< \mathbf{x}, \psi^n\_{\vec{\gamma}, m} \right> = \int\_{-\infty}^{\infty} \mathbf{x}(t) \psi^n\_{\vec{\gamma}, m}(t) \, dt \tag{7}$$

Each coefficient measures a specific sub-band frequency content, controlled by the scaling parameter, j, and the oscillation parameter, n. The ECG signal, x tð Þ, can be decomposed into a different time-frequency space with Eq. (6) and Eq. (7). By computing the full wavelet packet decomposition on the ECG signal, for the jth level of decomposition, we have 2<sup>j</sup> sets of sub-band coefficients of length <sup>N</sup> <sup>2</sup><sup>j</sup>, where N is the ECG signal length [20]. Each sub-band coefficient, node, has a frequency range in the interval <sup>n</sup> <sup>2</sup>jþ<sup>1</sup> ; <sup>n</sup>þ<sup>1</sup> 2jþ<sup>1</sup> h i, n <sup>¼</sup> <sup>0</sup>, <sup>1</sup>, …, <sup>2</sup><sup>j</sup> � 1. This is how wavelet packet decomposes the original ECG signal into two or more coefficients.

#### 4.2. The generalised framework for the ECG anonymisation method

In this section, a generalised framework for the ECG anonymisation using wavelet packet transform (WPT) will be introduced. The proposed framework for ECG anonymisation can be seen in Figure 7, while its pseudo-code is listed in Algorithm 1. This framework comprises the following steps:

Step 1: Perform wavelet packet decomposition of the ECG signal, x tð Þ, at level j. The signal coefficients at this level are given by

$$\mathcal{C} = \left\{ \mathcal{c}(j, n) \colon n = 0, 1, \ldots, 2^j - 1 \right\} \tag{8}$$

Step 3: Modify each node in C, Eq. (9), using a reversible function/operation such as logarithm or division. In this chapter each node in C is divided by Γ. Γ is a reversible function driven from

where Γ ¼ k þ offset, offset ¼ j j minð Þk þ η, η is a constant and j j: is the absolute operator. The

Step 4: Securely distribute the key, K, and the offset value to medical personnel. The key security will be achieved by compressing and encrypting the first node, k, and the offset as

where Δð Þ: is the compression operator and Eð Þ: is the encryption operator [9]. Compression

Step 5: Perform wavelet packet reconstruction to the modified terminal nodes' coefficient, b

The proposed reconstruction process for the anonymised ECG signal is shown in Figure 8, while the pseudocode is shown in Algorithm 2. The authorised personnel receives the secure key, K, and the anonymised ECG, y tð Þ, and performs the reconstruction process by the following steps:

<sup>Γ</sup> : <sup>n</sup> <sup>¼</sup> <sup>1</sup>; <sup>2</sup>;…; <sup>2</sup><sup>j</sup> � <sup>1</sup>

� �; (11)

Wavelets in ECG Security Application http://dx.doi.org/10.5772/intechopen.74477 51

K ¼ Eð Þ¼ Δð Þ k; offset Eð Þ Δð Þ c jð Þ ; 0 ; offset ; (12)

C, to

the key coefficients. Hence, the modified coefficients in C are given by

<sup>Γ</sup> <sup>¼</sup> c j ð Þ ; <sup>n</sup>

b <sup>C</sup> <sup>¼</sup> <sup>C</sup>

offset term in Γ is used to prevent division by zero.

and encryption are beyond the scope of this chapter.

Step 6: Upload the anonymised ECG, y tð Þ, to the repository.

Figure 8. Wavelet packet-based reconstruction process for the anonymised ECG.

get the anonymised ECG, y tð Þ.

4.3. The ECG reconstruction method

follows:

where c jð Þ ; n represents the coefficients of the nth node at level j.

Step 2: Exclude the first node, c j ð Þ ; 0 , from C in Eq. (8) to get

$$\overline{\mathbb{C}} = \{ \mathfrak{c}(j, n) \colon n = 1, 2, \ldots, 2^j - 1 \}. \tag{9}$$

The excluded node is set to

$$k = c(j, 0) \tag{10}$$

where k is an unencrypted and uncompressed key that includes the low-frequency components of the ECG signal, x tð Þ.

Figure 7. Wavelet packet-based ECG anonymisation process.

Step 3: Modify each node in C, Eq. (9), using a reversible function/operation such as logarithm or division. In this chapter each node in C is divided by Γ. Γ is a reversible function driven from the key coefficients. Hence, the modified coefficients in C are given by

$$\widehat{\overline{\mathcal{C}}} = \frac{\overline{\mathcal{C}}}{\Gamma} = \left\{ \frac{c(j, n)}{\Gamma} : n = 1, 2, \dots, 2^j - 1 \right\},\tag{11}$$

where Γ ¼ k þ offset, offset ¼ j j minð Þk þ η, η is a constant and j j: is the absolute operator. The offset term in Γ is used to prevent division by zero.

Step 4: Securely distribute the key, K, and the offset value to medical personnel. The key security will be achieved by compressing and encrypting the first node, k, and the offset as follows:

$$K = E(\Delta(k, \text{offset})) = E(\Delta(c(j, 0), \text{offset})), \tag{12}$$

where Δð Þ: is the compression operator and Eð Þ: is the encryption operator [9]. Compression and encryption are beyond the scope of this chapter.

Step 5: Perform wavelet packet reconstruction to the modified terminal nodes' coefficient, b C, to get the anonymised ECG, y tð Þ.

Step 6: Upload the anonymised ECG, y tð Þ, to the repository.

#### 4.3. The ECG reconstruction method

4.2. The generalised framework for the ECG anonymisation method

where c jð Þ ; n represents the coefficients of the nth node at level j.

Step 2: Exclude the first node, c j ð Þ ; 0 , from C in Eq. (8) to get

following steps:

50 Wavelet Theory and Its Applications

coefficients at this level are given by

The excluded node is set to

nents of the ECG signal, x tð Þ.

Figure 7. Wavelet packet-based ECG anonymisation process.

In this section, a generalised framework for the ECG anonymisation using wavelet packet transform (WPT) will be introduced. The proposed framework for ECG anonymisation can be seen in Figure 7, while its pseudo-code is listed in Algorithm 1. This framework comprises the

Step 1: Perform wavelet packet decomposition of the ECG signal, x tð Þ, at level j. The signal

where k is an unencrypted and uncompressed key that includes the low-frequency compo-

<sup>C</sup> <sup>¼</sup> c j ð Þ ; <sup>n</sup> :<sup>n</sup> <sup>¼</sup> <sup>0</sup>; <sup>1</sup>;…; <sup>2</sup><sup>j</sup> � <sup>1</sup> (8)

<sup>C</sup> <sup>¼</sup> c j ð Þ ; <sup>n</sup> :<sup>n</sup> <sup>¼</sup> <sup>1</sup>; <sup>2</sup>;…; <sup>2</sup><sup>j</sup> � <sup>1</sup> : (9)

k ¼ c jð Þ ; 0 (10)

The proposed reconstruction process for the anonymised ECG signal is shown in Figure 8, while the pseudocode is shown in Algorithm 2. The authorised personnel receives the secure key, K, and the anonymised ECG, y tð Þ, and performs the reconstruction process by the following steps:

Figure 8. Wavelet packet-based reconstruction process for the anonymised ECG.

Step 1: Perform decryption and decompression to the key, K, to get Γ

$$
\Gamma = \Lambda(D(\mathbb{K})),
\tag{13}
$$

The normal and abnormal ECG signals with different sampling frequencies were used in this chapter to study the robustness of the proposed anonymisation approach in concealing and smearing the ECG's fiducial and non-fiducial features. The normal and abnormal ECG data were obtained from the PTB ECG database [26] and the MIT-BIH arrhythmia database [27],

Wavelets in ECG Security Application http://dx.doi.org/10.5772/intechopen.74477 53

In the evaluation process in the latter sub-section, bior5.5 wavelet was used. Besides this type of mother wavelet resembling the shape of an ECG signal, it is widely used for speech, video and biomedical signals providing that bior5.5 inherited linear phase. Nevertheless, it should be noted that for ECG anonymisation in this chapter, mother wavelet will not impact the anonymisation

The security of the proposed scheme depends on the following parameters that are required at

2. the reversible function that should be used to reconstruct the original ECG information

3. the type of transformation and the level of decomposition (wavelet packet transform at

An attacker with stolen key (i.e. able to decrypt the secure key) using brute force or any other method will require the knowledge of the reversible function and the level of decomposition. This information will be stored inside a patient/medical personnel PC and will not be transmitted under any circumstance. In this case, brute force attack is infeasible for the attack.

In the following sections, performance analysis using cross-correlation of normal and anonymised ECG signals, power spectral density of anonymised ECG signal and percentage residual difference

An electrocardiogram (ECG) signal has a well-defined P, QRS and T signature that is represented with each heartbeat. The P-wave arises from the depolarisation of the atrium. The QRS complex arises from depolarisation of the ventricles and T-wave arises from repolarisation of the ventricle muscles. The duration, shape and amplitude of these waves are considered as major features in

The normal ECG was obtained from the PTB database (patient247, signal s0479). The sampling frequency, f <sup>s</sup>, for this signal was 1 kHz. A total of 10 s of this signal was transformed by wavelet packet decomposition at level 2, j ¼ 2. Decomposition level, j, depends on the ECG sampling frequency. Higher sampling frequency requires a low value of j to conceal all features

wavelet packet coefficients of the normal ECG signal. This node was used to generate the key, K, which was distributed securely to medical personnel. The anonymised ECG is reconstructed

<sup>4</sup> (N = 10,000 samples) was removed from the

time-domain analysis. Sometimes the time morphologies of these waves are similar.

result since the ECG signal will be constructed back to its original at the receiver side.

respectively. These databases are publically available [26, 27].

1. the encrypted security key which should be shared secretly,

5.1. Performance evaluation over normal electrocardiogram

in the anonymised signal. Node <sup>c</sup>ð Þ <sup>2</sup>; <sup>0</sup> of size <sup>N</sup>

from the anonymised ECG, and

level 2 is used in this study).

(PRD) methods will be examined.

the receiver side:

where Λð Þ: and Dð Þ: are the decryption and decompression operators, respectively. Decryption and decompression are beyond the scope of this chapter.

Step 2: Perform wavelet packet decomposition of the ECG signal, y tð Þ, at level j to get b <sup>C</sup> <sup>¼</sup> <sup>C</sup> <sup>Γ</sup> as in Eq. (11).

Step 3: Multiply each node at b C by the factor Γ to get

$$\overline{\mathbb{C}} = f^{-1}\left(\widehat{\overline{\mathbb{C}}}\right) = \widehat{\overline{\mathbb{C}}} \times \Gamma = \left\{ \mathfrak{c}(j, n) : n = 1, 2, \dots, 2^j - 1 \right\} \tag{14}$$

Algorithm 1: Wavelet packet-based ECG anonymisation process

13: Save y tð Þ with unique ID for a particular individual

1: Begin

8: b <sup>C</sup> <sup>C</sup> Γ

14: End

5: <sup>C</sup> c j; <sup>n</sup> � �

Algorithm 2: Wavelet packet-based reconstruction process

```
2: x tð Þ ECG_signal
3: C wpacket_decomposition x tð Þ; j � �
4: k c j; 0 � � // exclude the first node as a key
6: offset j j minð Þ k þ η
7: Γ k þ offset
9: K E Δ k; offset � � � � //compression and encryption
10: Send K to healthcare providers or doctors as a key
11: y tð Þ wpacket_reconstruction b
                                      C; j
                                    � �
12: Upload y tð Þ to public server
                                                                 1: Begin
                                                                 2: k Λð Þ D Kð Þ ; offset // decryption and decompression
                                                                 3: y tð Þ Anonymised_ECG_signal
                                                                 4: b
                                                                   C wpacket_decomposition y tð Þ; j � �
                                                                 5: C b
                                                                        C � Γ
                                                                 6: c j; n � � C
                                                                 7: k Γ � offset
                                                                 8: c j; 0 � � k
                                                                 9: C add_first_node c j; 0 � �; c j; n � � � �
                                                                 10: x tð Þ wpacket_reconstruction C; j � �
                                                                 11: End
```
Step 4: Add the first node, c jð Þ¼ ; 0 Γ � offset, to the WPT vector C at Eq. (14) to get the WPT vector coefficients, C, of the original ECG signal, x tð Þ.

Step 5: Perform wavelet packet reconstruction of the coefficients vector, C, at level j to recover the original unanonymised ECG signal, x tð Þ.

#### 5. Algorithm validation

Two types of electrocardiogram (ECG) signals were used to validate and investigate the performance and the effectiveness of the generalised ECG anonymisation framework. These signals are


The normal and abnormal ECG signals with different sampling frequencies were used in this chapter to study the robustness of the proposed anonymisation approach in concealing and smearing the ECG's fiducial and non-fiducial features. The normal and abnormal ECG data were obtained from the PTB ECG database [26] and the MIT-BIH arrhythmia database [27], respectively. These databases are publically available [26, 27].

In the evaluation process in the latter sub-section, bior5.5 wavelet was used. Besides this type of mother wavelet resembling the shape of an ECG signal, it is widely used for speech, video and biomedical signals providing that bior5.5 inherited linear phase. Nevertheless, it should be noted that for ECG anonymisation in this chapter, mother wavelet will not impact the anonymisation result since the ECG signal will be constructed back to its original at the receiver side.

The security of the proposed scheme depends on the following parameters that are required at the receiver side:

1. the encrypted security key which should be shared secretly,

Step 1: Perform decryption and decompression to the key, K, to get Γ

and decompression are beyond the scope of this chapter.

�<sup>1</sup> b C � �

¼ b

C ¼ f

Algorithm 1: Wavelet packet-based ECG anonymisation

9: <sup>K</sup> <sup>E</sup> <sup>Δ</sup> <sup>k</sup>; offset � � � � //compression and encryption 10: Send K to healthcare providers or doctors as a key

13: Save y tð Þ with unique ID for a particular individual

vector coefficients, C, of the original ECG signal, x tð Þ.

C; j � �

the original unanonymised ECG signal, x tð Þ.

1. normal ECG signal for a healthy subject, and

ventricular tachyarrhythmia.

5. Algorithm validation

in Eq. (11).

process

1: Begin

8: b <sup>C</sup> <sup>C</sup> Γ

14: End

5: <sup>C</sup> c j; <sup>n</sup> � �

2: x tð Þ ECG\_signal

6: offset j j minð Þ k þ η 7: Γ k þ offset

Step 3: Multiply each node at b

52 Wavelet Theory and Its Applications

3: <sup>C</sup> wpacket\_decomposition x tð Þ; <sup>j</sup> � � 4: <sup>k</sup> c j; <sup>0</sup> � � // exclude the first node as a key

11: y tð Þ wpacket\_reconstruction b

12: Upload y tð Þ to public server

where Λð Þ: and Dð Þ: are the decryption and decompression operators, respectively. Decryption

1: Begin

5: C b C � Γ 6: c j; <sup>n</sup> � � <sup>C</sup> 7: k Γ � offset 8: c j; <sup>0</sup> � � <sup>k</sup>

11: End

4: b

Step 4: Add the first node, c jð Þ¼ ; 0 Γ � offset, to the WPT vector C at Eq. (14) to get the WPT

Step 5: Perform wavelet packet reconstruction of the coefficients vector, C, at level j to recover

Two types of electrocardiogram (ECG) signals were used to validate and investigate the performance and the effectiveness of the generalised ECG anonymisation framework. These signals are

2. abnormal ECG signals for a patient with supraventricular arrhythmia and a patient with

Step 2: Perform wavelet packet decomposition of the ECG signal, y tð Þ, at level j to get b

C by the factor Γ to get

Γ ¼ Λð Þ D Kð Þ ; (13)

<sup>C</sup> � <sup>Γ</sup> <sup>¼</sup> c jð Þ ; <sup>n</sup> : <sup>n</sup> <sup>¼</sup> <sup>1</sup>; <sup>2</sup>;…; <sup>2</sup><sup>j</sup> � <sup>1</sup> � � (14)

3: y tð Þ Anonymised\_ECG\_signal

9: <sup>C</sup> add\_first\_node c j; <sup>0</sup> � �; c j; <sup>n</sup> � � � � 10: x tð Þ wpacket\_reconstruction C; <sup>j</sup> � �

<sup>C</sup> wpacket\_decomposition y tð Þ; <sup>j</sup> � �

Algorithm 2: Wavelet packet-based reconstruction process

2: k Λð Þ D Kð Þ ; offset // decryption and decompression

<sup>C</sup> <sup>¼</sup> <sup>C</sup> <sup>Γ</sup> as


An attacker with stolen key (i.e. able to decrypt the secure key) using brute force or any other method will require the knowledge of the reversible function and the level of decomposition. This information will be stored inside a patient/medical personnel PC and will not be transmitted under any circumstance. In this case, brute force attack is infeasible for the attack.

In the following sections, performance analysis using cross-correlation of normal and anonymised ECG signals, power spectral density of anonymised ECG signal and percentage residual difference (PRD) methods will be examined.

#### 5.1. Performance evaluation over normal electrocardiogram

An electrocardiogram (ECG) signal has a well-defined P, QRS and T signature that is represented with each heartbeat. The P-wave arises from the depolarisation of the atrium. The QRS complex arises from depolarisation of the ventricles and T-wave arises from repolarisation of the ventricle muscles. The duration, shape and amplitude of these waves are considered as major features in time-domain analysis. Sometimes the time morphologies of these waves are similar.

The normal ECG was obtained from the PTB database (patient247, signal s0479). The sampling frequency, f <sup>s</sup>, for this signal was 1 kHz. A total of 10 s of this signal was transformed by wavelet packet decomposition at level 2, j ¼ 2. Decomposition level, j, depends on the ECG sampling frequency. Higher sampling frequency requires a low value of j to conceal all features in the anonymised signal. Node <sup>c</sup>ð Þ <sup>2</sup>; <sup>0</sup> of size <sup>N</sup> <sup>4</sup> (N = 10,000 samples) was removed from the wavelet packet coefficients of the normal ECG signal. This node was used to generate the key, K, which was distributed securely to medical personnel. The anonymised ECG is reconstructed from the rest nodes, three nodes, using the anonymisation algorithm in Section II (B) and transmitted confidently over the public internet, since the anonymised ECG does not impose any threat to privacy.

Figure 9 (a) and (b) shows the time-domain representation of the 10-s normal ECG signal (patient247, signal s0479) and its anonymisation version, respectively. The frequency range for the anonymised ECG after node cð Þ 2; 0 removal is 125 and 500 Hz. From the time-domain representation of the ECG signal and its anonymisation in Figure 9 (a) and (b), the proposed anonymisation algorithm conceals all fiducial features from the reconstructed ECG signal (Figure 9(b)). Figure 10 (a) and (b) shows the frequency representation of the 10-s normal ECG signal (Figure 9 (a)) and its anonymisation version, respectively. The non-fiducial features were also concealed as shown in the frequency-domain representation of the anonymised version of the normal ECG signal.

Figure 11 shows the time-domain representation of the coefficients cð Þ 2; 0 which was used to create the secure key, K. The frequency range for cð Þ 2; 0 in this data is between 0 and 125 Hz. This node preserves all fiducial features in the original ECG signal. Figure 12 (a) and (b) shows the reconstructed ECG signal at the medical personnel side and its cross-correlation with the original ECG signal at the patient side, respectively. From Figure 12 (b), both signals are highly correlated, which guarantees a lossless reconstruction.

Figure 9. Time-domain representation of 10-s normal ECG signal, (a) unanonymised ECG signal and (b) anonymised ECG signal. The sampling frequency was fs = 1 kHz.

5.2. Performance evaluation over abnormal electrocardiogram

This node was used to create the secure key.

An arrhythmia is an abnormality in the heart's rhythm or heartbeat pattern. The heartbeat can be too slow, too fast, have extra beats or otherwise beat irregularly [28]. The types of abnormal ECG signals investigated in this study were supraventricular arrhythmia and ventricular tachyarrhythmia. Supraventricular arrhythmia occurs in the upper areas of the heart and

Figure 11. Time-domain representation of the first node cð Þ 2; 0 coefficients for the 10-s normal ECG signal in Figure 9(a).

Figure 10. Power spectral density of 10-s normal ECG signal, (a) unanonymised ECG signal and (b) anonymised ECG

Wavelets in ECG Security Application http://dx.doi.org/10.5772/intechopen.74477 55

signal. The sampling frequency was fs = 1 kHz, the power spectral method was Welch periodogram.

from the rest nodes, three nodes, using the anonymisation algorithm in Section II (B) and transmitted confidently over the public internet, since the anonymised ECG does not impose

Figure 9 (a) and (b) shows the time-domain representation of the 10-s normal ECG signal (patient247, signal s0479) and its anonymisation version, respectively. The frequency range for the anonymised ECG after node cð Þ 2; 0 removal is 125 and 500 Hz. From the time-domain representation of the ECG signal and its anonymisation in Figure 9 (a) and (b), the proposed anonymisation algorithm conceals all fiducial features from the reconstructed ECG signal (Figure 9(b)). Figure 10 (a) and (b) shows the frequency representation of the 10-s normal ECG signal (Figure 9 (a)) and its anonymisation version, respectively. The non-fiducial features were also concealed as shown in the frequency-domain representation of the anonymised

Figure 11 shows the time-domain representation of the coefficients cð Þ 2; 0 which was used to create the secure key, K. The frequency range for cð Þ 2; 0 in this data is between 0 and 125 Hz. This node preserves all fiducial features in the original ECG signal. Figure 12 (a) and (b) shows the reconstructed ECG signal at the medical personnel side and its cross-correlation with the original ECG signal at the patient side, respectively. From Figure 12 (b), both signals are highly

Figure 9. Time-domain representation of 10-s normal ECG signal, (a) unanonymised ECG signal and (b) anonymised

any threat to privacy.

54 Wavelet Theory and Its Applications

version of the normal ECG signal.

correlated, which guarantees a lossless reconstruction.

ECG signal. The sampling frequency was fs = 1 kHz.

Figure 10. Power spectral density of 10-s normal ECG signal, (a) unanonymised ECG signal and (b) anonymised ECG signal. The sampling frequency was fs = 1 kHz, the power spectral method was Welch periodogram.

Figure 11. Time-domain representation of the first node cð Þ 2; 0 coefficients for the 10-s normal ECG signal in Figure 9(a). This node was used to create the secure key.

#### 5.2. Performance evaluation over abnormal electrocardiogram

An arrhythmia is an abnormality in the heart's rhythm or heartbeat pattern. The heartbeat can be too slow, too fast, have extra beats or otherwise beat irregularly [28]. The types of abnormal ECG signals investigated in this study were supraventricular arrhythmia and ventricular tachyarrhythmia. Supraventricular arrhythmia occurs in the upper areas of the heart and

Figure 12. Ten seconds reconstructed ECG signal, (a) time domain representation of the reconstructed ECG signal, (b) cross correlation between the normal ECG signal in Figure 9(a) and its reconstructed version.

is less serious than ventricular arrhythmia. It has irregular shapes of QRS complexes [28]. These arrhythmia data—supraventricular arrhythmia and ventricular tachyarrhythmia—were obtained from the MIT-BIH arrhythmia database [26].

#### 5.2.1. Supraventricular arrhythmia

The sampling frequency, f <sup>s</sup>, for this signal was 128 Hz. A total of 10 s of this signal was transformed by wavelet packet decomposition at level 2, j ¼ 2.

Node <sup>c</sup>ð Þ <sup>2</sup>; <sup>0</sup> of size <sup>N</sup> <sup>4</sup> (N = 1280 samples) was removed from the wavelet packet coefficients of the supraventricular arrhythmia signal. This node was used to generate the key, K, which was distributed securely to medical personnel. The frequency range for cð Þ 2; 0 in this data is between 0 and 16 Hz. The other nodes at level 2 with the frequency range between 16 and 64 were used to construct the anonymised signal.

Figure 13 (a) and (b) shows the time-domain representation of the 10-s ECG signal of a patient with supraventricular arrhythmia and its anonymisation version, respectively. The frequencydomain representation for both signals is shown in Figure 14 (a) and (b). The fiducial and nonfiducial features were concealed in the time-domain and frequency-domain representation of the anonymised supraventricular arrhythmia signal.

Figure 15 shows the time-domain representation of the coefficients cð Þ 2; 0 , which was used to create the secure key, K. This node preserves all fiducial features in the original supraventricular arrhythmia signal.

Figure 14. Power spectral density of ten seconds normal ECG signal of a patient with supraventricular arrhythmia, (a) unanonymised ECG and (b) anonymised ECG. The sampling frequency was fs = 128 Hz, and the power spectral method

Figure 13. Time-domain representation of 10-s ECG signal of a patient with supraventricular arrhythmia, (a) unanonymised

Wavelets in ECG Security Application http://dx.doi.org/10.5772/intechopen.74477 57

ECG and (b) anonymised CG. The sampling frequency was fs = 128 Hz.

was Welch periodogram.

Figure 13. Time-domain representation of 10-s ECG signal of a patient with supraventricular arrhythmia, (a) unanonymised ECG and (b) anonymised CG. The sampling frequency was fs = 128 Hz.

is less serious than ventricular arrhythmia. It has irregular shapes of QRS complexes [28]. These arrhythmia data—supraventricular arrhythmia and ventricular tachyarrhythmia—were

Figure 12. Ten seconds reconstructed ECG signal, (a) time domain representation of the reconstructed ECG signal, (b)

The sampling frequency, f <sup>s</sup>, for this signal was 128 Hz. A total of 10 s of this signal was

the supraventricular arrhythmia signal. This node was used to generate the key, K, which was distributed securely to medical personnel. The frequency range for cð Þ 2; 0 in this data is between 0 and 16 Hz. The other nodes at level 2 with the frequency range between 16 and 64

Figure 13 (a) and (b) shows the time-domain representation of the 10-s ECG signal of a patient with supraventricular arrhythmia and its anonymisation version, respectively. The frequencydomain representation for both signals is shown in Figure 14 (a) and (b). The fiducial and nonfiducial features were concealed in the time-domain and frequency-domain representation of

Figure 15 shows the time-domain representation of the coefficients cð Þ 2; 0 , which was used to create the secure key, K. This node preserves all fiducial features in the original supraventric-

<sup>4</sup> (N = 1280 samples) was removed from the wavelet packet coefficients of

obtained from the MIT-BIH arrhythmia database [26].

were used to construct the anonymised signal.

the anonymised supraventricular arrhythmia signal.

transformed by wavelet packet decomposition at level 2, j ¼ 2.

cross correlation between the normal ECG signal in Figure 9(a) and its reconstructed version.

5.2.1. Supraventricular arrhythmia

56 Wavelet Theory and Its Applications

Node <sup>c</sup>ð Þ <sup>2</sup>; <sup>0</sup> of size <sup>N</sup>

ular arrhythmia signal.

Figure 14. Power spectral density of ten seconds normal ECG signal of a patient with supraventricular arrhythmia, (a) unanonymised ECG and (b) anonymised ECG. The sampling frequency was fs = 128 Hz, and the power spectral method was Welch periodogram.

Figure 15. Time-domain representation of the first node cð Þ 2; 0 coefficients for the 10-s abnormal ECG signal in Figure 7 (a). This node was used to create the secure key.

#### 5.2.2. Ventricular tachyarrhythmia

The sampling frequency, f <sup>s</sup>, for this signal was 250 Hz. A total of 10 s of this signal was transformed by wavelet packet decomposition at level 2. Node <sup>c</sup>ð Þ <sup>2</sup>; <sup>0</sup> of size <sup>N</sup> <sup>4</sup> (N = 2500 samples) was removed from the wavelet packet coefficients of the ventricular tachyarrhythmia signal. This node was used to generate the key K, which was distributed securely to medical personnel. The other nodes were used to reconstruct the anonymised ventricular tachyarrhythmia signal.

Figure 16 (a) and (b) shows the time-domain representation of the 10-s ECG signal of a patient with ventricular tachyarrhythmia and its anonymisation version, respectively. The frequencydomain representation for both signals is shown in Figure 17 (a) and (b). The fiducial and non-fiducial features were concealed in the time-domain and frequency-domain representation of the anonymised supraventricular arrhythmia signal.

PRD ¼

unanonymised ECG and (b) anonymised ECG. The sampling frequency was fs = 250 Hz.

N is the total number of the sample.

sampling frequency.

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

P N i¼1 x ið Þ<sup>2</sup>

where x ið Þ is the original ECG signal, y ið Þ is the anonymised ECG signal and i ¼ 1…N, where

Performance of the proposed anonymisation algorithm using PRD metric is shown in Table 1. It can be seen from the table that the minimum and the maximum PRD measured were 14.8 and 70.6%, respectively. The PRD value depends on the ECG frequency bandwidth and its

ð Þ x iðÞ� y ið Þ <sup>2</sup>

(15)

Wavelets in ECG Security Application http://dx.doi.org/10.5772/intechopen.74477 59

P N i¼1

Figure 16. Time-domain representation of 10-s ECG signal of a patient with ventricular tachyarrhythmia, (a)

vuuuuuut

Figure 18 shows the time-domain representation of the coefficients cð Þ 2; 0 which was used to create the secure key, K. This node preserves all fiducial features in the original supraventricular arrhythmia signal.

#### 5.3. Performance evaluation with the PRD metric

The percentage residual difference (PRD) is used to measure the difference between the original ECG signal and the anonymised ECG signal using the following equation.

Figure 16. Time-domain representation of 10-s ECG signal of a patient with ventricular tachyarrhythmia, (a) unanonymised ECG and (b) anonymised ECG. The sampling frequency was fs = 250 Hz.

5.2.2. Ventricular tachyarrhythmia

58 Wavelet Theory and Its Applications

(a). This node was used to create the secure key.

mia signal.

ular arrhythmia signal.

The sampling frequency, f <sup>s</sup>, for this signal was 250 Hz. A total of 10 s of this signal was

Figure 15. Time-domain representation of the first node cð Þ 2; 0 coefficients for the 10-s abnormal ECG signal in Figure 7

samples) was removed from the wavelet packet coefficients of the ventricular tachyarrhythmia signal. This node was used to generate the key K, which was distributed securely to medical personnel. The other nodes were used to reconstruct the anonymised ventricular tachyarrhyth-

Figure 16 (a) and (b) shows the time-domain representation of the 10-s ECG signal of a patient with ventricular tachyarrhythmia and its anonymisation version, respectively. The frequencydomain representation for both signals is shown in Figure 17 (a) and (b). The fiducial and non-fiducial features were concealed in the time-domain and frequency-domain representa-

Figure 18 shows the time-domain representation of the coefficients cð Þ 2; 0 which was used to create the secure key, K. This node preserves all fiducial features in the original supraventric-

The percentage residual difference (PRD) is used to measure the difference between the

original ECG signal and the anonymised ECG signal using the following equation.

<sup>4</sup> (N = 2500

transformed by wavelet packet decomposition at level 2. Node <sup>c</sup>ð Þ <sup>2</sup>; <sup>0</sup> of size <sup>N</sup>

tion of the anonymised supraventricular arrhythmia signal.

5.3. Performance evaluation with the PRD metric

$$\text{PRD} = \sqrt{\frac{\sum\_{i=1}^{N} \left(\mathbf{x}(i) - \mathbf{y}(i)\right)^2}{\sum\_{i=1}^{N} \mathbf{x}(i)^2}} \tag{15}$$

where x ið Þ is the original ECG signal, y ið Þ is the anonymised ECG signal and i ¼ 1…N, where N is the total number of the sample.

Performance of the proposed anonymisation algorithm using PRD metric is shown in Table 1. It can be seen from the table that the minimum and the maximum PRD measured were 14.8 and 70.6%, respectively. The PRD value depends on the ECG frequency bandwidth and its sampling frequency.

Comparing with ECG steganography methods, ECG steganography has a low PRD value between original and watermarked ECG signal. For example, in [14], the maximum PRD measured was 0.6%. Low PRD is essential in ECG steganography to guarantee correct diagnosis of the ECG watermarked signal. However, the lower value of PRD makes the ECG vulner-

Normal ECG 1000 70.6 Supraventricular arrhythmia 128 29.6 Ventricular tachyarrhythmia 250 14.8

Table 1. PRD performance results of normal and abnormal ECG signal for the proposed algorithm.

, Hz PRD %

Wavelets in ECG Security Application http://dx.doi.org/10.5772/intechopen.74477 61

ECG type Sampling frequency f <sup>s</sup>

A generalised wavelet packet-based ECG anonymisation framework has been presented in this chapter. This proposed anonymisation technique was used to conceal fiducial and non-fiducial features from normal and abnormal ECG signal for secure transmission over the public internet. Normal and abnormal ECG signals with different sampling frequencies have been investigated by the proposed method. Signal transformations other than wavelet packet transform

The performance analysis revealed that the proposed method is able to conceal both fiducial and non-fiducial features in normal and abnormal ECG signals under examination. Moreover, the analysis showed that the reconstructed ECG is highly correlated with the original ECG signal. It achieved a lossless reconstruction of the ECG data and proved the robustness of the proposed method. The security measures taken to secure the key and other information such as the level of decomposition and the knowledge of the reversible function make attacks using

1 Department of Electrical and Electronic Technology, Applied Engineering College, Lincoln

2 Department of Computer Engineering, Institut Bisnis dan Informatika Stikom Surabaya,

can be used in this framework. Such transformations should have inverse property.

\* and Jusak Jusak<sup>2</sup>

\*Address all correspondence to: seedahmed.sharif@gmail.com

College International, Buraidah, Riyadh, Kingdom of Saudi Arabia

able to attack [1–3, 9].

6. Conclusions

Author details

Seedahmed S. Mahmoud<sup>1</sup>

Surabaya, East Java, Indonesia

methods such as brute force is infeasible.

Figure 17. Power spectral density of 10-s ECG signal of a patient with supraventricular arrhythmia, (a) unanonymised ECG and (b) anonymised ECG. The sampling frequency was fs = 250 Hz, the power spectral method was Welch periodogram.

Figure 18. Time-domain representation of the first node cð Þ 2; 0 coefficients for the 10-s abnormal ECG signal in Figure 10 (a). This node was used to create the secure key.


Table 1. PRD performance results of normal and abnormal ECG signal for the proposed algorithm.

Comparing with ECG steganography methods, ECG steganography has a low PRD value between original and watermarked ECG signal. For example, in [14], the maximum PRD measured was 0.6%. Low PRD is essential in ECG steganography to guarantee correct diagnosis of the ECG watermarked signal. However, the lower value of PRD makes the ECG vulnerable to attack [1–3, 9].
