quick start:This class is never used directly. It is inherited by all Algorithms classes. Users will mainly interact with it indirectly by using some of the enumerations included in the class definition, and its protected data, which plays an important part in the control structure for all Algorithm classes. AlgorithmBase, like many of the classes named Algorithm, play an important role in the signal processing tools found in the Signal Processing library.
description:Filter filt; filt.setSampleFrequency(16000.0); filt.setFrameDuration(0.020);
static const String CLASS_NAME = L"AlgorithmBase";
enum CMODE { FRAME_BASED = 0, SAMPLE_BASED, DEF_CMODE = FRAME_BASED };
enum DMODE { FRAME_INTERNAL = 0, CROSS_FRAME, ACCUMULATE, DEF_DMODE = FRAME_INTERNAL };
static const NameMap CMODE_MAP = L"FRAME_INTERNAL, CROSS_FRAME, ACCUMULATE";
static const NameMap DMODE_MAP = L"FRAME_BASED, SAMPLE_BASED";
const String AlgorithmBase::PARAM_DBGL(L"debug_level");
static const float DEF_SAMPLE_FREQUENCY = 8000;
static const float DEF_FRAME_DURATION = 0.01;
static const float DEF_SIGNAL_DURATION = 1.0;
static const float DEF_FRAME_INDEX = -1;
static const long DEF_NUM_CHANNELS = 1;
static const long DEF_CHANNEL_INDEX = 0;
static const long DEF_LEADING_PAD = 0;
static const long DEF_TRAILING_PAD = 0;
static const long ERR = 70000;
static const long ERR_UNKALG = 70001;
static const long ERR_UNKIMP = 70002;
static const long ERR_UNKTYP = 70003;
static const long ERR_UNSUPA = 70004;
static const long ERR_UNSUPI = 70005;
static const long ERR_UNSUPM = 70006;
static const long ERR_INSUFD = 70007;
static const long ERR_ORDER = 70008;
static const long ERR_UNCTYP = 70009;
static const long ERR_COMPF = 70010;
DebugLevel debug_level_d;
boolean is_valid_d;
CMODE cmode_d;
DMODE dmode_d;
float sample_freq_d;
float frame_dur_d;
float signal_duration_d;
long leftover_samps_d;
long frame_index_d;
long num_channels_d;
long num_elements_d;
long offset_d;
static const SysString& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean setDebug(Integral::DEBUG level);
boolean debug(const unichar* message) const;
~AlgorithmBase();
AlgorithmBase();
AlgorithmBase(const AlgorithmBase& arg);
virtual boolean assign(const AlgorithmBase& arg);
virtual long sofSize() const = 0;
virtual boolean read(Sof& sof, long tag, const String& name) = 0;
virtual boolean write(Sof& sof, long tag, const String& name) const = 0;
virtual boolean readData(Sof& sof, const String& pname, long size, boolean param, boolean nested) = 0;
virtual boolean writeData(Sof& sof, const String& pname) const = 0;
virtual boolean eq(const AlgorithmBase& arg) const;
virtual boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);
virtual boolean setComputeMode(CMODE format);
virtual boolean setDataMode(DMODE mode);
virtual boolean setSampleFrequency(float sf);
virtual boolean setFrameDuration(float fdur);
virtual boolean setSignalDuration(float fdur);
virtual boolean setLeftoverSamps(long samps);
virtual boolean setFrameIndex(long index);
virtual boolean setNumChannels(long num_channels);
CMODE getComputeMode() const;
DMODE getDataMode() const;
float getSampleFrequency() const;
float getFrameDuration() const;
float getSignalDuration() const;
virtual long getLeftoverSamps();
long getFrameIndex() const;
long getNumChannels() const;
boolean isValid() const;
virtual const String& className() const;
virtual boolean init();
virtual boolean apply(Vector& output, const Vector< CircularBuffer >& input);
virtual long getLeadingPad() const;
virtual long getTrailingPad() const;
virtual CMODE getOutputMode() const;
virtual boolean setParser(SofParser* parser);
boolean displayStart(const AlgorithmBase* algo);
boolean displayFinish(const AlgorithmBase* algo);
boolean displayChannel(long channel);
boolean display(const TData0& output_a, const TData1& input_a, const String& algo_name);