LibXtract 1.6.0
feature extraction functions and data structures

Typedefs

typedef struct xtract_last_n_state_ xtract_last_n_state

Functions

xtract_last_n_state * xtract_last_n_state_new (size_t capacity)
void xtract_last_n_state_delete (xtract_last_n_state *last_n_state)
int xtract_last_n (const xtract_last_n_state *state, const double *data, const int N, const void *argv, double *result)

Detailed Description

Functions that extract a feature over multiple frames

Function Documentation

◆ xtract_last_n()

int xtract_last_n ( const xtract_last_n_state * state,
const double * data,
const int N,
const void * argv,
double * result )

Write a vector of the last N input values to result

Parameters
statea pointer to an xtract_last_n_state struct as allocated by xtract_last_n_state_new(); NULL is an argument error
dataa pointer to a double representing the current input value
Nan integer representing 'N' the number of values to be written to *result, at least 1 (fewer is an argument error) and equal to the capacity the state was created with (any other positive size is a bad state)
argva pointer to NULL
resulta pointer to an array of doubles representing the last N values, where the nth value is the current one. The array must have been allocated to size N elements and initialised by the caller

◆ xtract_last_n_state_delete()

void xtract_last_n_state_delete ( xtract_last_n_state * last_n_state)

Free a state allocated by xtract_last_n_state_new()

Parameters
last_n_statethe state to free, as returned by xtract_last_n_state_new()

◆ xtract_last_n_state_new()

xtract_last_n_state * xtract_last_n_state_new ( size_t capacity)

Allocate the state for xtract_last_n() over frames of capacity values

Parameters
capacitythe N that xtract_last_n() will be called with
Returns
a pointer to the new state, or NULL if memory cannot be allocated