|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.android.activityminer.logic.features.calculators.AbstractCalculator<T,U>
org.android.activityminer.logic.features.calculators.AbstractCompositeCalculator<T,U>
org.android.activityminer.logic.features.calculators.AbstractFFTObservationBasedCalculator<T,Integer>
org.android.activityminer.logic.features.calculators.FFTPeakCalculator<T>
T
- the enumeration type for the dimensionspublic final class FFTPeakCalculator<T extends Enum<T> & Dimensions>
Implementation of a calculator to determine the peak index with the largest magnitude. The peak frequency for peak index i is freq(i)= i /(n * rate (s)). The amplitude of the peak frequency is calculated as normalized magnitude (normalized by observation count n): amp(i)= mag(i)/n.
Field Summary | |
---|---|
private Double |
peakAmplitude
The peak amplitude |
private Double |
peakFrequency
The peak frequency |
private int |
peakIndex
The peak index. |
private double |
peakMagnitude
The peak magnitude |
private double |
sampleRate
The sample rate in seconds |
Fields inherited from class org.android.activityminer.logic.features.calculators.AbstractCalculator |
---|
dimension, value |
Constructor Summary | |
---|---|
FFTPeakCalculator(FFTCalculator<T> fftCalculator,
long sampleRate)
Constructor |
Method Summary | |
---|---|
Integer |
getCompositeValue()
Does calculate the composite value. |
Integer |
getInitialValue()
Method for value initialization. |
Double |
getPeakAmplitude()
Getter for the peak frequency |
Double |
getPeakFrequency()
Getter for the peak frequency |
void |
onEvent(ObservableEventSource<? extends FFTCalculatorEvent> eventSource,
FFTCalculatorEvent fftComponent)
|
Methods inherited from class org.android.activityminer.logic.features.calculators.AbstractFFTObservationBasedCalculator |
---|
getFFTCalculator, getFFTComponentCount |
Methods inherited from class org.android.activityminer.logic.features.calculators.AbstractCompositeCalculator |
---|
getValue, reset |
Methods inherited from class org.android.activityminer.logic.features.calculators.AbstractCalculator |
---|
getDimension |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Double peakFrequency
private Double peakAmplitude
private double peakMagnitude
private int peakIndex
private double sampleRate
Constructor Detail |
---|
public FFTPeakCalculator(FFTCalculator<T> fftCalculator, long sampleRate)
fftCalculator
- the FFT Calculator to observesampleRate
- the sample rate as time-stamp delta in milliseconds between two
observationsMethod Detail |
---|
public Double getPeakAmplitude()
public Double getPeakFrequency()
public final Integer getInitialValue()
Calculator
public final Integer getCompositeValue()
CompositeCalculator
getCompositeValue
in interface CompositeCalculator<Integer>
getCompositeValue
in class AbstractFFTObservationBasedCalculator<T extends Enum<T> & Dimensions,Integer>
public void onEvent(ObservableEventSource<? extends FFTCalculatorEvent> eventSource, FFTCalculatorEvent fftComponent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |