|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.features.Quantizer
public class Quantizer
This class implements a simple linear quantizer to transform double-valued signals into small-ranged integer-valued ones.
| Constructor Summary | |
|---|---|
Quantizer()
|
|
| Method Summary | |
|---|---|
static int[][] |
generateCandidates(double[] vector,
double lower,
double upper,
int numLevels,
boolean exponentialLevels,
int numCandidates,
boolean errorZone)
Generates multiple quantization candidates with different offset values. |
static double |
max(double[] vector)
Helper function to return the maximum value in a vector. |
static int[] |
quantize(double[] vector,
double lower,
double upper,
int numLevels,
boolean exponentialLevels,
double offset,
boolean errorZone)
Quantifies a signal according to the parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Quantizer()
| Method Detail |
|---|
public static int[] quantize(double[] vector,
double lower,
double upper,
int numLevels,
boolean exponentialLevels,
double offset,
boolean errorZone)
vector - The input signal to quantize.lower - The lower end of the range in which the input signal should be quantized.
All values in vector less than this lower end will simply be quantized to
the minimum quantization level, i.e. to 0.upper - The upper end of the range in which the input signal should be quantized.
All values in vector greater than this upper end will simply be quantized to
the maximum quantization level, i.e. to numLevels-1numLevels - The number of levels to distinguish. All output values will be in the
(integer) range [0;numLevels-1] with the exception of "error" values
when using error zones, which will be set to -1.exponentialLevels - If set to true, the quantization levels will be created with
exponentially growing ranges. If set to false, all quantization
levels will have an equal range, i.e. with equidistant points
to distinguish levels.offset - A value between -0.5 and +0.5 to specify an offset in the quantization.
It can be used to change the start of the quantization levels slightly
to account for small differences in the original data that would lead to
mismatch in the quantized data. This is necessary since small errors in the
sensor values can easily cause quantization erros.
Set to 0 if not needed.errorZone - If set to true, an error zone will be created around each quantum value
and values outside those error zones will be marked in the output by being
set to -1. The error zone are not adapted to exponential ranges
is exponentialLevels is set to true.
If set to false, no error zones will be used.
public static double max(double[] vector)
public static int[][] generateCandidates(double[] vector,
double lower,
double upper,
int numLevels,
boolean exponentialLevels,
int numCandidates,
boolean errorZone)
vector - @see #quantizelower - @see #quantizeupper - @see #quantizenumLevels - @see #quantizeexponentialLevels - @see #quantizenumCandidates - The number of candidates to create. That is,
numCandidates offset values will be used from 0 to 0.5. It
must be at least 2 to make sense.errorZone - @see #quantize
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||