name: Reflection : public AlgorithmBase

synopsis:

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

#include <Reflection.h>

Reflection(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, long order = DEF_ORDER, float dyn_range = DEF_DYN_RANGE);
boolean eq(const Reflection& arg);
boolean setAlgorithm(ALGORITHM algorithm);
boolean set(ALGORITHM algo = DEF_ALGORITHM, IMPLEMENTATION impl = DEF_IMPLEMENTATION, long order = DEF_ORDER, float dyn_range = DEF_DYN_RANGE);
quick start:

Reflection refl;
VectorFloat in_vec(L"1.0, 2,0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0");
VectorFloat refl_coef;
refl.set(Reflection::AUTOCORRELATION, Reflection::DURBIN, 4, -40);
refl.compute(refl_coef, in_vec);
description:

The Reflection class is used to calculate or convert linear prediction coefficients. It is one of several classes that provide a complete inventory of linear prediction manipulations. See the prediction coefficient class
Prediction.h for a more detailed explanation of linear prediction. The algorithm and implementation choices are shown below:

The step-up algorithm is defined in:
J.D. Markel and A.H. Gray, Linear Prediction of Speech, Springer-Verlag, New York, New York, USA, pp. 95, 1980.
Some of the algorithms used in reflection coefficient class compute coefficients directly (LATTICE) while others compute both reflection and prediction coefficients simultaneously (AUTOCORRELATION).

dependencies:

public constants:

error codes:

protected data:

required public methods:

class-specific public methods:

private methods:

examples:

• This example shows how to compute the reflection coefficients using the Burg analysis:
Reflection refl;
VectorFloat input;
VectorFloat refl_coef;
Float err_energy;

// use the following data as input:
//
//  x(n) = 0 when n = 0, 1, 2, 3;
//  x(n) = 1*pow(0.99, n-4) - pow(0.99, 2(n-4)),  when 4 <= n < 20;
//  x(n) = 0 when n = 20, 21, 22, 23
//
input.setLength(24);

float z = 1;
for (long i = 4; i < 20; i++) {
input(i) = 2 * z - z * z;
z = 0.99 * z;
}

// set the order, algorithm, implementation and dynamic threshold
//
long order = 4;
float dyn_range = -60;

refl.set(Reflection::LATTICE, Reflection::BURG, order, dyn_range);

// compute the reflection coefficents
//
refl.compute(refl_coef, err_energy, input, AlgorithmData::SIGNAL);
notes:

• none.