quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a #include <Algorithm.h> Algorithm alg; boolean assign(const AlgorithmBase* arg); boolean setType(TYPES type); boolean apply(AlgorithmData& output, const CircularBuffer& input, BUF_MODE mode = DEF_BUF_MODE); boolean setSampleFrequency(float sf); boolean setFrameDuration(float dur); long getLeadingPad() const; long getTrailingPad() const; boolean init();
description:Algorithm alg; // test Window // alg.setType(Algorithm::WINDOW); Window win; win.setSize(5); win.setAlgorithm(Window::RECTANGULAR); alg.assign(win); AlgorithmData uw_sig; uw_sig.makeVectorFloat().assign(L"1, 2, 1, 3, 4, 2, 3, 1"); // need to produce a Vector<CircularBuffer<AlgorithmData>> // Vector<CircularBuffer<AlgorithmData>>tmp_buf(1); tmp_buf(0).append(uw_sig); alg.apply(output, tmp_buf);
static const String CLASS_NAME = L"Algorithm";
enum TYPES {ALGORITHM_CONTAINER = 0, CALCULUS, CEPSTRUM, COEFFICIENT_LABEL, CONNECTION, CONSTANT, CORRELATION, COVARIANCE, DISPLAY_DATA, ENERGY, FILTER, FILTER_BANK, FOURIER_TRANSFORM, GENERATOR, LOG_AREA_RATIO, MASK, MATH, OUTPUT, PREDICTION, REFLECTION, SPECTRUM, STATISTICS, WINDOW, CORRELATION_INTEGRAL, MUTUAL_INFORMATION, CORRELATION_DIMENSION, DEF_TYPES = CALCULUS};
static const NameMap TYPES_MAP = L"AlgorithmContainer, Calculus, Cepstrum, CoefficientLabel, Connection, Constant, Correlation, Covariance, DisplayData, Energy, Filter, FilterBank, FourierTransform, Generator, LogAreaRatio, Mask, Math, Output, Prediction, Reflection, Spectrum, Statistics, Window, CorrelationIntegral, MutualInformation, CorrelationDimension";
static const String DEF_PARAM = L"";
static const String PARAM_TYPE = L"name";
static const long ERR = 70050;
AlgorithmBase* virtual_algo_d;
static AlgorithmUndefined NO_ALGORITHM;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
~Algorithm();
Algorithm();
Algorithm(const Algorithm& arg);
boolean assign(const Algorithm& arg);
long sofSize() const;
boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean eq(const Algorithm& arg) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);
boolean setInputFilename(String& filename);
boolean setOutputDirectory(String& new_dir);
boolean setOutputBasenmae(String& new_basename);
boolean setOutputExtension(String& new_ext);
boolean setOutputPreserve(long new_preserve_level);
boolean setOutputSuffix(String& new_suffix);
boolean setOutputType(File::TYPE new_type);
boolean setSampleFrequency(float sf);
boolean setGenSampleFrequency(float sf);
boolean setFrameDuration(float dur);
boolean setSignalDuration(float dur);
boolean setLeftoverSamps(long samps);
boolean setFrameIndex(long index);
boolean setType(TYPES type);
boolean getInputFilename(Filename& filename) const;
boolean getInputFilename(String& filename) const;
boolean getOutputFilename(String& filename) const;
boolean getOutputDirectory(String& directory) const;
boolean getOutputBasename(String basename) const;
boolean getOutputExtension(String extension) const;
boolean getOutputPreserve() const;
boolean getOutputSuffix(String suffix) const;
boolean getGenSampleFrequency(Float& sf) const;
TYPES getType() const;
const String& getCLabelVariable() const;
CoefficientLabel::TYPE getCLabelType() const;
long getContainerGraphTag() const;
boolean assign(const AlgorithmBase& arg);
boolean eq(const AlgorithmBase& arg) const;
const String& className() const;
boolean init();
boolean apply(Vector<AlgorithmData>& output, const Vector< CircularBuffer<AlgorithmData> >& input);
long getLeadingPad() const;
long getTrailingPad() const;
// isip include files // #include <Energy.h> #include <Algorithm.h> // main program starts here // int main(int argc, const char** argv) { // declare an Energy object and an output vector // Energy egy; Vector<AlgorithmData> output(0); // declare a Algorithm object // Algorithm alg; // set the algo type to Energy and assign the object // alg.setType(Algorithm::ENERGY); alg.assign(egy); AlgorithmData uw_sig; uw_sig.makeVectorFloat().assign(L"1, 2, 1, 3, 4, 2, 3, 1"); // need to produce a Vector<CircularBuffer<AlgoData>> // Vector< CircularBuffer<AlgorithmData> > tmp_buf(1); tmp_buf(0).append(uw_sig); alg.apply(output, tmp_buf); uw_sig.debug(L"uw_sig"); output.debug(L"output"); // exit gracefully // Integral::exit(); }