Motiondescriptors¶
mg_motiondescriptors ¶
mg_motiondescriptors(self, window='hann', entropy_bins=50, fmin=0.2, fmax=10.0, save_data=True, save_plot=True, data_format='csv', target_name=None, overwrite=True)
Scalar movement descriptors derived from the quantity-of-motion (QoM) signal.
Computes a compact set of higher-level descriptors that summarise how something moves,
complementing the per-frame motion data from :func:motion:
- motion_energy — mean squared QoM; the overall amount of movement.
- motion_smoothness — SPARC (spectral arc length) of the QoM profile; a dimensionless, validated smoothness metric (less negative = smoother, more negative = jerkier).
- motion_entropy — normalised (0–1) Shannon entropy of the QoM magnitude distribution; the complexity/variedness of the motion.
- spectral descriptors of the QoM signal (Hann-windowed by default): the dominant frequency (Hz, the main movement-rhythm rate) and the spectral centroid (Hz, the "centre of mass" of the movement spectrum).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
str
|
FFT window for the spectral descriptors — 'hann' (default, recommended to reduce leakage) or 'none' for a rectangular window. |
'hann'
|
entropy_bins
|
int
|
Number of histogram bins for the entropy estimate. Defaults to 50. |
50
|
fmin
|
float
|
Lowest frequency (Hz) considered for the dominant frequency and spectral centroid, excluding slow amplitude drift near DC. Defaults to 0.2. |
0.2
|
fmax
|
float
|
Highest frequency (Hz) considered for those spectral descriptors. Defaults to 10.0. |
10.0
|
save_data
|
bool
|
Save the descriptors to a data file. Defaults to True. |
True
|
save_plot
|
bool
|
Save the figure (QoM time series + power spectrum). Defaults to True. |
True
|
data_format
|
str
|
Data file format: 'csv', 'tsv' or 'txt'. Defaults to 'csv'. |
'csv'
|
target_name
|
str
|
Output image name. Defaults to None ( |
None
|
overwrite
|
bool
|
Overwrite or auto-increment the filename. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
MgFigure |
'MgFigure'
|
figure whose |
'MgFigure'
|
( |
Source code in musicalgestures/_motiondescriptors.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |