public abstract class EspSignalUtilities
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
EspSignalUtilities(ddf.minim.analysis.WindowFunction window)
Instantiates a new esp signal utilities.
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
absolute(double[] array)
Returns the absolute (positive) values of the given array.
|
de.dfki.lt.signalproc.filter.BandPassFilter |
createBandPassFilter(double lowerCutoffHz,
double upperCutoffHz)
Creates the band pass filter.
|
de.dfki.lt.signalproc.filter.HighPassFilter |
createHighPassFilter(double cutoffHz)
Creates the high pass filter.
|
de.dfki.lt.signalproc.filter.LowPassFilter |
createLowPassFilter(double cutoffHz)
Creates the low pass filter.
|
double[] |
fftLogPowerSpectrum(double[] sample)
Returns the log of the power spectrum of the given time domain sample.
|
double[] |
fftRealSpectrum(double[] sample)
Returns the real half of the fft transform of the given time domain sample.
|
abstract AbstractDSPValues |
getDSPValues()
Gets the DSP values.
|
de.dfki.lt.signalproc.filter.LowPassFilter |
getEspLowPassFilter()
Convenience method to create an esp - specific low pass filter, filtering
out signals above
getUpperMeasurableFrequency() - 0.1. |
protected abstract int |
getFFTSize()
Return the size of the sample arrays.
|
double |
getLogPower(double[] logFftd,
double frequency)
Linearly estimates the signal power at the specified frequency, between the
surrounding two fft data points (non-integer value between 1 Hz and (
getUpperMeasurableFrequency() - 1) Hz exclusive). |
double |
getLogPower(double[] logFftd,
int lowerFreqHz,
int upperFreqHz)
Attempts average the power over the specified range by providing more
weight to values in between lower & upper frequencies ie:
For range i to i + 2, weights 1, 2, 1 For range i to i + 3, weights 1, 2, 2, 1 For range i to i + 4, weights 1, 2, 3, 2, 1 . |
java.util.Map<java.lang.Double,java.lang.Double> |
getLogPowersFor(double[] sample,
double... frequencies)
Returns a map of frequency / log power pairs from the given sample.
|
protected abstract java.math.BigDecimal |
getRawSignalBreadth()
Return the range of the raw signal values (max - min).
|
protected abstract double |
getSampleRate()
Return the sample rate.
|
protected double |
getUpperMeasurableFrequency()
Gets the upper measurable frequency.
|
double[] |
normalize(double[] sample)
Normalizes the raw signal to values between 0 and 1;.
|
double[] |
normalize(double[] sample,
double scale)
Normalizes the raw signal to values between 0 and scale;.
|
double[] |
normalize(double[] fftd,
int lowerCutoffHz,
int upperCutoffHz)
Returns an array of size upperCutoffHz + 1, containing the normalized
values in the specified array from index lower thru upperCutoffHz
inclusive.
|
double |
rms(int lowerFreqHz,
int upperFreqHz,
double... fftd)
Returns the root mean square value of the given inputs over the given
range.
|
void |
setWindow(ddf.minim.analysis.WindowFunction window)
Sets the windowing function within the FFT instance.
|
double |
wma(double... powers)
Returns the weighted moving average of the given inputs.
|
protected EspSignalUtilities(ddf.minim.analysis.WindowFunction window)
window - the windowpublic void setWindow(ddf.minim.analysis.WindowFunction window)
window - the new windowpublic java.util.Map<java.lang.Double,java.lang.Double> getLogPowersFor(double[] sample,
double... frequencies)
sample - the samplefrequencies - the frequenciespublic double[] fftRealSpectrum(double[] sample)
sample - the samplepublic double[] fftLogPowerSpectrum(double[] sample)
sample - the samplegetLogPower(double[], double),
getLogPower(double[], int, int)public double getLogPower(double[] logFftd,
int lowerFreqHz,
int upperFreqHz)
logFftd - the frequency-domain shifted samplelowerFreqHz - > 0 HzupperFreqHz - < getUpperMeasurableFrequency() HzfftLogPowerSpectrum(double[]),
createBandPassFilter(double, double)public double getLogPower(double[] logFftd,
double frequency)
getUpperMeasurableFrequency() - 1) Hz exclusive).logFftd - the frequency-domain shifted samplefrequency - non-integer, > 1 && < (getUpperMeasurableFrequency() - 1)fftLogPowerSpectrum(double[])public double[] normalize(double[] fftd,
int lowerCutoffHz,
int upperCutoffHz)
fftd - the specified array of frequency domain valueslowerCutoffHz - the minimum index to use for normalization, >= 1upperCutoffHz - the maximum index to use for normalization, <
getUpperMeasurableFrequency()public double[] normalize(double[] sample)
sample - the samplepublic double[] normalize(double[] sample,
double scale)
sample - the samplescale - the scale amountpublic double rms(int lowerFreqHz,
int upperFreqHz,
double... fftd)
lowerFreqHz - >= 1upperFreqHz - < getUpperMeasurableFrequency()fftd - powerspublic double wma(double... powers)
powers - the powerspublic de.dfki.lt.signalproc.filter.BandPassFilter createBandPassFilter(double lowerCutoffHz,
double upperCutoffHz)
lowerCutoffHz - the lower cutoff hzupperCutoffHz - the upper cutoff hzpublic de.dfki.lt.signalproc.filter.HighPassFilter createHighPassFilter(double cutoffHz)
cutoffHz - the cutoff hzpublic de.dfki.lt.signalproc.filter.LowPassFilter createLowPassFilter(double cutoffHz)
cutoffHz - the cutoff hzpublic de.dfki.lt.signalproc.filter.LowPassFilter getEspLowPassFilter()
getUpperMeasurableFrequency() - 0.1.public double[] absolute(double[] array)
array - the arraypublic abstract AbstractDSPValues getDSPValues()
protected double getUpperMeasurableFrequency()
protected abstract int getFFTSize()
protected abstract double getSampleRate()
protected abstract java.math.BigDecimal getRawSignalBreadth()