|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.android.activityminer.logic.filter.GravitationFilter
public class GravitationFilter
Adaption of the original android 2.3.7 gravity filter reference implementation from API-Level 10 source. (Quelle: https://github.com/android/platform_frameworks_base/blob/gingerbread-release/services/sensorservice/GravitySensor.cpp).
| Field Summary | |
|---|---|
private ButterworthLowPassFilter.BWFilter |
bwFilter
The filter for coefficient calculation |
private ButterworthLowPassFilter.CascadedBiquadIIRBWFilter[] |
cbqFilter
The filters for gravitation component in the three axis values. |
static double |
DEFAULT_CORNER_FREQUENCY
The default corner frequency for the butterworth filter |
(package private) long |
lastDt
The last time differences |
| Constructor Summary | |
|---|---|
GravitationFilter(double fc)
Constructor |
|
GravitationFilter(double fc,
int order)
Constructor |
|
| Method Summary | |
|---|---|
double[] |
filter(double[] currentSample,
double[] a,
long dt)
The filter method. |
double[] |
init(double[] currentSample,
double[] a)
Initialization with the previous x value. |
double[] |
init(double[] currentSample,
double[] a,
long dt)
Initialization with the previous x value. |
static boolean |
validateCutOffFreq(double fc,
long samplerate)
Cut-Off frequency validation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_CORNER_FREQUENCY
private final ButterworthLowPassFilter.CascadedBiquadIIRBWFilter[] cbqFilter
private final ButterworthLowPassFilter.BWFilter bwFilter
long lastDt
| Constructor Detail |
|---|
public GravitationFilter(double fc)
fc - the corner frequency
public GravitationFilter(double fc,
int order)
fc - the corner frequencyorder - the filter order| Method Detail |
|---|
public final double[] init(double[] currentSample,
double[] a)
currentSample - the current sample to store values ina - the current raw acceleration values
public final double[] init(double[] currentSample,
double[] a,
long dt)
currentSample - the current sample to store values ina - the current raw acceleration valuesdt - the current time delta between samples in milliseconds
public double[] filter(double[] currentSample,
double[] a,
long dt)
currentSample - the current sample to store values ina - the current raw acceleration valuesdt - the current time delta between samples in milliseconds
public static boolean validateCutOffFreq(double fc,
long samplerate)
fc - the cut-off frequencysamplerate - the current maximum sample rate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||