modellingcomponents:filter
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
modellingcomponents:filter [2017/12/27 20:35] – [Filters] oliver | modellingcomponents:filter [2021/09/23 14:18] (aktuell) – [ransaccirc() - RANSAC circle model] oliver | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Filters ====== | ====== Filters ====== | ||
- | Filters are mathemematical | + | Filters are mathematical |
There is a default set of filters implemented. The available filters are explained in the following chapters. | There is a default set of filters implemented. The available filters are explained in the following chapters. | ||
Zeile 7: | Zeile 7: | ||
< | < | ||
- | stepWidth | + | stepWidth |
samplingFrequency=" | samplingFrequency=" | ||
windowWidth | windowWidth | ||
Zeile 17: | Zeile 17: | ||
</ | </ | ||
- | The filter types and characteristics can be defined in the XML markerset/ | + | The filter types and characteristics can be defined in the XML markerset/ |
- | Further | + | Custom |
====in pre-/ | ====in pre-/ | ||
- | The filter-elements defining the filter charatericstics can be used at different positions in the hierarchie of a labelset: | + | The filter-elements, defining the filter charatericstics, can be used at different positions in the hierarchie of a labelset: |
<code xml> | <code xml> | ||
<?xml version=" | <?xml version=" | ||
< | < | ||
- | < | + | < |
| | ||
| | ||
< | < | ||
- | <Filter name="butter2" implName=" | + | <Filter name="butterorder2" implName=" |
windowWidth="" | windowWidth="" | ||
zeroPhase=" | zeroPhase=" | ||
Zeile 38: | Zeile 38: | ||
| | ||
| | ||
- | < | + | < |
| | ||
| | ||
Zeile 46: | Zeile 46: | ||
</ | </ | ||
- | Defined | + | Definitions |
====in the plot-sheet==== | ====in the plot-sheet==== | ||
Zeile 82: | Zeile 82: | ||
====Poly4Diff==== | ====Poly4Diff==== | ||
===General=== | ===General=== | ||
- | A differentiation method, | + | A differentiation method, |
===Attributes=== | ===Attributes=== | ||
Zeile 94: | Zeile 94: | ||
* Yakowitz Sydney and Szidarovsky, | * Yakowitz Sydney and Szidarovsky, | ||
- | ====SmoothDiff==== | + | ===NaNs=== |
+ | If the timeserie includes NaNs the differention is done for the parts between the NaNs. If these parts are less than five, the values of this range is set to NaN. | ||
+ | ====Differentiation with smooth (smoothdiff)==== | ||
A differentiation method that simultaneously smoothes the data. This method is based on a sliding window technique. | A differentiation method that simultaneously smoothes the data. This method is based on a sliding window technique. | ||
The data is approximated within the window with a quadratic polynomial. The coefficients of the quadratic polynomial were then used for calculating the derivative at the window' | The data is approximated within the window with a quadratic polynomial. The coefficients of the quadratic polynomial were then used for calculating the derivative at the window' | ||
Zeile 101: | Zeile 103: | ||
^ Attribute ^ Default ^ Description ^ Required ^ | ^ Attribute ^ Default ^ Description ^ Required ^ | ||
^ samplingFrequency | 120 [Hz] | Scaling coeffiecient (In our case : sampling frequency) | No | | ^ samplingFrequency | 120 [Hz] | Scaling coeffiecient (In our case : sampling frequency) | No | | ||
- | ^ windowWidth | 5 | Number of points in sliding window | No | | + | ^ windowWidth | 12 | Number of points in sliding window | No | |
^ noisyData | false | Ways to treat ends - false => Not so good for noisy waveforms, but good (best) for smooth ones. true => For noisy waveforms is better than 1; Flattens ends for smooth ones. | No | | ^ noisyData | false | Ways to treat ends - false => Not so good for noisy waveforms, but good (best) for smooth ones. true => For noisy waveforms is better than 1; Flattens ends for smooth ones. | No | | ||
Zeile 107: | Zeile 109: | ||
* The original C++ implementation is from Dr. Yuri Shimansky. | * The original C++ implementation is from Dr. Yuri Shimansky. | ||
* Thanks for Laetitia Fradet for the idea to use this filter and to have a look in a Matlab implementation of this filter. | * Thanks for Laetitia Fradet for the idea to use this filter and to have a look in a Matlab implementation of this filter. | ||
+ | |||
+ | ===Issues=== | ||
+ | * The last index is set to NaN calculation of the diffential quotient needs the value for the index i+1. | ||
+ | * completly broken in the current version | ||
====Chunk Mean (chunkmean)==== | ====Chunk Mean (chunkmean)==== | ||
Zeile 122: | Zeile 128: | ||
result[i] = (data[i-2] + 3d*data[i-1] + 4d*data[i] + 3d*data[i+1] + data[i+2])/ | result[i] = (data[i-2] + 3d*data[i-1] + 4d*data[i] + 3d*data[i+1] + data[i+2])/ | ||
- | ==== Butterworth and differentiating filter (butterDiff) ==== | + | ==== Butterworth and differentiating filter (butterdiff) ==== |
- | This filter determines the derivative based on a 4-th order interpolation polynom. | + | This filter determines the derivative based on a 4-th order interpolation polynom |
- | ^ Attribute ^ Default ^ Description ^ Required ^ | + | ^ Attribute ^ Default |
- | ^ stepWidth | 1/120 [s] | | No | | + | ^ stepWidth | 1/120 | s | | No | |
- | ^ samplingFrequency | 120 [Hz] | | No | | + | ^ samplingFrequency | 120 | Hz | | No | |
- | ^ cutOffFrequency | 5 [Hz] | | No | | + | ^ cutOffFrequency | 5 | Hz | | No | |
- | ^ zeroPhase | true | If set to false, only foward direction filterering is done resulting in phase shifting. | No | | + | ^ zeroPhase | true | | If set to false, only foward direction filterering is done resulting in phase shifting. | No | |
- | ^ windowWidth | 5 | | No | | + | ^ windowWidth | 5 | | Width of the window which is moved over the timeserie. | No | |
+ | ^ deleteBorderFrames |5| | Sometimes the borders to ranges of NaN are noise. With this attribute a number of frames can be defined which are set to NaN on the border. | ||
===References=== | ===References=== | ||
- | Hildebrand, F.B. (1974). Introduction to Numerical Analysis, 2nd Edition, pp.111 | + | * Hildebrand, F.B. (1974). Introduction to Numerical Analysis, 2nd Edition, pp.111. |
- | Kreyszig, Erwin (1983). Advanced Engineering Mathematics, | + | |
+ | * Yakowitz Sydney and Szidarovsky, | ||
- | ==== Butterworth second order (butterOrder2) ==== | + | ==== Butterworth second order (butterorder2) ==== |
- | Zero-phase forward and reverse butterworth filter of 2. order. | + | Zero-phase forward and reverse |
- | ^ Attributre ^ Default ^ Description ^ Required ^ | + | ^ Attributre ^ Default |
- | ^ samplingFrequency | 120 [Hz] | | No | | + | ^ samplingFrequency | 120 | Hz | | No | |
- | ^ cutOffFrequency | 5 [Hz] | | No | | + | ^ cutOffFrequency | 5 | Hz | | No | |
- | ^ windowWidth | 5 | | No | | + | ^ windowWidth | 5 | | | No | |
- | ^ sectionMinLength | 10 | Segments minimal count of frames. If the data contains segments with less frames a warning is given and the data of that segment is not filtered. | No | | + | ^ sectionMinLength | 10 | | Segments minimal count of frames. If the data contains segments with less frames a warning is given and the data of that segment is not filtered. | No | |
- | ^ zeroPhase | false | | No | | + | ^ zeroPhase | false | | | No | |
====Discrete Fourier Transformation (dft/ | ====Discrete Fourier Transformation (dft/ | ||
Zeile 198: | Zeile 206: | ||
==== zero2nan ==== | ==== zero2nan ==== | ||
+ | This filter is used as a workaround for data collection by a vicon system where it can happen that all three components of a position are equal 0 which mean that the data is wrong. The filter detects this case and sets the data point values to NaN. | ||
==== moverms ==== | ==== moverms ==== | ||
==== defaultemg==== | ==== defaultemg==== | ||
==== bandpass==== | ==== bandpass==== | ||
==== rectification==== | ==== rectification==== | ||
+ | Caculates the absolute values. There are no properties. | ||
+ | |||
==== removeoffset==== | ==== removeoffset==== | ||
+ | |||
+ | ==== oneeuro==== | ||
+ | |||
+ | This is a simple lowpassfilter especially usefull for filtering humon motion data. | ||
+ | |||
+ | To minimize jitter and lag when tracking human motion, the two parameters (**minCutOffFrequency** and **beta**) can be set using a simple two-step procedure. | ||
+ | |||
+ | First beta is set to **0** and **minCutOffFrequency** to a reasonable middle-ground value such as **1 Hz**. Then the body part is held steady or moved at a very low speed while **minCutOffFrequency** is adjusted to remove jitter and preserve an acceptable lag during these slow movements (decreasing **minCutOffFrequency** reduces jitter but increases lag, **minCutOffFrequency** must be **> 0**). | ||
+ | |||
+ | Next, the body part is moved quickly in different directions while **beta** is increased with a focus on minimizing lag. First find the right order of magnitude to tune beta, which depends on the kind of data you manipulate and their units: do not hesitate to start with values like 0.001 or 0.0001. You can first multiply and divide beta by factor 10 until you notice an effect on latency when moving quickly. Note that parameters **minCutOffFrequency** and **beta** have clear conceptual relationships: | ||
+ | |||
+ | ^ Attribute ^ Default ^ Unit ^ Description ^ Required ^ | ||
+ | ^ samplingFrequency | 120 | Hz | | No | | ||
+ | ^ minCutOffFrequency | 5 | Hz | | No | | ||
+ | ^ beta | 1 | Hz | | No | | ||
+ | ^ dCutOffFrequency | 0 | Hz | | No | | ||
+ | |||
+ | ===References=== | ||
+ | * Casiez G., Roussel N., et.al. 1EUR Filter (2012). CHI' | ||
+ | |||
+ | ==== resampling ==== | ||
+ | |||
+ | Resampling with simple linear inper/ | ||
+ | |||
+ | ^ Attribute ^ Default ^ Unit ^ Description ^ Required ^ | ||
+ | ^ inFrequency | 120 | Hz | | No | | ||
+ | ^ outFrequency | | Hz | | Yes | | ||
+ | |||
+ | If outFrequency > inFrequency the more frames at the end are cut, else the unavailable frames at the end are filled with NaN. | ||
+ | |||
+ | ==== interpolation() - Interpolation ==== | ||
+ | Interpolation NaN/ | ||
+ | |||
+ | ^ Attribute ^ Default ^ Description | ||
+ | ^ method | linear | Possible methods are dividedDifference, | ||
+ | |||
+ | ^ Method ^ References ^ | ||
+ | ^ linear | | | ||
+ | ^ spline | | | ||
+ | ^ loess | Locally weighted regression and smoothing scatterplots, | ||
+ | ^ neville | Introduction to Numerical Analysis, ISBN 038795452X, chapter 2. | | ||
+ | ^ dividedDifference | Introduction to Numerical Analysis, ISBN 038795452X, chapter 2. or Hildebrand, F. B. Introduction to Numerical Analysis. New York: McGraw-Hill, | ||
+ | NaN-values at the end of the timeserie can not be interpolated. | ||
+ | |||
+ | ==== ransaclin() - RANSAC linear model (1d) ==== | ||
+ | RANSAC with linear model. | ||
+ | ^ Attribute ^ Default ^ Description | ||
+ | ^ threshold | 0.04 | Threshold value to determine data points that are fit well by the linear model. | yes | | ||
+ | ^ maxiterations | 1000 | Maximum number of iterations allowed in the algorithm. | yes | | ||
+ | ^ inlierratio | 0.8 | Ratio of inlier number of data points to estimate model parameters from all points. The result is substitution by the current iteration only if at minimum the count of inlierratio of all frames fits to the result. | yes | | ||
+ | ^ minimumnumber | 50 | Number of close data points required to assert that a model fits well to data. This is the number of frames which are randomly selected in a iteration of optimization | yes | | ||
+ | ^ excludethreshold | not used | If this attribute is set to a double value bigger than zero, than fitted data is compared to the raw data and if the difference between both exceeds this threshold value the value is set to NaN else the raw data value is used. | yes | | ||
+ | ^ fit | not used/false | Only used if excludethreshold is set. If set to true and excludethreshold is set, then all positions for which the value is bigger than excludethreshold the value is substituted by the fitted one instead of NaN. | yes | | ||
+ | |||
+ | If this filter is used to filter multi-component data types, e.g. Matrix3d, it can happen that only some components are set to NaN. | ||
+ | |||
+ | ==== ransaccirc() - RANSAC circle model (3d) ==== | ||
===== Adding filters via external " | ===== Adding filters via external " |
modellingcomponents/filter.1514403310.txt.gz · Zuletzt geändert: 2017/12/27 20:35 von oliver