prefilter
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | prefilter [2010/06/19 19:58] (current) – created jochen | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== prefilter ====== | ||
+ | The name '' | ||
+ | |||
+ | ===== Motivation ===== | ||
+ | Physiological GSR data measurements often contain quite some noise which makes analyses of those data rather difficult. This function tries to remove part of this noise by applying a derivative-based noise selection and filtering | ||
+ | |||
+ | ===== Requirements ===== | ||
+ | If the data you have is available in one of the typical GSR formats, the use of the appropriate method is preferred (either [[acq.Filter|ACQ:: | ||
+ | |||
+ | Other than that, only the data (column vector) is required. | ||
+ | |||
+ | ===== Function reference ('help prefilter' | ||
+ | < | ||
+ | |||
+ | FORMAT: | ||
+ | |||
+ | Input fields: | ||
+ | |||
+ | d data to filter | ||
+ | opts mandatory struct but with optional fields | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Output fields: | ||
+ | |||
+ | fd filtered data (forced to double datatype) | ||
+ | w | ||
+ | fcount | ||
+ | |||
+ | ===== Usage ===== | ||
+ | Given that the data is available in variable '' | ||
+ | |||
+ | <code matlab prefilter_example.m> | ||
+ | % - carrying GSR recorded data | ||
+ | % - with a 100Hz sampling rate | ||
+ | |||
+ | ===== Options explained ===== | ||
+ | The options are | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ===== Algorithm ===== | ||
+ | The algorithm can be debunked into four major components: | ||
+ | * preliminary data filtering | ||
+ | * noise detection, based on the observation of '' | ||
+ | * window-wise noise filtering (for windows with more than 25% noisy samples) | ||
+ | * post-processing (final filtering pass) | ||
+ | |||
+ | ==== Preliminary filtering ==== | ||
+ | An initial estimate of the variability of the first derivative, '' | ||
+ | |||
+ | ==== Noise detection ==== | ||
+ | After the preliminary filtering, the first derivative is computed. This signal, in itself, has the same intrinsic noise problems and is thus filtered (with exactly the same procedure as the preliminary filtering of the actual signal). Eventually, the absolute value of the second derivative is computed (strong curving of signal). There is a final filtering procedure on this second order derivative, after which parts that show strong noise (e.g. resonance phenomena) are characterized by prolonged periods where this value is high. | ||
+ | |||
+ | ==== Window-wise noise filtering ==== | ||
+ | The original (preliminary filtered!) signal is now inspected in windowed chunks. For each window where there are more than 25% noisy samples, a robust estimation of desired frequencies is performed (removing single spikes within the noise!) and only those lower frequencies of interest are kept. A sliding sum of all windows is computed and, eventually, the weighted sum of all windowed results replaces the original signal. | ||
+ | |||
+ | ==== Post-processing ==== | ||
+ | To account for the fact that window-wise algorithms do suffer from a window-selection bias (e.g. certain noise components are in frequencies that interact with the window size), a post-processing filtering is applied. For periods where no noise was detected this will not alter the signal significantly. | ||
+ | |||
+ | **Note: it is important that this filter is selected in with a cutoff that does not remove any desired frequencies from the signal!** | ||
prefilter.txt · Last modified: 2010/06/19 19:58 by jochen