org.android.activityminer.logic.features.calculators
Class FFTEnergyCalculator<T extends Enum<T> & Dimensions>
java.lang.Object
org.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,Double>
org.android.activityminer.logic.features.calculators.FFTEnergyCalculator<T>
- Type Parameters:
T
- the enumeration type for the dimensions
- All Implemented Interfaces:
- EventObserver<FFTCalculatorEvent>, Calculator<Double>, CompositeCalculator<Double>, FFTObservationBasedCalulator<T>
public final class FFTEnergyCalculator<T extends Enum<T> & Dimensions>
- extends AbstractFFTObservationBasedCalculator<T,Double>
Implementation of a signal energy from FFT component calculator.
The signal energy is calculated as the sum of spectral energies
normalized by the observation count.
Field Summary |
private double |
energySum
The signal energySum |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
energySum
private double energySum
- The signal energySum
FFTEnergyCalculator
public FFTEnergyCalculator(FFTCalculator<T> fftCalculator)
- Constructor
- Parameters:
fftCalculator
- the FFT Calculator to observe for spectral energy values
getInitialValue
public final Double getInitialValue()
- Description copied from interface:
Calculator
- Method for value initialization.
- Returns:
- the initialized value
getCompositeValue
public final Double getCompositeValue()
- Description copied from interface:
CompositeCalculator
- Does calculate the composite value.
- Specified by:
getCompositeValue
in interface CompositeCalculator<Double>
- Overrides:
getCompositeValue
in class AbstractFFTObservationBasedCalculator<T extends Enum<T> & Dimensions,Double>
- Returns:
- the composite value
onEvent
public void onEvent(ObservableEventSource<? extends FFTCalculatorEvent> eventSource,
FFTCalculatorEvent fftComponent)