name: Calculus : public AlgorithmBase

synopsis:

g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a

#include <Calculus.h>

Calculus(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, long order = DEF_ORDER, long delta_win = DEF_DELTAWIN);
boolean setAlgorithm(ALGORITHM algorithm);
boolean setImplementation(IMPLEMENTATION implementation);
boolean compute(VectorFloat& output, const VectorFloat& input,
                AlgorithmData::COEF_TYPE input_coef_type);
quick start:

VectorFloat input(L"1.0, 2.0, 0.0, -1.0, -2.0");
VectorFloat output;
Calculus calc;
calc.setAlgorithm(Calculus::DIFFERENTIATION);
calc.setImplementation(Calculus::REGRESSION);
calc.setOrder(1);
calc.setDeltaWindow(2);
calc.compute(output, input);
description:

The Calculus class computes derivatives, integrals, etc., on vector data. Its most common use is to differentiate features as part of a typical speech recognition front end. As with most classes in the algorithm library, a choice of algorithms and implementations are provided. A good tutorial on the use of this class to approximate derivatives can be found at:
Currently, three forms of derivative computations are supported: regression, central differences, and backward differences. A summary of these algorithms is shown below:


Though the algorithm definitions are the same for FRAME_INTERNAL and CROSS_FRAME, the data on which the algorithm operates is different. In FRAME_INTERNAL mode, the computation is performed directly on the data within the current frame. Note that in this mode the input vector must have the exact dimension required for the calculation. (For example, if a backward difference is used with a delta window of 1, the length of the input vector must be 2, so that there is sufficient data in the vector to perform the computation.)

In CROSS_FRAME mode, the data is treated as a sequence of vectors, as shown below:


The derivative is computed across the sequence consisting of the jth element of each vector. The number of previous and future frames of data used in this computation depends on the algorithm and implementation selection. For example, for a central difference, (2D+1) frames will be required. This form of the derivative computation is what is used in a typical speech recognition front end.

Note that the approximations for integration have not been implemented yet.

dependencies:

public constants:

error codes:

protected data:

required public methods:

class-specific public methods:

private methods:

examples:

notes: