# Interval-Based LDA Algorithm for Electrocardiograms for Individual Verification
## 2 Materials and Methods
### Verification
\begin{array}{c}\text{S}_{\varnothing}=\frac{1}{(NI\cdot L)}\sum\limits_{i=1 }^{NI}\sum\limits_{v=0}^{L-1}\Omega(i,v)\text{ for a given class}\\ \end{array} \]  
Given \(\Delta\varphi_{c}^{B}(i,v)\), if \(\Delta\varphi_{c}^{B}(i,v)\leq TH_{\phi}(i,v)\), the corresponding ACP pixel is counted as \"accepted\", i.e., the similarity \(\Omega(i,v)=1\). Else if \(\Delta\varphi_{c}^{B}(i,v)>TH_{\phi_{max}}(i,v)\), the corresponding ACP pixel is counted as \"declined\", that is, the similarity score \(\Omega(i,v)=0\). If \(TH_{\phi}(i,v)<\Delta\varphi_{c}^{B}(i,v)\leq TH_{\phi_{max}}(i,v)\), the corresponding ACP pixel is counted as \"partially accepted\" and the similarity score is given by \(\Omega(i,v)=\frac{TH_{\phi}(i,v)}{\Delta\varphi_{c}^{B}(i,v)}\), which ranges from 0 to 1. Finally, the similarity of the amplitude distance (\(S_{\phi}\)) is determined as the average of the similarity score calculated on a pixel-by-pixel basis. **Step 4:** Compute the angle distance \(\theta_{c}^{B}(i)\)  
Define \(\theta_{c}^{B}(i_{o})\) as the angle \(\theta\) of the \(x\)-axis to the most discriminant projection vector of the datasets, \((x,z)\) and \((x,r)\) where  
\[ \begin{array}{c}x=\{\forall v\},\\ z=\left\{\varphi_{c}^{B}(i_{o},v)\big{|}i_{o}\in i,\forall v\right\}\text{ for a given class }c\\ r=\left\{\overline{\varnothing}^{A}(i_{o},v)\big{|}i_{o}\in i,\forall v\right\} \end{array}  \tag{24}\]  
The method of finding the most discriminant projection vector is the same as the method used to calculate the most discriminant vector in the enrollment mode. Subsequently, define \(\theta_{c}^{B}(i_{o})\) as the angle distance per interval between datasets \((x,z)\) and \((x,r)\) for a given \(c\) and \(i_{o}\). **Step 5:** Calculate the similarity of angle distance: \(S_{\theta}\)  
The similarity of angle distance (\(S_{\theta}\)) can be obtained by applying the threshold of the angle similarity to \(\theta_{c}^{B}(i)\) as follows:  
\[ \begin{array}{c}\text{for }i=1\;:NI\\ if\;\theta_{c}^{B}(i)\leq TH_{\theta_{1}}(i),\,\Lambda(i)=\frac{TH_{\theta_{1 }}(i)}{\theta_{c}^{B}(i)}\\ if\;\theta_{c}^{B}(i)\geq TH_{\theta_{2}}(i),\,\Lambda(i)=\frac{TH_{\theta_{ 2}}(i)}{\theta_{c}^{B}(i)}\\ \Lambda(i)=0\text{ if }\left(\theta_{c}^{B}(i)\text{<}TH_{\theta_{min}}(i) \text{ or }\theta_{c}^{B}(i)>TH_{\theta_{max}}(i)\right)\\ \Lambda(i)=1\text{ if }TH_{\theta_{1}}(i)\leq\theta_{c}^{B}(i)\leq TH_{\theta_{2}}(i) \text{ for a given class}\\ \end{array}  \tag{25}\]  
end  
\[ \begin{array}{c}S_{\theta}=\frac{1}{NI}\sum\limits_{i=1}^{NI}\Lambda(i)\text { for a given class}\\ \end{array}  \tag{26}\]Given \(\theta_{c}^{B}(i)\), if \(TH_{\theta_{min}}(i)\leq\theta_{c}^{B}(i)<TH_{\theta_{1}}(i)\) or \(TH_{\theta_{2}}(i)<\theta_{c}^{B}(i)\leq TH_{\theta_{max}}(i)\), the corresponding ACP interval is counted as \"partially accepted\", that is, the similarity score is \(\Lambda(i)=\frac{TH_{\theta}(i)}{\theta_{c}^{B}(i)}\), which has the range [0,1], or else if \(\theta_{c}^{B}(i)<TH_{\theta_{min}}(i)\) or \(\theta_{c}^{B}(i)>\)\(TH_{\theta_{max}}(i)\), the corresponding ACP interval is counted as \"declined\", that is, the similarity score \(\Lambda(i)=0\), or else if \(TH_{\theta_{1}}(i)\leq\theta_{c}^{B}(i)\leq TH_{\theta_{2}}(i)\), the corresponding ACP interval is counted as \"accepted\" and the similarity score is given by \(\Lambda(i)=1\). The similarity of the angle (\(S_{\theta}\)) is determined as the average of the similarity scores calculated on an interval-by-interval basis. **Step 6:** Calculate the matching score  
For every incoming class, we define a matching score \(S=0.5S_{\phi}+0.5S_{\theta}\) with a range from 0 to 1, where 1 means a perfect match. Given a matching score \(S\), the system finally determines whether the score \(S\) is above a certain threshold \(S_{TH}\), called as the matching threshold, for signature identification.