python - Clustering of 1D signal -


i've got several 1d signals, showing 2 or more bands. example shown below. raw data

i need extract datapoints belonging single band.


my first simple approach taking moving average of data, , indices data larger average.

def seperate(x):     average = scipy.ndimage.gaussian_filter(x, 10)     # gives me boolean array indices of upper band.     idx = x > average     # return indices of upper , lower band     return idx, ~idx 

plotting these , average curve this, red denotes upper , blue lower band. selected bands

this works quite example, fails when more 2 bands present and/or bands not separated.

i'm looking more robust , general solution. looking scikit-learn , wondering if 1 of clustering algorithms can used achieve this.

have time series similarity measures.

indeed, have seen binary thresholding tried there called "threshold crossing", , many more.

in general, there no "one size fits all" time series similarity. different types of signals require different measures. can best seen fact better analyzed after fft, while others fft makes absolutely no sense.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -