aubio  0.4.0
 All Data Structures Files Functions Variables Typedefs Macros
Data Structures | Functions
fvec.h File Reference

Vector of real-valued data. More...

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 (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 (fvec_t *s)
 read data from a buffer More...
 
void fvec_print (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, fvec_t *weight)
 apply weight to vector More...
 
void fvec_copy (fvec_t *s, fvec_t *t)
 make a copy of a vector 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

void del_fvec ( fvec_t s)
void fvec_copy ( fvec_t s,
fvec_t t 
)

make a copy of a vector

Parameters
ssource vector
tvector to copy to
smpl_t* fvec_get_data ( fvec_t s)

read data from a buffer

Parameters
svector to read from
smpl_t fvec_get_sample ( fvec_t s,
uint_t  position 
)

read sample value in a buffer

Parameters
svector to read from
positionsample position to read from
Examples:
examples/aubionotes.c, examples/aubioonset.c, examples/aubiopitch.c, and examples/aubiotrack.c.
void fvec_ones ( fvec_t s)

set all elements to ones

Parameters
svector to modify
Examples:
test-fvec.c.
void fvec_print ( fvec_t s)
void fvec_rev ( fvec_t s)

revert order of vector elements

Parameters
svector to revert
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.
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
void fvec_weight ( fvec_t s,
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
void fvec_zeros ( fvec_t s)

set all elements to zero

Parameters
svector to modify
Examples:
examples/aubionotes.c, examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and test-fvec.c.
fvec_t* new_fvec ( uint_t  length)