aubio  0.4.9
Data Structures | Functions
fvec.h File Reference

Go to the source code of this file.

Data Structures

struct  fvec_t
 Buffer for real data. More...
 

Functions

fvec_tnew_fvec (uint_t length)
 fvec_t buffer creation function More...
 
void del_fvec (fvec_t *s)
 fvec_t buffer deletion function More...
 
smpl_t fvec_get_sample (const fvec_t *s, uint_t position)
 read sample value in a buffer More...
 
void fvec_set_sample (fvec_t *s, smpl_t data, uint_t position)
 write sample value in a buffer More...
 
smpl_tfvec_get_data (const fvec_t *s)
 read data from a buffer More...
 
void fvec_print (const fvec_t *s)
 print out fvec data More...
 
void fvec_set_all (fvec_t *s, smpl_t val)
 set all elements to a given value More...
 
void fvec_zeros (fvec_t *s)
 set all elements to zero More...
 
void fvec_ones (fvec_t *s)
 set all elements to ones More...
 
void fvec_rev (fvec_t *s)
 revert order of vector elements More...
 
void fvec_weight (fvec_t *s, const fvec_t *weight)
 apply weight to vector More...
 
void fvec_copy (const fvec_t *s, fvec_t *t)
 make a copy of a vector More...
 
void fvec_weighted_copy (const fvec_t *in, const fvec_t *weight, fvec_t *out)
 make a copy of a vector, applying weights to each element More...
 

Detailed Description

Vector of real-valued data

This file specifies the fvec_t buffer type, which is used throughout aubio to store vector of real-valued smpl_t.

Definition in file fvec.h.

Function Documentation

◆ del_fvec()

void del_fvec ( fvec_t s)

◆ fvec_copy()

void fvec_copy ( const fvec_t s,
fvec_t t 
)

make a copy of a vector

Parameters
ssource vector
tvector to copy to
Examples
test-fvec.c.

◆ fvec_get_data()

smpl_t* fvec_get_data ( const fvec_t s)

read data from a buffer

Parameters
svector to read from
Examples
test-fvec.c.

◆ fvec_get_sample()

smpl_t fvec_get_sample ( const fvec_t s,
uint_t  position 
)

read sample value in a buffer

Parameters
svector to read from
positionsample position to read from
Examples
examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and test-fvec.c.

◆ fvec_ones()

void fvec_ones ( fvec_t s)

set all elements to ones

Parameters
svector to modify
Examples
test-fvec.c.

◆ fvec_print()

void fvec_print ( const fvec_t s)

◆ fvec_rev()

void fvec_rev ( fvec_t s)

revert order of vector elements

Parameters
svector to revert

◆ fvec_set_all()

void fvec_set_all ( fvec_t s,
smpl_t  val 
)

set all elements to a given value

Parameters
svector to modify
valvalue to set elements to
Examples
spectral/test-phasevoc.c.

◆ fvec_set_sample()

void fvec_set_sample ( fvec_t s,
smpl_t  data,
uint_t  position 
)

write sample value in a buffer

Parameters
svector to write to
datavalue to write in s->data[position]
positionsample position to write to
Examples
test-fvec.c.

◆ fvec_weight()

void fvec_weight ( fvec_t s,
const fvec_t weight 
)

apply weight to vector

If the weight vector is longer than s, only the first elements are used. If the weight vector is shorter than s, the last elements of s are not weighted.

Parameters
svector to weight
weightweighting coefficients

◆ fvec_weighted_copy()

void fvec_weighted_copy ( const fvec_t in,
const fvec_t weight,
fvec_t out 
)

make a copy of a vector, applying weights to each element

Parameters
ininput vector
weightweights vector
outoutput vector

◆ fvec_zeros()

void fvec_zeros ( fvec_t s)

set all elements to zero

Parameters
svector to modify
Examples
examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and test-fvec.c.

◆ new_fvec()

fvec_t* new_fvec ( uint_t  length)