quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a #include <Cepstrum.h> Cepstrum(long order = DEF_ORDER, ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION); boolean setOrder(long num); boolean apply(VectorFloat& cepstrum, VectorFloat spec_mags) const;
description:// declare cepstrum object // Cepstrum ceps; // set the algorithm and the implementation // ceps.setAlgorithm(Cepstrum::IDCT); ceps.setImplementation(Cepstrum::TYPE_III); // set number of cepstral coefficients // ceps.setOrder(12); // give your vector // VectorFloat input; input.assign(L"1.0, 2.0, 1.0, 2.0, 3.0"); VectorFloat cepstrum; // compute cepstral coefficients // ceps.compute(cepstrum, input);
static const String CLASS_NAME = L"Cepstrum";
enum ALGORITHM { IDCT = 0, IDFT, DEF_ALGORITHM = IDCT };
enum IMPLEMENTATION { TYPE_I, TYPE_II, TYPE_III, TYPE_IV, CONVENTIONAL, DEF_IMPLEMENTATION = TYPE_III };
static const NameMap ALGO_MAP = L"IDCT, IDFT";
static const NameMap IMPL_MAP = L"TYPE_I, TYPE_II, TYPE_III, TYPE_IV, CONVENTIONAL";
static const String DEF_PARAM = L"";
static const String PARAM_ORDER = L"order";
static const String PARAM_ALGORITHM = L"algorithm";
static const String PARAM_IMPLEMENTATION = L"implementation";
static const String PARAM_MIN_AMP = L"minimum_implementation";
static const String PARAM_FLAG_MIN_AMP = L"flag_minimum_implementation";
static const long DEF_ORDER = (long)12;
static const float DEF_MIN_AMP = 1;
static const boolean DEF_FLAG_MIN_AMP = true;
static const AlgorithmData::COEF_TYPE DEF_COEF_TYPE = AlgorithmData::SPECTRUM;
static const long ERR = (long)00070300;
ALGORITHM algorithm_d;
IMPLEMENTATION implementation_d;
FourierTransform ft_d;
Long order_d;
Float min_amp_d;
Boolean flag_min_amp_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
~Cepstrum();
Cepstrum(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, long order = DEF_ORDER);
Cepstrum(const Cepstrum& arg);
boolean assign(const Cepstrum& arg);
Cepstrum& operator= (const Cepstrum& 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 Cepstrum& 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 setAlgorithm(ALGORITHM algorithm);
boolean setImplementation(IMPLEMENTATION implementation);
boolean setOrder(long num);
boolean setMiminumAmplitude(float min_amp);
boolean setFlagMiminumAmplitude(boolean flag_min_amp);
boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, long order = DEF_ORDER, float min_amp = DEF_MIN_AMP, boolean flag_min_amp = DEF_MIN_AMP);
ALGORITHM getAlgorithm() const;
IMPLEMENTATION getImplementation() const;
long getOrder() const;
float getMinimumAmplitude() const;
boolean getFlagMinimumAmplitude() const;
boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation, long& order, float& min_amp, boolean& flag_min_amp);
boolean compute(VectorFloat& cepstrum, VectorFloat& spec_mags, AlgorithmData::COEF_TYPE input_coef_type = AlgorithmData::SPECTRUM, long index = DEF_CHANNEL_INDEX) const;
boolean compute(VectorFloat& cepstrum, VectorComplexFloat& spec_mags, AlgorithmData::COEF_TYPE input_coef_type = AlgorithmData::SPECTRUM, long index = DEF_CHANNEL_INDEX) const;
boolean compute(VectorComplexFloat& cepstrum, VectorFloat& spec_mags, AlgorithmData::COEF_TYPE input_coef_type = AlgorithmData::SPECTRUM, long index = DEF_CHANNEL_INDEX) const;
boolean compute(VectorComplexFloat& cepstrum, VectorComplexFloat& spec_mags, AlgorithmData::COEF_TYPE input_coef_type = AlgorithmData::SPECTRUM, long index = DEF_CHANNEL_INDEX) const;
boolean eq(const AlgorithmBase& arg) const;
boolean assign(const AlgorithmBase& arg);
const String& className() const;
boolean apply(Vector<AlgorithmData>& output, const Vector<AlgorithmData>& input) const;
boolean setParser(SofParser* parser);
boolean readDataCommon(Sof& sof, const String& pname, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeDataCommon(Sof& sof, const String& pname);
boolean computeIdctT1Float(VectorFloat& cepstrum, const VectorFloat& spectrum);
boolean computeIdctT2Float(VectorFloat& cepstrum, const VectorFloat& spectrum);
boolean computeIdctT3Float(VectorFloat& cepstrum, const VectorFloat& spectrum);
boolean computeIdctT4Float(VectorFloat& cepstrum, const VectorFloat& spectrum);
boolean computeIdftConvRealFloat(VectorComplexFloat& cepstrum, const VectorFloat& spectrum);
boolean computeIdftConvComplexFloat(VectorComplexFloat& cepstrum, const VectorComplexFloat& spectrum);
// declare an object // Cepstrum ceps; // set number of coefficients // ceps.setOrder(12); // set the algorithm and implementation // ceps.setAlgorithm(Cepstrum::IDCT); ceps.setImplementation(Cepstrum::TYPE_III); // declare an input vector for which we want to compute // cepstral coefficients // VectorFloat input; input.assign(L"141.536456, 566.012599, 753.959190, 350.514452, 260.600174, 450.313256, 415.428250, 516.143151, 593.257160, 510.498570, 987.093536"); // declare a vector to hold the cepstral coefficients // VectorFloat cepstral; // compute cepstral coefficients // ceps.compute(cepstral, input);
// declare an object // Cepstrum ceps; // set number of coefficients // ceps.setOrder(12); // set the algorithm and implementation // ceps.setAlgorithm(Cepstrum::IDFT); ceps.setImplementation(Cepstrum::CONVENTIONAL); // declare an input vector for which we want to compute // cepstral coefficients // VectorFloat input; input.assign(L"141.536456, 566.012599, 753.959190, 350.514452, 260.600174, 450.313256, 415.428250, 516.143151, 593.257160, 510.498570, 987.093536"); // declare a vector to hold the cepstral coefficients // VectorFloat cepstral; // compute cepstral coefficients // ceps.compute(cepstral, input);