Processing Blocks
Flatten
Summarise each axis of a window with a few simple statistics, for very small and fast models.
Try it in StudioOn this page
What is this block?
Flatten describes each axis of a window with a handful of numbers, such as its average and how much it varies. It is like describing a song by "how loud on average" and "how much the loudness changes", instead of playing the whole song.
Why do we use it?
Many movements are easy to tell apart from simple statistics. "Lying still" barely varies; "walking" varies a lot. A few numbers per axis give a very small input, so the model is small and fast.
How does it work?
For every selected axis, the block:
- Multiplies the values by Scale axes.
- Optionally smooths the signal with a moving average (Moving average window).
- Computes each statistic ticked under Method.
What input does it receive?
One window from the impulse, with every axis you selected.
What output does it produce?
Axes × statistics numbers. With three axes and all seven statistics that is 21 numbers per window.
What do its settings mean?
Settings are on the block's Parameters tab in Studio.
| Setting | Default | What changing it does |
|---|---|---|
| Scale axes | 1 | Multiplies all values before the statistics are computed. |
| Method | All seven ticked | The statistics to compute: Average, Minimum, Maximum, Root-mean square, Standard deviation, Skewness, Kurtosis. At least one must stay ticked. Fewer statistics give a smaller model. |
| Moving average window | 0 (off) | Smooths each axis over this many samples (0–128) before computing statistics. Helps with noisy sensors. |
On the Generate features tab, Normalize features can be set to Enabled. Studio then rescales every feature using the average and spread of the training data, so features with large numbers don't dominate features with small numbers.
Simple example
You record idle and walking at 100 Hz with a 1000 ms window. For the accX axis:
| Label | Average | Standard deviation |
|---|---|---|
| idle | about 0 | very small |
| walking | about 0 | large |
The averages look the same, but the standard deviation separates the two labels clearly.
When should I use it?
- Use it for postures, slow or steady movements, and when the model must be very small.
- Try Spectral Analysis instead when movements differ by rhythm or speed of repetition, for example wave vs shake.
- Try Raw Data instead when the exact shape of a movement matters, together with a 1D Convolutional learning block.