Commit b33bfd76 authored by Can Pervane's avatar Can Pervane

Added new features, as given by the following paper: https://doi.org/10.1016/j.eswa.2010.06.065

parent d68beefe
......@@ -24,8 +24,39 @@ def rms(raw_matrix):
rmsValues.append(np.sqrt(np.mean(x**2)))
return np.hstack(rmsValues)
def meanAbs(raw_matrix):
"""
Calculates the mean of absolute values
"""
meanAbsValues = []
for i in range(raw_matrix.shape[1]):
x = raw_matrix[:,i]
meanAbsValues.append(np.mean(np.abs(x)))
return np.hstack(meanAbsValues)
def std(raw_matrix):
"""
standard deviation of a time series
"""
stdValues = []
for i in range(raw_matrix.shape[1]):
x = raw_matrix[:,i]
stdValues.append(np.std(x))
return np.hstack(stdValues)
def subBandRatio(raw_matrix, nBands=6):
"""
The ratio of the mean of absolute values, between adjacent columns
Note: This measure was used in a paper where the columns of the matrix represent the
frequency bands
"""
pass
extractors = {
"correlation": correlation,
"coherence": coherence,
"rms" : rms,
"meanAbs": meanAbs,
"std": std,
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment