I am looking to classify ECG signal using with neural network. I have never done signal analysis before.

From the samples of data I have, I have noramlised, transformed using the FFT , get the pics, amplitudes and the frequencies. Now, How do I feed those values, to my ANN (Artificial Neural Network)? This looks like a tuple(pair of value) for each row.

Sorry. I have no much experience in engineering but I am recently challenge myself on area that is not particularly mine.


Since you haven't mentioned exactly what you want to classify or how you're building your network I'll give a more general explanation of how you prepare data for a classification task and the general shape of the network.

The important part of any classification problem using a neural network is to figure out what your classes are going to be. Sometimes you know the classes in advance (i.e. you can label your data), sometimes you need to identify the classes after collecting your data using a clustering algorithm or some other prcess.

Since you're dealing with ECG FFT data (I assume you're referring to an electrocardiogram?) some examples of classes you might have would be specific people (i.e. heartbeat info for person A, person B, and person C) and you want your ANN to classify which person it is based on heartbeat. Another case could be a binary classification between a "healthy" heartbeat and an "unhealthy" heartbeat. For these sorts of examples you would probably be able to label the data in advance (ex. you know that dataset 17 was measured from participant #27, who was healthy).

Once you have labelled data you can think about how to use it in your network. Let's use the example of having three people who you want to identify based on heartbeat (person A, person B, and person C). You have $n$ frequency data per test, and $N$ total tests (with multiple tests per person I hope, otherwise you won't be able to do anything meaningful). We need to express the classification as some vector, so with three classes you should have a three-element vector ([1 0 0] means person A, [0 1 0] means person B, and [0 0 1] means person C).

Now you know your input (a vector containing $n$ magnitudes corresponding to a set of frequencies) and your output (a three-element vector indicating the class). Therefore you need a network with $n$ input nodes (one for each data point in a given test set) and three output nodes (one for each class). When you input a given frequency set to your network you'll get a 3-element output, for example [1 0 1]. You compare that to your label (let's say this set was taken from person A, so your label should be [1 0 0]) and take the difference between the two as your error, which is fed back to the network to help it learn. This process is repeated many times until the network gets good at classifying the data.

Most packages handle the minutia of the learning process for you, so all you need to do is specify the size of your network, give it an input set and the corresponding output set (labels).

  • $\begingroup$ Ok. thanks I have 3 classes(Normal, arrythmiaA, arrythmiaB). 3 matrices ,containing different amount of the columns (over 80 for each of them).After playing with using fft and finding the pics and amp. I find myself with requencies and amplititudes for each variables. That cant go into the NN. $\endgroup$
    – Camue
    Aug 16 '18 at 22:19
  • $\begingroup$ If you have too many inputs to put into a single network, try reducing them by either using relevant statistics (average, variance, etc.), lumping your data into larger frequency 'buckets', or finding a way to extract only the data at the most relevant frequencies $\endgroup$ Aug 16 '18 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.