quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a #include <Output.h> Output(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION); Output(const Output& arg); boolean assign(const Output& arg); boolean setAlgorithm(ALGORITHM type);
description:Output out; Vector<CircularBuffer<AlgorithmData>> in; Vector<AlgorithmData> out; out.apply(output, input);
static const String CLASS_NAME = L"Output";
enum ALGORITHM { DATA = 0, DEF_ALGORITHM = DATA };
enum IMPLEMENTATION { FEATURES = 0, SAMPLED_DATA DEF_IMPLEMENTATION = FEATURES };
static const NameMap ALGO_MAP(L"DATA");
static const NameMap IMPL_MAP(L"SAMPLED_DATA, FEATURES");
static const String DEF_PARAM = L"";
static const String PARAM_ALGORITHM = L"algorithm";
static const String PARAM_IMPLEMENTATION = L"implementation";
static const String PARAM_BASENAME = L"basename";
static const String PARAM_AUDIO_OUTPUT = L"audio_output";
static const String PARAM_FEATURE_OUTPUT = L"feature_output";
static const String PARAM_DMODE = L"data_mode";
static const String DEF_FILENAME = L"diagnose_file.sof";
static const String DEF_TMP_FILE = L"";
static const long ERR = 71400;
ALGORITHM algorithm_d;
IMPLEMENTATION implementation_d;
Filename input_filename_d;
Filename output_filename_d;
String output_basename_d;
String output_directory_d;
String output_extension_d;
Long output_preserve_d;
String output_suffix_d;
AudioFile audio_file_d;
FeatureFile feature_output_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
~Output();
Output(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);
Output(const Output& arg);
boolean assign(const Output& arg);
Output& operator= (const Output& 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 readData(Sof& sof, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean writeData(Sof& sof) const;
boolean eq(const Output& 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();
boolean setAlgorithm(ALGORITHM algorithm);
boolean setImplementation(IMPLEMENTATION implementation);
boolean setInputFilename(String& inputfilename);
boolean setOutputFilename(String& filename);
boolean setOutputBasename(String& basename);
boolean setOutputDirectory(String& directory);
boolean setOutputBasename(String& basename);
boolean setOutputExtension(String& extension);
boolean setOutputPreserve(long preserve);
boolean setOutputSuffix(String& suffix);
boolean setOutputType(File:TYPE type);
boolean setFileType(AudioFile::FILE_TYPE type);
boolean setFileType(FeatureFile::FILE_TYPE type);
boolean setFileFormat(FeatureFile::FILE_FORMAT format);
boolean setFileFormat(AudioFile::FILE_FORMAT format);
boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);
ALGORITHM getAlgorithm() const;
IMPLEMENTATION getImplementation() const;
boolean getInputFilename(String& filename) const;
boolean getOutputFilename(String& filename) const;
boolean getOutputDirectory(String& filename) const;
boolean getOutputBasename(String& basename) const;
boolean getOutputExtension(String& extension) const;
long getOutputPreserve() const;
boolean getOutputSuffix(String& suffix) const;
boolean get (ALGORITHM& algorithm, IMPLEMENTATION& implementationconst) const;
boolean assign(const AlgorithmBase& arg);
boolean eq(const AlgorithmBase& arg) const;
boolean apply(Vector<AlgorithmData>& output, const Vector<CircularBuffer<AlgorithmData> >& input);
const String& className() const;
boolean init();
boolean setParser(SofParser* parser);
boolean readDataData(Sof& sof, const String& pname, long size, boolean param, boolean nested);
boolean writeDataData(Sof& sof, const String& pname);
boolean computeFeatures(Vector<AlgorithmData>& output_a, const Vector< CircularBuffer<AlgorithmData> >& input_a);
boolean computeSampledData(Vector<AlgorithmData>& output_a, const Vector< CircularBuffer<AlgorithmData> >& input_a);
boolean transformName();
// isip include files // #include <Output.h> // main program starts here // int main() { // testing writing out a SOF TEXT FEATURES file.. // // declare local variable // Output c1; // set signal duration // c1.setSignalDuration(0.04); // set input file name // c1.setBasename(L"diagnose"); // set output file extension // c1.setExtension(L"_ftr_text.sof"); // set fie format // c1.setFileFormat(FeatureFile::SOF); // set implementation // c1.setImplementation(Output::FEATURES); // prepare some data // Vector < CircularBuffer < AlgorithmData> > in; Vector < AlgorithmData> out; Vector<VectorFloat> result; result.setLength(4); result(0).assign(L"1, 3, 5, 7, 9"); result(1).assign(L"10, 30, 50, 70, 90"); result(2).assign(L"100, 300, 500, 700, 900"); result(3).assign(L"1000, 3000, 5000, 7000, 9000"); long N = 1; in.setLength(1); // loop for all data // for (long j = 0; j < 4; j++) { in.clear(); in.setLength(N); in(0)(0).makeVectorFloat(); in(0)(0).getVectorFloat().assign(result(j)); in(0)(0).setCoefType(AlgorithmData::SIGNAL); // call the main apply method // c1.apply(out, in); } // exit gracefully // Integral::exit(); }