or for now k-Means Clustering with coherence as distance metric
Unsupervised clustering algoirthm which clusters timeseries based on coherence.
Coherence between two signals is defined as:
xnt: data
k: number of clusters
fs: sampling frequency
nperseg: number of timepoints in each trial (to compute FFT over and average)
itemax: max number of iterations to optimize
from cmm import CMM
cm = CMM(
xnt,
k=k,
fs=fs,
nperseg=nperseg,
)
cm.optimize(itemax=itemax)
print(cm.labels)