Benutzer-Werkzeuge

Webseiten-Werkzeuge


modellingcomponents:filter

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
modellingcomponents:filter [2017/12/27 20:35] – [Filters] olivermodellingcomponents:filter [2021/09/23 14:18] (aktuell) – [ransaccirc() - RANSAC circle model] oliver
Zeile 1: Zeile 1:
 ====== Filters ====== ====== Filters ======
-Filters are mathemematical operations running on a timeserie as a whole. They can be used as a preprocessing step, applied to the raw measurment data, at the end of the processing as a postprocessing step or "temporarily" for visualisation in a plot sheet. +Filters are mathematical operations running on a timeserie as a whole. They can be used as a preprocessing step, applied to the raw measurment data, at the end of the processing as a postprocessing step or "temporarily" for visualisation in a plot sheet. 
  
 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:
  
 <code> <code>
-stepWidth        =1/120+stepWidth        ="1/120"
 samplingFrequency="120" samplingFrequency="120"
 windowWidth      ="12" windowWidth      ="12"
Zeile 17: Zeile 17:
 </code> </code>
  
-The filter types and characteristics can be defined in the XML markerset/labelset files which define the which data is loaded for processing or which parts of the processed data should be written in an output file. +The filter types and characteristics can be defined in the XML markerset/labelset files which define the data loaded for processing or which parts of the processed data should be written in an output file. 
  
-Further filters can be added by an plugin architecture.+Custom filters can be added by an plugin architecture.
  
 ====in pre-/postprocessing==== ====in pre-/postprocessing====
  
-The filter-elements defining the filter charatericstics can be used at different positions in the hierarchie of a labelset:+The filter-elementsdefining the filter charatericsticscan be used at different positions in the hierarchie of a labelset:
  
 <code xml> <code xml>
 <?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
 <LabelSet> <LabelSet>
- <Filter name="butter2" implName="default" cutOffFrequency="20"+ <Filter name="butterorder2" implName="default" cutOffFrequency="20"
          windowWidth="" stepWidth="" noisyData="true" samplingFrequency="1211"          windowWidth="" stepWidth="" noisyData="true" samplingFrequency="1211"
          zeroPhase="true" sectionMinLength="3"/>            zeroPhase="true" sectionMinLength="3"/>  
  <Labels fileSuffix="c3d" mimeType="application/c3d-vicon">  <Labels fileSuffix="c3d" mimeType="application/c3d-vicon">
-    <Filter name="butter2" implName="default" cutOffFrequency="20"+    <Filter name="butterorder2" implName="default" cutOffFrequency="20"
             windowWidth="" stepWidth="" noisyData="true" samplingFrequency="1211"             windowWidth="" stepWidth="" noisyData="true" samplingFrequency="1211"
             zeroPhase="true" sectionMinLength="3"/>               zeroPhase="true" sectionMinLength="3"/>  
Zeile 38: Zeile 38:
            secondDerivative="" thirdDerivative="" differentiations=""            secondDerivative="" thirdDerivative="" differentiations=""
            optional="" unchangeable="" mathType="">            optional="" unchangeable="" mathType="">
-       <Filter name="butter2" implName="default" cutOffFrequency="20"+       <Filter name="butterorder2" implName="default" cutOffFrequency="20"
                windowWidth="" stepWidth="" noisyData="true" samplingFrequency="1211"                windowWidth="" stepWidth="" noisyData="true" samplingFrequency="1211"
                zeroPhase="true" sectionMinLength="3"/>                  zeroPhase="true" sectionMinLength="3"/>  
Zeile 46: Zeile 46:
 </code> </code>
  
-Defined as the first child of the labelset-element it is applied to all timeseries, as a child of an label-element it is only applied to the timeserie the label corresponds to.+Definitions as the first child of the labelset-element are applied to all timeseries, as a child of an label-element are applied only to the timeserie the label corresponds to.
  
 ====in the plot-sheet==== ====in the plot-sheet====
Zeile 82: Zeile 82:
 ====Poly4Diff==== ====Poly4Diff====
 ===General=== ===General===
-A differentiation method, that simultaneously smoothes the data by application of a 4-th order interpolation polynom (5 points). Minimum trial length is four.+A differentiation method, implemented by application of a 4-th order interpolation polynom (5 points) based on a sliding window with width 5Thaś why the minimum trial length is five.
  
 ===Attributes=== ===Attributes===
Zeile 94: Zeile 94:
   * Yakowitz Sydney and Szidarovsky, Ferenc (1989). An Introduction to Numerical Computations, 2nd Edition, pp.18   * Yakowitz Sydney and Szidarovsky, Ferenc (1989). An Introduction to Numerical Computations, 2nd Edition, pp.18
  
-====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's center (Rand and Stelmach, 2005).  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's center (Rand and Stelmach, 2005). 
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 | | 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])/12d result[i] = (data[i-2] + 3d*data[i-1] + 4d*data[i] + 3d*data[i+1] + data[i+2])/12d
  
-==== 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 (poly4diff) after conversion of 0-values to NaN and a data smoothing by a butterworth filter with second order. This filter is used as default for calculation of derivatives, e.g. configured by the attribute "differentiations" in the label of input labelset.
  
-^ Attribute ^ Default ^ Description ^ Required ^ +^ Attribute ^ Default ^ Unit ^ Description ^ Required ^ 
-^ 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. | No |
  
 ===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, 5th Edition, pp.793 YakowitzSydney and Szidarovsky, Ferenc (1989). An Introduction to Numerical Computations, 2nd Edition, pp.18+  Kreyszig, Erwin (1983). Advanced Engineering Mathematics, 5th Edition, pp.793
 +  * Yakowitz Sydney and Szidarovsky, Ferenc (1989). An Introduction to Numerical Computations, 2nd Edition, pp.18.
  
-==== Butterworth second order (butterOrder2) ====+==== Butterworth second order (butterorder2) ====
  
-Zero-phase forward and reverse butterworth filter of 2. order. +Zero-phase forward and reverse (optional) butterworth filter of second order. 
  
-^ Attributre ^ Default ^ Description ^ Required ^ +^ Attributre ^ Default ^ Unit ^ Description ^ Required ^ 
-^ 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/dft_bin)==== ====Discrete Fourier Transformation (dft/dft_bin)====
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: if high speed lag is a problem, increase beta; if slow speed jitter is a problem, decrease minCutOffFrequency.
 +
 +^ 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'12, the 30th Conference on Human Factors in Computing Systems
 +
 +==== resampling ====
 +
 +Resampling with simple linear inper/extrapolation.
 +
 +^ 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/Inf-values with different possible methods.
 +
 +^ Attribute ^ Default ^ Description  ^
 +^ method | linear | Possible methods are dividedDifference, linear, loess, neville and spline. | 
 +
 +^ Method ^ References ^
 +^ linear | |
 +^ spline | |
 +^ loess | Locally weighted regression and smoothing scatterplots, W.S. Cleveland, Journal of the American Statistical Association, Vol. 74, No. 368 (Dec., 1979), pp. 829-836. |
 +^ 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, pp. 43-44 and 62-63, 1956. |
 +NaN-values at the end of the timeserie can not be interpolated.
 +
 +==== ransaclin() - RANSAC linear model (1d) ====
 +RANSAC with linear model.
 +^ Attribute ^ Default ^ Description  ^ Optional ^
 +^ 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 "Math-Engines" like Matlab ===== ===== Adding filters via external "Math-Engines" like Matlab =====
modellingcomponents/filter.1514403310.txt.gz · Zuletzt geändert: 2017/12/27 20:35 von oliver

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki