Skip to content

zero_crossing_counter

nickgillian edited this page Aug 21, 2016 · 4 revisions

#Zero Crossing Counter

##Description The ZeroCrossingCounter class counts the number of zero crossings that occur in an N dimensional signal over a given window. The ZeroCrossingCounter stores the incoming N dimensional signal in a circular buffer, it then computes two main features from the data in this buffer, these are:

  • zero-crossing count: the number of times the derivative of the input signal crosses zero within the buffer
  • zero-crossing magnitude: the absolute sum of the input signal at the locations where the derivative of the input signal crosses zero within the buffer

The ZeroCrossingCounter can compute these features in two modes:

  1. INDEPENDANT_FEATURE_MODE
  2. COMBINED_FEATURE_MODE

In INDEPENDANT_FEATURE_MODE the zero-crossing count and zero-crossing magnitude features will be computed independently for each of the N dimensions in the input signal.

In COMBINED_FEATURE_MODE the zero-crossing count and zero-crossing magnitude features will be integrated across all of the N dimensions in the input signal. This means that if the ZeroCrossingCounter is set to INDEPENDANT_FEATURE_MODE, the size of the output feature vector will be 2 * N, where 2 is the two features (zero-crossing count and zero-crossing magnitude) and N is the number of dimensions in the input signal. Alternatively in COMBINED_FEATURE_MODE the size of the output vector will simply be 2, where 2 is the two features (zero-crossing count and zero-crossing magnitude). The feature modes can be set either in the ZeroCrossingCounter constructor or by using the setFeatureMode(UINT featureMode) function.

The ZeroCrossingCounter class is part of the Feature Extraction Modules.

ZeroCrossingCounter An example of the features output from the ZeroCrossingCounter. This example shows a recording of a 3 dimensional accelerometer signal (top graph), you should be able to identify how the accelerometer was shaken 5 times. The first two shakes were short left (shake 1) then right (shake 2) shakes. The remaining 3 shakes were longer shakes, primarily in the X (shake 3), Y (shake 4), and Z (shake 5) axis. The mid and lower graphs show the output features from the ZeroCrossingCounter, with the mid graph showing the zero-crossing count features for the 3 input axis, and the bottom graph showing the zero-crossing magnitude values for the 3 input axis.

##Applications The ZeroCrossingCounter class is good for extracting features that describe how much change is occurring in an N-dimensional signal. An example application might be to use the ZeroCrossingCounter in combination with one of the GRT classification algorithms to determine if an object is being shaken, and if so, how the object is being shaken.

##Example Zero Crossing Counter Example