K-mean clustering algorithm for processing signals from compound semiconductor detectors