# I need a clustering algorithm for complex #'s

I'm going to be clustering sleep spindles (see pic below) based on both phase shift and amplitude at a yet-to-be-determined time during the event. The baseline will be the Cz channel, one of the 23 EEG channels. There are about 100-200 sleep spindles on each patient's recording, so I'll have something like a 23 x 100 complex-valued matrix whose columns need clustered.

Suggestions more than welcome.

Last edited:

Stephen Tashi
I don't understand how the entries in the matrix relate to the data you show in the graph.

Most clustering algorithms depend on having some notion of a "distance" between two data points. Is there a natural definition for such a "distance" between two columns of the matrix in your problem?

I'm going to be clustering sleep spindles (see pic below) based on both phase shift and amplitude at a yet-to-be-determined time during the event. The baseline will be the Cz channel, one of the 23 EEG channels. There are about 100-200 sleep spindles on each patient's recording, so I'll have something like a 23 x 100 complex-valued matrix whose columns need clustered.
...
Suggestions more than welcome.

So, what I am guessing is that the central forehead electrode is your "reference" voltage;
Does that mean you are measuring all other electrodes with respect to that potential, or is it more like in some EEG machines, where each electrode is the reference for its' nearest neighbor -- so that all channels can float relative to each other but measure local variations in voltage ONLY.

If I am understanding you correctly, you are extracting two numbers from each EEG channel -- a phase angle/delay time -- and an amplitude. So, in the example picture; the amplitude would be the high voltage minus the low voltage (pk-pk), rms, or some such value during the time that the sleep spindle shows up on the EEG. And therefore, your picture will be reduced to two "distance" numbers for use in clustering analysis, by some instrument attached to the EEG/Data, and then after this reduction -- each metric will retain a reference for which electrode it was on -- and be fed into a computer for clustering analysis....

What is the purpose of the clustering? Are you attempting to find sleep spindles which are most similar, in order to locate "where" in the brain some event "happened"; or is that information already present by the electrode measurements, and you are interested in detecting a particular sequence or pattern of spindles ? etc. eg: Are you just wanting to explore the data for "nonrandom" or (in visual processing it's called the Hemholtz principle) patterns which are some kind of signature of a particular event?

What is the purpose of the clustering? Are you attempting to find sleep spindles which are most similar, in order to locate "where" in the brain some event "happened"; or is that information already present by the electrode measurements, and you are interested in detecting a particular sequence or pattern of spindles ? etc. eg: Are you just wanting to explore the data for "nonrandom" or (in visual processing it's called the Hemholtz principle) patterns which are some kind of signature of a particular event?

Tomorrow I'll ask the neurologist who is running the research project.