Essentia
2.1-beta6-dev
|
Namespaces | |
scheduler | |
standard | |
streaming | |
util | |
Classes | |
class | AlgorithmInfo |
class | EssentiaFactory |
class | Configurable |
class | Logger |
class | TypeMap |
class | PairCompare |
class | Parameter |
class | ParameterMap |
class | Pool |
class | Range |
class | Everything |
class | Interval |
class | Set |
class | RogueVector |
class | Stringifier |
class | Mutex |
class | MutexLocker |
class | ForcedMutex |
class | ForcedMutexLocker |
class | EssentiaException |
struct | case_insensitive_str_cmp |
class | OrderedMap |
class | EssentiaMap |
class | TypeProxy |
class | Tuple2 |
class | Position |
class | AsciiCanvas |
class | AsciiBox |
class | AsciiDAGParser |
class | AudioContext |
class | JsonConvert |
class | JsonException |
class | YamlException |
class | YamlNode |
class | YamlScalarNode |
class | YamlSequenceNode |
class | YamlMappingNode |
Typedefs | |
typedef int | DebuggingSchedule[][3] |
typedef std::vector< std::pair< std::pair< int, int >, int > > | DebuggingScheduleVector |
typedef std::string | DescriptorName |
typedef float | Real |
typedef EssentiaMap< std::string, std::string, string_cmp > | DescriptionMap |
typedef int | ReaderID |
typedef Real | AudioSample |
typedef Tuple2< Real > | StereoSample |
template<typename T > | |
using | Tensor = Eigen::Tensor< T, 4, Eigen::RowMajor > |
template<typename T > | |
using | TensorMap = Eigen::TensorMap< Tensor< T >, 0 > |
using | TensorScalar = Eigen::Tensor< Real, 0, Eigen::RowMajor > |
using | Tensor1D = Eigen::Tensor< Real, 1, Eigen::RowMajor > |
using | Tensor2D = Eigen::Tensor< Real, 2, Eigen::RowMajor > |
using | Tensor3D = Eigen::Tensor< Real, 3, Eigen::RowMajor > |
typedef Position | Direction |
Enumerations | |
enum | DebuggingModule { EAlgorithm = 1 << 0 , EConnectors = 1 << 1 , EFactory = 1 << 2 , ENetwork = 1 << 3 , EGraph = 1 << 4 , EExecution = 1 << 5 , EMemory = 1 << 6 , EScheduler = 1 << 7 , EPython = 1 << 20 , EPyBindings = 1 << 21 , EUnittest = 1 << 22 , EUser1 = 1 << 25 , EUser2 = 1 << 26 , ENone = 0 , EAll = (1 << 30) - 1 } |
Functions | |
template<typename T > | |
bool | compareByName (const T *a, const T *b) |
const char * | debugModuleDescription (DebuggingModule module) |
void | setDebugLevel (int levels) |
void | unsetDebugLevel (int levels) |
void | saveDebugLevels () |
void | restoreDebugLevels () |
void | scheduleDebug (DebuggingSchedule schedule, int nentries) |
void | scheduleDebug (const DebuggingScheduleVector &schedule) |
void | setDebugLevelForTimeIndex (int index) |
void | init () |
bool | isInitialized () |
void | shutdown () |
template<typename T > | |
bool | isPowerTwo (T n) |
template<typename T > | |
T | log2 (T x) |
template<typename T > | |
int | ilog10 (T n) |
template<typename T > | |
T | nextPowerTwo (T n) |
template<> | |
long long int | nextPowerTwo (long long int n) |
template<typename T > | |
T | norm (const std::vector< T > &array) |
template<typename T > | |
T | sumSquare (const std::vector< T > array) |
template<typename T > | |
T | sum (const std::vector< T > &array, int start, int end) |
template<typename T > | |
T | mean (const std::vector< T > &array, int start, int end) |
template<typename T > | |
T | sum (const std::vector< T > &array) |
template<typename T > | |
T | mean (const std::vector< T > &array) |
template<typename T > | |
TNT::Array2D< T > | meanMatrix (const std::vector< TNT::Array2D< T > * > &array) |
template<typename T > | |
TNT::Array2D< T > | meanMatrix (const std::vector< TNT::Array2D< T > > &array) |
template<typename T > | |
std::vector< T > | meanFrames (const std::vector< std::vector< T > > &frames, int beginIdx=0, int endIdx=-1) |
template<typename T > | |
std::vector< T > | medianFrames (const std::vector< std::vector< T > > &frames, int beginIdx=0, int endIdx=-1) |
template<typename T > | |
std::vector< T > | varianceFrames (const std::vector< std::vector< T > > &frames) |
template<typename T > | |
std::vector< T > | sumFrames (const std::vector< std::vector< T > > &frames) |
template<typename T > | |
std::vector< T > | skewnessFrames (const std::vector< std::vector< T > > &frames) |
template<typename T > | |
std::vector< T > | kurtosisFrames (const std::vector< std::vector< T > > &frames) |
template<typename T > | |
T | median (const std::vector< T > &array) |
template<typename T > | |
void | rectify (std::vector< T > &array) |
template<typename T > | |
T | energy (const std::vector< T > &array) |
template<typename T > | |
T | instantPower (const std::vector< T > &array) |
template<typename T > | |
bool | isSilent (const std::vector< T > &array) |
template<typename T > | |
TNT::Array2D< T > | varianceMatrix (const std::vector< TNT::Array2D< T > > &array, const TNT::Array2D< T > &mean) |
template<typename T > | |
TNT::Array2D< T > | varianceMatrix (const std::vector< TNT::Array2D< T > * > &array, const TNT::Array2D< T > &mean) |
template<typename T > | |
T | variance (const std::vector< T > &array, const T mean) |
template<typename T > | |
T | skewness (const std::vector< T > &array, const T mean) |
template<typename T > | |
T | kurtosis (const std::vector< T > &array, const T mean) |
template<typename T > | |
T | stddev (const std::vector< T > &array, const T mean) |
template<typename T > | |
T | round (const T value) |
Real | lin2db (Real value) |
Real | lin2db (Real value, Real silenceCutoff, Real dbSilenceCutoff) |
Real | db2lin (Real value) |
Real | pow2db (Real power) |
Real | pow2db (Real power, Real silenceCutoff, Real dbSilenceCutoff) |
Real | db2pow (Real power) |
Real | amp2db (Real amplitude) |
Real | amp2db (Real amplitude, Real silenceCutoff, Real dbSilenceCutoff) |
Real | db2amp (Real amplitude) |
Real | linear (Real input) |
Real | lin2log (Real value) |
Real | lin2log (Real input, Real silenceCutoff, Real logSilenceCutoff) |
Real | hz2bark (Real f) |
Real | bark2hz (Real z) |
Real | barkCriticalBandwidth (Real z) |
Real | mel2hz (Real mel) |
Real | mel102hz (Real mel) |
Real | mel2hzSlaney (Real mel) |
Real | hz2mel (Real hz) |
Real | hz2mel10 (Real hz) |
Real | hz2melSlaney (Real hz) |
Real | hz2hz (Real hz) |
Real | cents2hz (Real cents, Real referenceFrequency) |
Real | hz2cents (Real hz, Real referenceFrequency) |
int | hz2midi (Real hz, Real tuningFrequency) |
Real | midi2hz (int midiNoteNumber, Real tuningFrequency) |
std::string | note2root (std::string note) |
int | note2octave (std::string note) |
std::string | midi2note (int midiNoteNumber) |
int | note2midi (std::string note) |
std::string | hz2note (Real hz, Real tuningFrequency) |
int | note2hz (std::string note, Real tuningFrequency) |
int | db2velocity (Real decibels, Real hearingThreshold) |
Real | velocity2db (int velocity, Real hearingThreshold) |
int | argmin (const std::vector< Real > &input) |
int | argmax (const std::vector< Real > &input) |
template<typename T > | |
void | normalize (std::vector< T > &array) |
template<typename T > | |
void | normalizeAbs (std::vector< T > &array) |
template<typename T > | |
void | normalizeAbs (std::vector< T > &array, T headroom) |
template<typename T > | |
void | normalizeSum (std::vector< T > &array) |
template<typename T > | |
std::vector< T > | derivative (const std::vector< T > &array) |
template<typename T , typename U , typename Comparator > | |
void | sortpair (std::vector< T > &v1, std::vector< U > &v2) |
bool | isDenormal (const float &x) |
template<typename T > | |
T | fmod (T a, T b) |
template<typename T > | |
T | princarg (T y) |
template<typename T > | |
void | hist (const T *array, uint n, int *n_array, T *x_array, uint n_bins) |
template<typename T > | |
void | bincount (const std::vector< T > &input, std::vector< T > &output) |
template<typename T > | |
std::vector< std::vector< T > > | transpose (const std::vector< std::vector< T > > &m) |
template<typename T > | |
TNT::Array2D< T > | transpose (const TNT::Array2D< T > &m) |
std::string | equivalentKey (const std::string key) |
template<typename T > | |
void | rotateChroma (std::vector< std::vector< T > > &inputMatrix, int oti) |
template<typename T > | |
T | dotProduct (const std::vector< T > &xArray, const std::vector< T > &yArray) |
template<typename T > | |
T | percentile (const std::vector< T > &array, Real qpercentile) |
template<typename T > | |
T | covariance (const std::vector< T > &x, const T xMean, const std::vector< T > &y, const T yMean) |
template<typename T > | |
T | pearsonCorrelationCoefficient (const std::vector< T > &x, const std::vector< T > &y) |
template<typename T > | |
void | heavisideStepFunction (std::vector< std::vector< T > > &inputArray) |
template<typename T > | |
std::vector< std::vector< T > > | pairwiseDistance (const std::vector< std::vector< T > > &m, const std::vector< std::vector< T > > &n) |
template<typename T > | |
void | tensorGeometricalInfo (const Tensor< T > &tensor, int &axis, std::array< Eigen::Index, 4 - 1 > &squeezeShape, std::array< Eigen::Index, 4 > &summarizerShape, std::array< Eigen::Index, 4 > &broadcastShape) |
template<typename T > | |
T | mean (const Tensor< T > &tensor) |
template<typename T > | |
Tensor< T > | mean (const Tensor< T > &tensor, int axis) |
template<typename T > | |
T | stddev (const Tensor< T > &tensor, const T mean) |
template<typename T > | |
Tensor< T > | stddev (const Tensor< T > &tensor, const Tensor< T > mean, int axis) |
template<typename T > | |
T | tensorMin (const Tensor< T > &tensor) |
template<typename T > | |
Tensor< T > | tensorMin (const Tensor< T > &tensor, int axis) |
template<typename T > | |
T | tensorMax (const Tensor< T > &tensor) |
template<typename T > | |
Tensor< T > | tensorMax (const Tensor< T > &tensor, int axis) |
template<typename T > | |
T | roundToDecimal (T x, int decimal) |
template<typename T , typename Array > | |
std::vector< T > | arrayToVector (const Array &array) |
template<typename T > | |
int | indexOf (const std::vector< T > &v, const T &elem) |
template<typename T > | |
bool | contains (const std::vector< T > &v, const T &elem) |
bool | contains (const std::vector< std::string > &v, const char *str) |
template<typename T , typename U > | |
bool | contains (const std::map< T, U > &m, const T &key) |
template<typename T > | |
bool | contains (const OrderedMap< T > &m, const std::string &key) |
template<typename T > | |
bool | contains (const OrderedMap< T > &m, const char *key) |
template<typename T > | |
bool | isValid (const T &value) |
template<typename T > | |
bool | isValid (const Tuple2< T > &value) |
bool | isValid (const std::string &s) |
template<typename T > | |
bool | isValid (const std::vector< T > &v) |
template<typename T > | |
bool | isValid (const std::vector< std::vector< T > > &mat) |
template<typename T > | |
bool | isValid (const TNT::Array2D< T > &mat) |
template<typename T > | |
bool | isValid (const Tensor< T > &tensor) |
template<typename T > | |
void | fastcopy (T *dest, const T *src, int n) |
template<> | |
void | fastcopy< Real > (Real *dest, const Real *src, int n) |
template<> | |
void | fastcopy< StereoSample > (StereoSample *dest, const StereoSample *src, int n) |
template<> | |
void | fastcopy< int > (int *dest, const int *src, int n) |
void | fastcopy (std::vector< Real >::iterator dest, std::vector< Real >::const_iterator src, int n) |
void | fastcopy (std::vector< StereoSample >::iterator dest, std::vector< StereoSample >::const_iterator src, int n) |
std::ostream & | operator<< (std::ostream &out, const Parameter &p) |
std::ostream & | operator<< (std::ostream &out, const ParameterMap &m) |
std::ostream & | operator<< (std::ostream &out, const Parameter::ParamType &t) |
template<typename T , typename U > | |
std::ostream & | operator<< (std::ostream &out, const std::pair< T, U > &p) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out, const std::vector< T > &v) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out, const std::set< T > &v) |
std::string | toLower (const std::string &str) |
std::string | toUpper (const std::string &str) |
std::vector< std::string > | tokenize (const std::string &str, const std::string &delimiters, bool trimEmpty=false) |
std::string | strip (const std::string &str) |
std::string | pad (int n, int size, char paddingChar=' ', bool leftPadded=false) |
std::string | pad (const std::string &str, int size, char paddingChar=' ', bool leftPadded=false) |
bool | case_insensitive_char_cmp (char a, char b) |
bool | sameType (const std::type_info &t1, const std::type_info &t2) |
std::string | nameOfType (const std::type_info &type) |
std::string | nameOfType (const TypeProxy &tproxy) |
bool | sameType (const TypeProxy &lhs, const TypeProxy &rhs) |
std::ostream & | operator<< (std::ostream &out, const Position &pos) |
std::vector< std::string > | makeRectangle (const std::string &network) |
std::vector< std::string > | makeRectangle (const char *const *network, int size) |
std::ostream & | operator<< (std::ostream &out, const AsciiCanvas &canvas) |
bool | isBigEndian () |
template<typename T > | |
void | removeEndianness (T &x) |
template<typename T > | |
void | bewrite (std::ofstream &out, const T &value) |
template<> | |
void | bewrite (std::ofstream &out, const std::string &str) |
template<> | |
void | bewrite (std::ofstream &out, const std::vector< std::string > &v) |
template<typename T > | |
void | beread (std::ifstream &in, T &value) |
template<> | |
void | beread (std::ifstream &in, std::string &str) |
template<> | |
void | beread (std::ifstream &in, std::vector< std::string > &v) |
Real | lagToBpm (Real lag, Real sampleRate, Real hopSize) |
Real | bpmToLag (Real bpm, Real sampleRate, Real hopSize) |
int | longestChain (const std::vector< Real > &dticks, int startpos, Real period, Real tolerance) |
void | bpmDistance (Real x, Real y, Real &error, Real &ratio) |
bool | areEqual (Real a, Real b, Real tolerance) |
bool | areHarmonics (Real x, Real y, Real epsilon, bool bPower2) |
Real | greatestCommonDivisor (Real x, Real y, Real epsilon) |
std::vector< Real > | roundBpms (const std::vector< Real > &bpms) |
std::vector< Real > | postProcessTicks (const std::vector< Real > &origticks) |
std::vector< Real > | postProcessTicks (const std::vector< Real > &origticks, const std::vector< Real > &ticksAmplitudes, const Real &preferredPeriod) |
void | pcmMetadata (const std::string &filename, int &sr, int &ch, int &bitrate) |
void | outputYAMLArray (std::ostream &out, const std::vector< Real > &v) |
void | outputYAMLMatrix (std::ostream &out, const std::vector< std::vector< Real > > &v) |
void | scaleAudioVector (std::vector< Real > &buffer, const Real scale) |
void | cleaningSineTracks (std::vector< std::vector< Real > > &freqsTotal, const int minFrames) |
void | genSpecSines (std::vector< Real > iploc, std::vector< Real > ipmag, std::vector< Real > ipphase, std::vector< std::complex< Real > > &outfft, const int fftSize) |
void | initializeFFT (std::vector< std::complex< Real > > &fft, int sizeFFT) |
template<typename T > | |
TNT::Array2D< T > & | operator/= (TNT::Array2D< T > &A, const T &k) |
template<typename T > | |
TNT::Array2D< T > | operator/ (const TNT::Array2D< T > &A, const T &k) |
template<typename T > | |
TNT::Array2D< T > & | matinit (TNT::Array2D< T > &A) |
TNT::Array2D< Real > | vecvecToArray2D (const std::vector< std::vector< Real > > &v) |
std::vector< std::vector< Real > > | array2DToVecvec (const TNT::Array2D< Real > &v2D) |
YamlNode * | parseYaml (FILE *, const std::string &fileString=std::string()) |
Variables | |
int | activatedDebugLevels |
bool | infoLevelActive |
bool | warningLevelActive |
bool | errorLevelActive |
int | debugIndentLevel |
Logger | loggerInstance |
const char * | version |
const char * | version_git_sha |
typedef Real AudioSample |
Type used to represent a mono audio sample.
typedef int DebuggingSchedule[][3] |
typedef std::vector<std::pair<std::pair<int, int>, int> > DebuggingScheduleVector |
typedef EssentiaMap<std::string, std::string, string_cmp> DescriptionMap |
Type of map used for storing the description of the various fields.
typedef std::string DescriptorName |
typedef int ReaderID |
typedef used for identifying sinks for a given source.
typedef float Real |
The main typedef for real numbers.
typedef Tuple2<Real> StereoSample |
Type used to represent a stereo sample.
using Tensor = Eigen::Tensor<T, 4 , Eigen::RowMajor> |
Alias for Eigen::Tensor. Store data in a rowMajor fashion to fit Tensorflow's behavior. https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor_types.h
using TensorScalar = Eigen::Tensor<Real, 0, Eigen::RowMajor> |
Alias for a 0-dimensional Eigen::Tensor.
enum DebuggingModule |
References lin2db().
References bpmDistance().
References bpmDistance(), and isPowerTwo().
|
inline |
Referenced by bincount(), and postProcessTicks().
|
inline |
|
inline |
References Array2D< T >::dim1(), and Array2D< T >::dim2().
std::vector<T> essentia::arrayToVector | ( | const Array & | array | ) |
Utility function that converts a C-style array into a C++ std::vector.
References ARRAY_SIZE.
Converts a Bark value into its corresponding frequency. This formula is deduced from: H. Traunmüller (1990) "Analytical expressions for the tonotopic sensory scale" J. Acoust. Soc. Am. 88: 97-100. and has been independently verified to be the one that best matches the band frequencies defined by Zwicker in 1961.
z | the critical band rate, in Bark |
void essentia::beread | ( | std::ifstream & | in, |
std::string & | str | ||
) |
References beread().
void essentia::beread | ( | std::ifstream & | in, |
std::vector< std::string > & | v | ||
) |
References beread().
void essentia::beread | ( | std::ifstream & | in, |
T & | value | ||
) |
References removeEndianness().
Referenced by beread().
void essentia::bewrite | ( | std::ofstream & | out, |
const std::string & | str | ||
) |
References bewrite().
void essentia::bewrite | ( | std::ofstream & | out, |
const std::vector< std::string > & | v | ||
) |
References bewrite().
void essentia::bewrite | ( | std::ofstream & | out, |
const T & | value | ||
) |
References removeEndianness().
Referenced by bewrite().
void essentia::bincount | ( | const std::vector< T > & | input, |
std::vector< T > & | output | ||
) |
returns in output the number of occurence of each value in the input vector
References argmax().
References round().
Referenced by areEqual(), areHarmonics(), and greatestCommonDivisor().
References lagToBpm().
|
inline |
Case-insensitive compare function for characters.
Referenced by case_insensitive_str_cmp::operator()().
void essentia::cleaningSineTracks | ( | std::vector< std::vector< Real > > & | freqsTotal, |
const int | minFrames | ||
) |
bool essentia::compareByName | ( | const T * | a, |
const T * | b | ||
) |
bool essentia::contains | ( | const OrderedMap< T > & | m, |
const char * | key | ||
) |
References contains().
bool essentia::contains | ( | const OrderedMap< T > & | m, |
const std::string & | key | ||
) |
References OrderedMap< T >::size().
bool essentia::contains | ( | const std::map< T, U > & | m, |
const T & | key | ||
) |
Utility function to test whether a key is in a map.
|
inline |
References contains().
bool essentia::contains | ( | const std::vector< T > & | v, |
const T & | elem | ||
) |
Returns whether a vector of a certain type contains an element or not. Comparison is done using the '==' operator, so you can even use it for your own types if you overload this operator.
References indexOf().
Referenced by NetworkNode::addChild(), and contains().
T essentia::covariance | ( | const std::vector< T > & | x, |
const T | xMean, | ||
const std::vector< T > & | y, | ||
const T | yMean | ||
) |
Sample covariance
Referenced by pearsonCorrelationCoefficient().
const char* essentia::debugModuleDescription | ( | DebuggingModule | module | ) |
std::vector<T> essentia::derivative | ( | const std::vector< T > & | array | ) |
T essentia::dotProduct | ( | const std::vector< T > & | xArray, |
const std::vector< T > & | yArray | ||
) |
returns the dot product of two 1D vectors. Throws an exception either one of the input arrays are empty.
Referenced by pairwiseDistance().
T essentia::energy | ( | const std::vector< T > & | array | ) |
Referenced by instantPower().
|
inline |
|
inline |
References fastcopy().
|
inline |
References fastcopy().
|
inline |
This function, which has the same interface as memcpy, performs either memcpy (fast) for basic types, or does a simple copy element by element (for strings, for instance).
Referenced by fastcopy(), Copy< TokenType >::process(), VectorInput< TokenType, acquireSize >::process(), VectorOutput< TokenType, StorageType >::process(), and PhantomBuffer< T >::releaseForWrite().
|
inline |
|
inline |
|
inline |
T essentia::fmod | ( | T | a, |
T | b | ||
) |
Referenced by princarg().
void essentia::genSpecSines | ( | std::vector< Real > | iploc, |
std::vector< Real > | ipmag, | ||
std::vector< Real > | ipphase, | ||
std::vector< std::complex< Real > > & | outfft, | ||
const int | fftSize | ||
) |
References bpmDistance().
Referenced by roundBpms().
void essentia::heavisideStepFunction | ( | std::vector< std::vector< T > > & | inputArray | ) |
Apply heaviside step function to an input m X n dimentional vector. f(x) = if x<0: x=0; if x>=0: x=1 Throws an exception if the input array is empty. returns a 2D binary vector of m X n shape
Given a set of values, computes the associated histogram. This method is designed to work the same way as in Matlab/Octave. It is based on the algorithms used in Octave rather than Matlab. The result structures (n_arr, x_arr) have to be allocated before calling this function.
array | the input array, containing the data values |
n | the number of elements of this array |
n_array | the array where the distribution will be written |
x_array | the array that will contain the centers of each bin |
n_bins | the number of desired bins for the distribution |
Referenced by postProcessTicks().
Converts a given frequency into its Bark value. This formula is taken from: H. Traunmüller (1990) "Analytical expressions for the tonotopic sensory scale" J. Acoust. Soc. Am. 88: 97-100. and has been independently verified to be the one that best matches the band frequencies defined by Zwicker in 1961.
f | the input frequency, in Hz |
References hz2midi(), and midi2note().
int essentia::ilog10 | ( | T | n | ) |
int essentia::indexOf | ( | const std::vector< T > & | v, |
const T & | elem | ||
) |
Return the index of the given element inside the vector. If elem
was not found in v
, return -1.
Referenced by contains().
void essentia::init | ( | ) |
This function registers the algorithms in the factory, so that they are ready for use. It also builds a list of available types and their "human-readable" representations. You need to call this function before doing anything with essentia.
void essentia::initializeFFT | ( | std::vector< std::complex< Real > > & | fft, |
int | sizeFFT | ||
) |
T essentia::instantPower | ( | const std::vector< T > & | array | ) |
References energy().
Referenced by isSilent().
|
inline |
Referenced by removeEndianness().
|
inline |
bool essentia::isInitialized | ( | ) |
bool essentia::isPowerTwo | ( | T | n | ) |
Referenced by areHarmonics().
bool essentia::isSilent | ( | const std::vector< T > & | array | ) |
References instantPower(), and SILENCE_CUTOFF.
|
inline |
|
inline |
References isValid().
|
inline |
References isValid().
|
inline |
Return whether a value is valid or not, ie: is not Inf nor NaN.
Referenced by isValid().
|
inline |
References Array2D< T >::dim1(), Array2D< T >::dim2(), and isValid().
|
inline |
References isValid(), Tuple2< T >::left(), and Tuple2< T >::right().
T essentia::kurtosis | ( | const std::vector< T > & | array, |
const T | mean | ||
) |
References mean().
std::vector<T> essentia::kurtosisFrames | ( | const std::vector< std::vector< T > > & | frames | ) |
References meanFrames().
Referenced by bpmToLag().
References DB_SILENCE_CUTOFF, and SILENCE_CUTOFF.
References LOG_SILENCE_CUTOFF, and SILENCE_CUTOFF.
T essentia::log2 | ( | T | x | ) |
Referenced by hz2cents(), and hz2midi().
|
inline |
Referenced by postProcessTicks().
std::vector<std::string> essentia::makeRectangle | ( | const char *const * | network, |
int | size | ||
) |
Take an array of C strings representing the network in ASCII art form and turn it into a rectangle, which is a vector of string rows where each row has the same length. This will allow us to navigate in it with rect[x][y], for instance.
std::vector<std::string> essentia::makeRectangle | ( | const std::string & | network | ) |
Take a string representing the network in ASCII art form and turn it into a rectangle, which is a vector of string rows where each row has the same length. This will allow us to navigate in it with rect[x][y], for instance.
Referenced by AsciiCanvas::AsciiCanvas().
TNT::Array2D<T>& essentia::matinit | ( | TNT::Array2D< T > & | A | ) |
References Array2D< T >::dim1(), and Array2D< T >::dim2().
Referenced by meanMatrix(), and varianceMatrix().
T essentia::mean | ( | const std::vector< T > & | array | ) |
returns the mean of an array.
References mean().
T essentia::mean | ( | const std::vector< T > & | array, |
int | start, | ||
int | end | ||
) |
returns the mean of an array, unrolled version.
References sum().
Referenced by kurtosis(), mean(), meanMatrix(), pearsonCorrelationCoefficient(), postProcessTicks(), MTRand::randNorm(), skewness(), stddev(), variance(), and varianceMatrix().
T essentia::mean | ( | const Tensor< T > & | tensor | ) |
Returns the mean of a tensor.
Returns the mean of a tensor along the given axis.
References tensorGeometricalInfo(), and TENSORRANK.
std::vector<T> essentia::meanFrames | ( | const std::vector< std::vector< T > > & | frames, |
int | beginIdx = 0 , |
||
int | endIdx = -1 |
||
) |
Referenced by kurtosisFrames(), skewnessFrames(), and varianceFrames().
TNT::Array2D<T> essentia::meanMatrix | ( | const std::vector< TNT::Array2D< T > * > & | array | ) |
returns the mean of an array of TNT::Array2D*
TNT::Array2D<T> essentia::meanMatrix | ( | const std::vector< TNT::Array2D< T > > & | array | ) |
returns the mean of an array of TNT::Array2D
T essentia::median | ( | const std::vector< T > & | array | ) |
std::vector<T> essentia::medianFrames | ( | const std::vector< std::vector< T > > & | frames, |
int | beginIdx = 0 , |
||
int | endIdx = -1 |
||
) |
|
inline |
std::string essentia::nameOfType | ( | const std::type_info & | type | ) |
|
inline |
Commodity function to return the name of the type used in a TypeProxy.
References nameOfType(), and TypeProxy::typeInfo().
|
inline |
T essentia::nextPowerTwo | ( | T | n | ) |
Return the next power of two after the given number n. If n is already a power of two, return n.
T essentia::norm | ( | const std::vector< T > & | array | ) |
void essentia::normalize | ( | std::vector< T > & | array | ) |
void essentia::normalizeAbs | ( | std::vector< T > & | array | ) |
References rectify().
void essentia::normalizeAbs | ( | std::vector< T > & | array, |
T | headroom | ||
) |
References rectify().
void essentia::normalizeSum | ( | std::vector< T > & | array | ) |
|
inline |
References midi2hz(), and note2midi().
|
inline |
References ALL_NOTES, note2octave(), and note2root().
Referenced by note2hz().
|
inline |
Referenced by note2midi().
|
inline |
Referenced by note2midi().
TNT::Array2D<T> essentia::operator/ | ( | const TNT::Array2D< T > & | A, |
const T & | k | ||
) |
References Array2D< T >::dim1(), and Array2D< T >::dim2().
TNT::Array2D<T>& essentia::operator/= | ( | TNT::Array2D< T > & | A, |
const T & | k | ||
) |
References Array2D< T >::dim1(), and Array2D< T >::dim2().
|
inline |
References AsciiCanvas::at(), and AsciiCanvas::height().
std::ostream& essentia::operator<< | ( | std::ostream & | out, |
const Parameter & | p | ||
) |
std::ostream& essentia::operator<< | ( | std::ostream & | out, |
const Parameter::ParamType & | t | ||
) |
std::ostream& essentia::operator<< | ( | std::ostream & | out, |
const ParameterMap & | m | ||
) |
|
inline |
References Position::x, and Position::y.
std::ostream& essentia::operator<< | ( | std::ostream & | out, |
const std::pair< T, U > & | p | ||
) |
Output a std::complex into an output stream. Output a std::pair into an output stream.
std::ostream& essentia::operator<< | ( | std::ostream & | out, |
const std::set< T > & | v | ||
) |
Output a std::set into an output stream.
std::ostream& essentia::operator<< | ( | std::ostream & | out, |
const std::vector< T > & | v | ||
) |
Output a std::vector into an output stream.
void essentia::outputYAMLArray | ( | std::ostream & | out, |
const std::vector< Real > & | v | ||
) |
void essentia::outputYAMLMatrix | ( | std::ostream & | out, |
const std::vector< std::vector< Real > > & | v | ||
) |
std::string essentia::pad | ( | const std::string & | str, |
int | size, | ||
char | paddingChar = ' ' , |
||
bool | leftPadded = false |
||
) |
std::string essentia::pad | ( | int | n, |
int | size, | ||
char | paddingChar = ' ' , |
||
bool | leftPadded = false |
||
) |
std::vector<std::vector<T> > essentia::pairwiseDistance | ( | const std::vector< std::vector< T > > & | m, |
const std::vector< std::vector< T > > & | n | ||
) |
Pairwise euclidean distances between two 2D vectors. Throws an exception if the input array is empty. Returns a (m.shape[0], n.shape[0]) dimentional vector where m and n are the two input arrays TODO: [add other distance metrics beside euclidean such as cosine, mahanalobis etc as a configurable parameter]
References dotProduct().
YamlNode* essentia::parseYaml | ( | FILE * | , |
const std::string & | fileString = std::string() |
||
) |
void essentia::pcmMetadata | ( | const std::string & | filename, |
int & | sr, | ||
int & | ch, | ||
int & | bitrate | ||
) |
References EssentiaFactory< BaseAlgorithm >::create().
T essentia::pearsonCorrelationCoefficient | ( | const std::vector< T > & | x, |
const std::vector< T > & | y | ||
) |
Returns the sample Pearson correlation coefficient of a pair of vectors as described in, https://en.wikipedia.org/wiki/Pearson_correlation_coefficient
References covariance(), mean(), and stddev().
T essentia::percentile | ( | const std::vector< T > & | array, |
Real | qpercentile | ||
) |
returns the q-th percentile of an 1D input array (same as numpy percentile implementation).
Throws an exception if the input array is empty.
References hist(), longestChain(), and mean().
|
inline |
References argmax(), hist(), longestChain(), and mean().
References lin2db().
void essentia::rectify | ( | std::vector< T > & | array | ) |
Referenced by normalizeAbs().
void essentia::removeEndianness | ( | T & | x | ) |
References isBigEndian().
void essentia::restoreDebugLevels | ( | ) |
void essentia::rotateChroma | ( | std::vector< std::vector< T > > & | inputMatrix, |
int | oti | ||
) |
Circularly rotate an input chromagram by an specified optimal transposition index (oti). Expects input chromagram to be in the shape (frames , n_bins) where frames is no of frames and n_bins is no of chroma bins. Throws an exception if the input chromagram is empty.
T essentia::round | ( | const T | value | ) |
Referenced by bpmDistance(), hz2midi(), roundBpms(), and roundToDecimal().
References greatestCommonDivisor(), and round().
T essentia::roundToDecimal | ( | T | x, |
int | decimal | ||
) |
Rounds x up to the desired decimal place.
References round().
|
inline |
Return true
if the two given types are the same.
Referenced by TypeProxy::checkType(), and sameType().
Commodity function to compare two TypeProxy using their respective type.
References sameType(), and TypeProxy::typeInfo().
void essentia::saveDebugLevels | ( | ) |
void essentia::scheduleDebug | ( | const DebuggingScheduleVector & | schedule | ) |
void essentia::scheduleDebug | ( | DebuggingSchedule | schedule, |
int | nentries | ||
) |
the given schedule variable is a vector of pair of ints representing the range of indices for which to activate the given debugging module.
Example:
DebuggingSchedule s = { {0, INT_MAX, EAlgorithm}, // always active {500, INT_MAX, ENetwork | EMemory}, // from time index 500 until the end {782, 782, EScheduler}; // only for time index 782 scheduleDebug(s, ARRAY_SIZE(s));
void essentia::setDebugLevel | ( | int | levels | ) |
void essentia::setDebugLevelForTimeIndex | ( | int | index | ) |
Set the debugging modules for the given time index as specified by the scheduleDebug() function call.
void essentia::shutdown | ( | ) |
T essentia::skewness | ( | const std::vector< T > & | array, |
const T | mean | ||
) |
References mean().
std::vector<T> essentia::skewnessFrames | ( | const std::vector< std::vector< T > > & | frames | ) |
References meanFrames().
void essentia::sortpair | ( | std::vector< T > & | v1, |
std::vector< U > & | v2 | ||
) |
T essentia::stddev | ( | const std::vector< T > & | array, |
const T | mean | ||
) |
References mean(), and variance().
Referenced by pearsonCorrelationCoefficient().
T essentia::stddev | ( | const Tensor< T > & | tensor, |
const T | mean | ||
) |
Returns the standard deviation of a tensor.
References mean().
Returns the standard deviation of a tensor along the given axis.
References mean(), tensorGeometricalInfo(), and TENSORRANK.
std::string essentia::strip | ( | const std::string & | str | ) |
Strip the given string of its leading and trailing whitespace characters.
T essentia::sum | ( | const std::vector< T > & | array | ) |
returns the sum of an array.
References sum().
T essentia::sum | ( | const std::vector< T > & | array, |
int | start, | ||
int | end | ||
) |
returns the sum of an array, unrolled version.
Referenced by TNT::dot_prod(), TNT::matmult(), mean(), norm(), sum(), and sumSquare().
std::vector<T> essentia::sumFrames | ( | const std::vector< std::vector< T > > & | frames | ) |
T essentia::sumSquare | ( | const std::vector< T > | array | ) |
Returns the sum of squared values of an array
References sum().
void essentia::tensorGeometricalInfo | ( | const Tensor< T > & | tensor, |
int & | axis, | ||
std::array< Eigen::Index, 4 - 1 > & | squeezeShape, | ||
std::array< Eigen::Index, 4 > & | summarizerShape, | ||
std::array< Eigen::Index, 4 > & | broadcastShape | ||
) |
Sets squeezeShape
, summarizerShape
, broadcastShape
to perform operations on a Tensor with the shape of tensor
along the axis
dimension.
References TENSORRANK.
Referenced by mean(), stddev(), tensorMax(), and tensorMin().
T essentia::tensorMax | ( | const Tensor< T > & | tensor | ) |
Returns the maximum of a tensor.
Returns the maximum of a tensor along the given axis.
References tensorGeometricalInfo(), and TENSORRANK.
T essentia::tensorMin | ( | const Tensor< T > & | tensor | ) |
Returns the minimum of a tensor.
Returns the minimum of a tensor along the given axis.
References tensorGeometricalInfo(), and TENSORRANK.
std::vector<std::string> essentia::tokenize | ( | const std::string & | str, |
const std::string & | delimiters, | ||
bool | trimEmpty = false |
||
) |
Return a string split whenever there is a char contained in the given delimiters
argument.
std::string essentia::toLower | ( | const std::string & | str | ) |
Return a new string with the characters of str in lower-case.
std::string essentia::toUpper | ( | const std::string & | str | ) |
Return a new string with the characters of str in upper-case.
std::vector<std::vector<T> > essentia::transpose | ( | const std::vector< std::vector< T > > & | m | ) |
Transpose the given matrix. This function throws an exception if all the rows do not have the same size.
TNT::Array2D<T> essentia::transpose | ( | const TNT::Array2D< T > & | m | ) |
References Array2D< T >::dim1(), and Array2D< T >::dim2().
void essentia::unsetDebugLevel | ( | int | levels | ) |
T essentia::variance | ( | const std::vector< T > & | array, |
const T | mean | ||
) |
References mean().
Referenced by MTRand::randNorm(), stddev(), and varianceMatrix().
std::vector<T> essentia::varianceFrames | ( | const std::vector< std::vector< T > > & | frames | ) |
References meanFrames().
TNT::Array2D<T> essentia::varianceMatrix | ( | const std::vector< TNT::Array2D< T > * > & | array, |
const TNT::Array2D< T > & | mean | ||
) |
References matinit(), mean(), and variance().
TNT::Array2D<T> essentia::varianceMatrix | ( | const std::vector< TNT::Array2D< T > > & | array, |
const TNT::Array2D< T > & | mean | ||
) |
References matinit(), mean(), and variance().
|
inline |
References Array2D< T >::dim1(), and Array2D< T >::dim2().
|
extern |
A bitmask representing which debug levels are currently activated.
|
extern |
An integer representing the indentation with which to print the debug messages
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |