Support Vector Machines like almost all classifiers require that the training samples are represented as feature vectors that lie in a feature space.
In order to create such feature vectors you'll have to do feature extraction to your signals. That is, you have to extract some measurable discriminating scale invariant features from your signals (e.g., wavelet coefficients).
Once you do that, you'll have to organize your feature vectors as the rows (or columns) of a data-matrix. A data-matrix is a 2D matrix where its rows (or its columns) are the feature vectors previously extracted. For example suppose that you have 3 signals that are represented by 3D feature vectors (i.e., from each one of your signals you've extracted 3 features).
, ,
(Where T denotes the transpose).
Then your data matrix would be:
After creating the data-matrix you'll have to create the vector of the data labels. Labels' vector is a 1D vector with the same number of rows (or columns) as your data matrix and contains the class labels corresponding to your feature vectors. Since your problem consists of two classes (i.e., normal and non-normal) your labels vector would have only 2 symbols (e.g., normal = -1, non-normal = 1). Continuing on the previous example if normal and non-normal, your labels vector would look like
Now as far as it concerns the LibSVM part: LibSVM uses the LibSVM format to store the data matrix along with the class labels in a .txt
file.
The format of file is:
<label> <index1>:<value1> <index2>:<value2>
Following our example the contents of your file would look like:
-1 1:1 2:2 3:3
-1 1:4 2:5 3:6
1 1:7 2:8 3:9
Have in mind though, that if you have zeroth values you can omit them. For example if then your file would look like:
-1 2:2 3:3
-1 1:4 2:5 3:6
1 1:7 2:8 3:9
Also notice that in each row of the file, first you write the class label of the feature vector and then its values.
Once you've created the file mentioned above, you are ready to go. In the LibSVM's site you'll find all the instructions need it to run LibSVM with your file.