Bånder

PoolAggregator extends BaseAlgorithm
in package

PoolAggregator

Inputs:

[pool] input - the input pool

Outputs:

[pool] output - a pool containing the aggregate values of the input pool

Parameters:

defaultStats: vector_string (default = ["mean", "stdev", "min", "max", "median"]) the default statistics to be computed for each descriptor in the input pool

exceptions: map_vector_string (default = }) a mapping between descriptor names (no duplicates) and the types of statistics to be computed for those descriptors (e.g. { lowlevel.bpm : [min, max], lowlevel.gain : [var, min, dmean] })

Description:

This algorithm performs statistical aggregation on a Pool and places the results of the aggregation into a new Pool. Supported statistical units are:

  • 'min' (minimum),
  • 'max' (maximum),
  • 'median',
  • 'mean',
  • 'var' (variance),
  • 'stdev' (standard deviation),
  • 'skew' (skewness),
  • 'kurt' (kurtosis),
  • 'dmean' (mean of the derivative),
  • 'dvar' (variance of the derivative),
  • 'dmean2' (mean of the second derivative),
  • 'dvar2' (variance of the second derivative),
  • 'cov' (covariance), and
  • 'icov' (inverse covariance).
  • 'value' (copy of descriptor, but the value is placed under the name '.value')
  • 'copy' (verbatim copy of descriptor, no aggregation; exclusive: cannot be performed with any other statistical units).
  • 'last' (last value of descriptor placed under the name ''; exclusive: cannot be performed with any other statistical units

These statistics can be computed for single-dimensional vectors (vectors of Reals) and two-dimensional vectors (vectors of vectors of Reals) in the Pool. Statistics for two-dimensional vectors are computed by aggregating each column placing the result into a vector of the same size as the size of each vector in the input Pool under the given descriptor (which implies their equal size).

In the case of 'cov' and 'icov', two-dimensional vectors are required, and each statistic returns a square matrix with the dimensions equal to the length of the vectors under the given descriptor. Computing 'icov' requires the corresponding covariance matrix to be invertible.

Note that only the absolute values of the first and second derivatives are considered when computing their mean ('dmean' and 'dmean2') and variance ('dvar' and 'dvar2'). This is to avoid a trivial solution for the mean.

For vectors, if the input pool value consists of only one vector, its aggregation will be skipped, and the vector itself will be added to the output.

The 'value' and 'copy' are auxiliary aggregation methods that can be used to copy values in the input Pool to the output Pool without aggregation. In the case of 'last', the last value in the input vector of Reals (or input vector of vectors of Reals) will be taken and saved as a single Real (or single vector of Reals) in the output Pool.

Category: Stats Mode: standard

Table of Contents

Properties

$algorithmName  : string
$category  : string
$essentia  : EssentiaFFI
$mode  : string
$parameters  : array<string|int, mixed>
$algorithmHandle  : CData|null
$configured  : bool

Methods

__construct()  : mixed
__destruct()  : mixed
compute()  : array<string|int, mixed>
getAlgorithmName()  : string
getCategory()  : string
getMode()  : string
getParameters()  : array<string|int, mixed>
setParameter()  : self
configure()  : void
isValidParameter()  : bool
validateInput()  : void
cleanupAlgorithm()  : void
configureAlgorithmParameters()  : void
estimateOutputSize()  : int
executeAlgorithm()  : array<string|int, mixed>
executeGenericAlgorithm()  : array<string|int, mixed>
executeSpecificAlgorithm()  : array<string|int, mixed>
getAlgorithmCreateFunction()  : string
getValidParameters()  : array<string|int, mixed>
initializeAlgorithm()  : void
prepareInput()  : mixed
processOutput()  : array<string|int, mixed>
processRhythmOutput()  : array<string|int, mixed>
processSpectralOutput()  : array<string|int, mixed>
processStatsOutput()  : array<string|int, mixed>
processTemporalOutput()  : array<string|int, mixed>
processTonalOutput()  : array<string|int, mixed>
setAlgorithmParameter()  : void
setArrayParameter()  : void
validateAlgorithmInput()  : void

Properties

$algorithmName

protected string $algorithmName = 'PoolAggregator'

$parameters

protected array<string|int, mixed> $parameters = []

Methods

__construct()

public __construct([array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
$parameters : array<string|int, mixed> = []

compute()

public compute(mixed $input) : array<string|int, mixed>
Parameters
$input : mixed
Return values
array<string|int, mixed>

getAlgorithmName()

public getAlgorithmName() : string
Return values
string

getCategory()

public getCategory() : string
Return values
string

getParameters()

public getParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

setParameter()

public setParameter(string $key, mixed $value) : self
Parameters
$key : string
$value : mixed
Return values
self

configure()

protected configure(array<string|int, mixed> $parameters) : void
Parameters
$parameters : array<string|int, mixed>

isValidParameter()

protected isValidParameter(string $parameter) : bool
Parameters
$parameter : string
Return values
bool

validateInput()

protected validateInput(mixed $input, string $expectedType) : void
Parameters
$input : mixed
$expectedType : string

configureAlgorithmParameters()

private configureAlgorithmParameters() : void

estimateOutputSize()

private estimateOutputSize(mixed $input) : int
Parameters
$input : mixed
Return values
int

executeAlgorithm()

private executeAlgorithm(mixed $input) : array<string|int, mixed>
Parameters
$input : mixed
Return values
array<string|int, mixed>

executeGenericAlgorithm()

private executeGenericAlgorithm(FFI $ffi, mixed $input) : array<string|int, mixed>
Parameters
$ffi : FFI
$input : mixed
Return values
array<string|int, mixed>

executeSpecificAlgorithm()

private executeSpecificAlgorithm(FFI $ffi, mixed $input) : array<string|int, mixed>
Parameters
$ffi : FFI
$input : mixed
Return values
array<string|int, mixed>

getAlgorithmCreateFunction()

private getAlgorithmCreateFunction() : string
Return values
string

getValidParameters()

private getValidParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

prepareInput()

private prepareInput(mixed $input) : mixed
Parameters
$input : mixed

processOutput()

private processOutput(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>
Return values
array<string|int, mixed>

processRhythmOutput()

private processRhythmOutput(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>
Return values
array<string|int, mixed>

processSpectralOutput()

private processSpectralOutput(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>
Return values
array<string|int, mixed>

processStatsOutput()

private processStatsOutput(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>
Return values
array<string|int, mixed>

processTemporalOutput()

private processTemporalOutput(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>
Return values
array<string|int, mixed>

processTonalOutput()

private processTonalOutput(array<string|int, mixed> $result) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>
Return values
array<string|int, mixed>

setAlgorithmParameter()

private setAlgorithmParameter(FFI $ffi, string $key, mixed $value) : void
Parameters
$ffi : FFI
$key : string
$value : mixed

setArrayParameter()

private setArrayParameter(FFI $ffi, string $key, array<string|int, mixed> $value) : void
Parameters
$ffi : FFI
$key : string
$value : array<string|int, mixed>

validateAlgorithmInput()

private validateAlgorithmInput(mixed $input) : void
Parameters
$input : mixed

        
On this page

Search results