# ECG Arrhythmia Classification using High Order Spectrum and 2D Graph Fourier Transform
## 2 Methods
### Graph Fourier Transform (GFT)  
The Graph Fourier Transform (GFT) is the expansion of a graph signal function in terms of the eigenfunctions of the graph Laplacian matrix and is the foundation of GSP. The GFT is a data conversion method that is similar to the Fourier transform (FT).  
After bispectrum analysis for the single heartbeat, the bispectrum results can be regarded as an image. We can execute 2D-GFT on the bispectrum results which is similar to execute 2D-FFT on images.  
Superior to classical signal processing, graphs can be applied in irregular domains, so graph signal processing can be used to handle the irregular relationships between the data points [30].  
An undirected graph **G**(**V**,**E**,**W**) usually includes the following three domain components: the vertex set **V**, the edge set **E**, and the weighted adjacency matrix **W**. \(N\) is the length of matrix row or  
Figure 1: Block diagram of the proposed method for ECG beat classification.  
column and also the number of vertices. Element \(w_{ij}=1\) is defined to show there is a connection between nodes \(i\) and \(j\), otherwise \(w_{ij}=0\). The matrix \(\mathbf{W}\) is the combination of elements \(w_{ij}\).  
Graph Laplacian matrix \(\mathbf{L}\) is defined by  
\[\mathbf{L}\mathbf{=}\mathbf{D}\mathbf{-}\mathbf{W}, \tag{3}\]  
where the \(i\)th diagonal element in the diagonal matrix \(\mathbf{L}\) is defined by.  
\[d_{i}=\sum_{j=1,j\
eq i}^{N}w_{ij}, \tag{4}\]  
The real symmetric matrix \(\mathbf{L}\) has a complete set of orthonormal eigenvectors \(\{x_{l}|l=0,1,\cdots,N-1\}\) and the corresponding real eigenvalues \(\lambda_{l}\), where the eigenvalues \(\lambda_{l}\) are all non-negative.  
Vector \(s\in R^{N}\) can be used to represent the signal of the vertices of a graph, with the \(i\)th component \(s_{i}\) representing the signal value at the \(i\)th vertex in \(\mathbf{V}\).  
The classical FT expands a continuous function considering the complex exponentials. Corresponding to FT, for a function \(\mathbf{s}\in R^{N}\), the GFT expands it in terms of the eigenvectors of the graph Laplacian domain. The GFT and inverse GFT of a graph signal \(s(n)\) are defined by Equations (5) and (6).  
\[\delta(l)=\langle s,x_{l}\rangle=\sum_{n=1}^{N}x_{l}(n)*s(n),\ (l=0,1,\cdots,N-1), \tag{5}\]  
\[s(n)=\sum_{l=0}^{N-1}\delta(l)x_{l}(n),\ (n=1,2,\cdots,N), \tag{6}\]  
where \(x_{l}\) quantifies the dependency of the vertex \(l\). \(\langle s,x_{l}\rangle\) represents the inner product of \(s\) and \(x_{l}\). \(*\) denotes convolution operation. From the definitions of the GFT and inverse GFT, the conservation equation of energy can be obtained as Equation (7).  
\[\sum_{n=1}^{N}\bigl{|}s(n)\bigr{|}^{2}=\bigl{|}\|s\|_{2}^{2}=\bigl{|}\|s\|_{2 }^{2}=\sum_{l=0}^{N-1}\bigl{|}\delta(l)\bigr{|}^{2}, \tag{7}\]  
where \(\|\cdot\|_{2}^{2}\) represents energy, \(\|s\|_{2}^{2}\) denotes energy of signal, and \(\|s\|_{2}^{2}\) denotes energy of eigenvalue spectral components.  
In the 1D Euclidian Domain, the adjacency matrix is only affected by its precedent and ancient nodes. However, in 2D Euclidian Domain, the adjacency matrix is dominated by its precedent and ancient nodes both in rows and columns [31]. Meanwhile, the diagonal elements in the diagonal matrix are same as in the 1-D domain. For the \(N\)th point data, the length and width of the adjacency matrix in 2D Euclidian Domain are \(N\).  
In 2D Euclidian Domain, the index is bound with the row subscript \(x\) and column subscript \(y\),  
\[d_{xy}=\left(\sum_{i=1}^{N}\sum_{j=1}^{N}w_{ij}\right)-w_{xy}, \tag{8}\]  
The 2D-GFT and inverse 2D-GFT of a graph signal \(S(i,j)\) are defined by Equations (9) and (10).  
\[\delta(m,n)=\langle s,x_{mn}\rangle=\sum_{j=1}^{N}\sum_{i=1}^{N}x_{mn}(i,j)*s( i,j),\ (m,n=0,1,\cdots,N-1), \tag{9}\]\[s(i,j)=\sum_{n=0}^{N-1}\sum_{m=0}^{N-1}\hat{s}(m,n)x_{mn}(i,j),(i,j=1,2,\cdots,N), \tag{10}\]  
where \(x_{mn}\) quantifies the dependency of the vertex \((m,n)\).