|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.seas.iis.util.dsp.LowPassFilter
public class LowPassFilter
Implementation of NER and NERD filters from Kaiser, J. F. and Reed, W. A. (1977). Data smoothing using low-pass digital filters. Review of Scientific Instruments, 48(11):1447-1457.
Constructor Summary | |
---|---|
LowPassFilter(double[] coefficients)
|
Method Summary | |
---|---|
static double[] |
differentiatingFilter(double[] data,
double[] coefficients,
double timeUnitsPerSample)
runs a differentiating filter (that also does some smoothing -- otherwise differentiating noisy data amplifies noise) |
static double[] |
filter(double[] data,
double[] coefficients)
runs a filter with given coefficients (no time shifting) |
static double |
filterSingle(double[] data,
double[] coefficients,
int offset)
assumes that the length of data and the coefficients array is the same and computes the filtered value for the middle element in the array |
static void |
main(String[] args)
|
static double[] |
ner(double al,
double be,
double de,
int maxNumCoefs)
generate coefficients for a smoothing filter (nearly-equal ripple (NER) filter) |
static double[] |
nerd(double al,
double be,
double de,
int maxNumCoefs)
Generate coefficients for a differentiating filter |
Double |
onlineFilter(double datum)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LowPassFilter(double[] coefficients)
Method Detail |
---|
public Double onlineFilter(double datum)
public static double[] filter(double[] data, double[] coefficients)
data
- data to be filteredcoefficients
- filter coefficients (from the ner filter)
public static double filterSingle(double[] data, double[] coefficients, int offset)
data
- coefficients
-
public static double[] differentiatingFilter(double[] data, double[] coefficients, double timeUnitsPerSample)
data
- input time seriescoefficients
- filter coefficients (from the nerd filter)timeUnitsPerSample
- sampling interval -- important to make sure that the output of
the filter is in correct units (e.g., if input is speed with
100 samples per second and the output is to be in m/s^2, then
this param should be 0.01)
public static double[] ner(double al, double be, double de, int maxNumCoefs)
al
- stopband loss in dbbe
- relative location of stopband; 0 < be < 1 and be =
2*stopband_frequency / sampling_frequencyde
- relative width of transition band; 0 < de < 1maxNumCoefs
- maximum number of coefficients to generate (the paper suggests
150)
public static double[] nerd(double al, double be, double de, int maxNumCoefs)
al
- stopband loss in dbbe
- relative location of stopband; 0 < be < 1 and be =
2*stopband_frequency / sampling_frequencyde
- relative width of transition band; 0 < de < 1maxNumCoefs
- maximum number of coefficients to generate (the paper suggests
150)
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |