Skip to content

Commit afb2b29

Browse files
authored
Merge pull request #19 from KalebKE/v1.2
V1.2
2 parents 116ca20 + 992ed64 commit afb2b29

18 files changed

+568
-480
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.kircherelectronics.fsensor;
2+
3+
/**
4+
* Created by kaleb on 4/1/18.
5+
*/
6+
7+
public abstract class BaseFilter {
8+
public abstract float[] getOutput();
9+
}

fsensor/src/main/java/com/kircherelectronics/fsensor/filter/BaseFilter.java

-12
This file was deleted.

fsensor/src/main/java/com/kircherelectronics/fsensor/filter/averaging/AveragingFilter.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.kircherelectronics.fsensor.filter.averaging;
22

3-
import com.kircherelectronics.fsensor.filter.BaseFilter;
4-
53
/*
64
* Copyright 2017, Kircher Electronics, LLC
75
*
@@ -18,13 +16,15 @@
1816
* limitations under the License.
1917
*/
2018

19+
import com.kircherelectronics.fsensor.BaseFilter;
20+
2121
/**
22-
* A base implementation of an averaging filter.
22+
* A base implementation of an averaging fusedOrientation.
2323
*
2424
* Created by kaleb on 7/6/17.
2525
*/
2626

27-
public abstract class AveragingFilter implements BaseFilter {
27+
public abstract class AveragingFilter extends BaseFilter {
2828
public static float DEFAULT_TIME_CONSTANT = 0.18f;
2929

3030
protected float timeConstant;

fsensor/src/main/java/com/kircherelectronics/fsensor/filter/averaging/LowPassFilter.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
*/
1818

1919
/**
20-
* An implementation of the Android Developer low-pass filter. The Android
20+
* An implementation of the Android Developer low-pass fusedOrientation. The Android
2121
* Developer LowPassFilter, is an IIR single-pole implementation. The coefficient, a
2222
* (alpha), can be adjusted based on the sample period of the sensor to produce
23-
* the desired time constant that the filter will act on. It takes a simple form of y[0] = alpha * y[0] + (1
23+
* the desired time constant that the fusedOrientation will act on. It takes a simple form of y[0] = alpha * y[0] + (1
2424
* - alpha) * x[0]. Alpha is defined as alpha = timeConstant / (timeConstant +
25-
* dt) where the time constant is the length of signals the filter should act on
25+
* dt) where the time constant is the length of signals the fusedOrientation should act on
2626
* and dt is the sample period (1/frequency) of the sensor.
2727
*
2828
* http://developer.android.com/reference/android/hardware/SensorEvent.html
@@ -33,7 +33,7 @@ public class LowPassFilter extends AveragingFilter
3333
private static final String tag = LowPassFilter.class.getSimpleName();
3434

3535
// Gravity and linear accelerations components for the
36-
// Wikipedia low-pass filter
36+
// Wikipedia low-pass fusedOrientation
3737
private float[] output;
3838

3939
public LowPassFilter() {
@@ -51,7 +51,7 @@ public LowPassFilter(float timeConstant) {
5151
* @param values
5252
* The acceleration data. A 1x3 matrix containing the data from the X, Y and Z axis of the sensor
5353
* noting that order is arbitrary.
54-
* @return Returns the output of the filter.
54+
* @return Returns the output of the fusedOrientation.
5555
*/
5656
public float[] filter(float[] values)
5757
{

fsensor/src/main/java/com/kircherelectronics/fsensor/filter/averaging/MeanFilter.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
*/
2121

2222
/**
23-
* Implements a mean filter designed to smooth the data points based on a mean. The mean filter will take the mean
23+
* Implements a mean fusedOrientation designed to smooth the data points based on a mean. The mean fusedOrientation will take the mean
2424
* of the samples that occur over a period defined by the time constant... the number
25-
* of samples that are considered is known as the filter window. The approach
26-
* allows the filter window to be defined over a period of time, instead of a
25+
* of samples that are considered is known as the fusedOrientation window. The approach
26+
* allows the fusedOrientation window to be defined over a period of time, instead of a
2727
* fixed number of samples. This is important on devices that are
2828
* equipped with different hardware sensors that output samples at different
2929
* frequencies and also allow the developer to generally specify the output
30-
* frequency. Defining the filter window in terms of the time constant allows
31-
* the mean filter to applied to all sensor outputs with the same relative
32-
* filter window, regardless of sensor frequency.
30+
* frequency. Defining the fusedOrientation window in terms of the time constant allows
31+
* the mean fusedOrientation to applied to all sensor outputs with the same relative
32+
* fusedOrientation window, regardless of sensor frequency.
3333
*
3434
* @author Kaleb
3535
*/

fsensor/src/main/java/com/kircherelectronics/fsensor/filter/averaging/MedianFilter.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
*/
2323

2424
/**
25-
* Implements a median filter designed to smooth the data points based on a time
26-
* constant in units of seconds. The median filter will take the median of the
25+
* Implements a median fusedOrientation designed to smooth the data points based on a time
26+
* constant in units of seconds. The median fusedOrientation will take the median of the
2727
* samples that occur over a period defined by the time constant... the number
28-
* of samples that are considered is known as the filter window. The approach
29-
* allows the filter window to be defined over a period of time, instead of a
28+
* of samples that are considered is known as the fusedOrientation window. The approach
29+
* allows the fusedOrientation window to be defined over a period of time, instead of a
3030
* fixed number of samples. This is important on devices that are
3131
* equipped with different hardware sensors that output samples at different
3232
* frequencies and also allow the developer to generally specify the output
33-
* frequency. Defining the filter window in terms of the time constant allows
34-
* the mean filter to applied to all sensor outputs with the same relative
35-
* filter window, regardless of sensor frequency.
33+
* frequency. Defining the fusedOrientation window in terms of the time constant allows
34+
* the mean fusedOrientation to applied to all sensor outputs with the same relative
35+
* fusedOrientation window, regardless of sensor frequency.
3636
*
3737
* @author Kaleb
3838
* @version %I%, %G%

0 commit comments

Comments
 (0)