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

Matrix of real valued data. More...

Go to the source code of this file.

Data Structures

struct  fmat_t
 Buffer for real data. More...
 

Functions

fmat_tnew_fmat (uint_t height, uint_t length)
 fmat_t buffer creation function More...
 
void del_fmat (fmat_t *s)
 fmat_t buffer deletion function More...
 
smpl_t fmat_get_sample (fmat_t *s, uint_t channel, uint_t position)
 read sample value in a buffer More...
 
void fmat_set_sample (fmat_t *s, smpl_t data, uint_t channel, uint_t position)
 write sample value in a buffer More...
 
void fmat_get_channel (fmat_t *s, uint_t channel, fvec_t *output)
 read channel vector from a buffer More...
 
smpl_tfmat_get_channel_data (fmat_t *s, uint_t channel)
 get vector buffer from an fmat data More...
 
smpl_t ** fmat_get_data (fmat_t *s)
 read data from a buffer More...
 
void fmat_print (fmat_t *s)
 print out fmat data More...
 
void fmat_set (fmat_t *s, smpl_t val)
 set all elements to a given value More...
 
void fmat_zeros (fmat_t *s)
 set all elements to zero More...
 
void fmat_ones (fmat_t *s)
 set all elements to ones More...
 
void fmat_rev (fmat_t *s)
 revert order of vector elements More...
 
void fmat_weight (fmat_t *s, fmat_t *weight)
 apply weight to vector More...
 
void fmat_copy (fmat_t *s, fmat_t *t)
 make a copy of a matrix More...
 

Detailed Description

Matrix of real valued data.

This file specifies the fmat_t type, which is used in aubio to store arrays of floating point values.

Definition in file fmat.h.

Function Documentation

void del_fmat ( fmat_t s)

fmat_t buffer deletion function

Parameters
sbuffer to delete as returned by new_fmat()
Examples:
io/test-source_multi.c, and test-fmat.c.
void fmat_copy ( fmat_t s,
fmat_t t 
)

make a copy of a matrix

Parameters
ssource vector
tvector to copy to
void fmat_get_channel ( fmat_t s,
uint_t  channel,
fvec_t output 
)

read channel vector from a buffer

Parameters
svector to read from
channelchannel to read from
outputfvec_t to output to
Examples:
test-fmat.c.
smpl_t* fmat_get_channel_data ( fmat_t s,
uint_t  channel 
)

get vector buffer from an fmat data

Parameters
svector to read from
channelchannel to read from
smpl_t** fmat_get_data ( fmat_t s)

read data from a buffer

Parameters
svector to read from
smpl_t fmat_get_sample ( fmat_t s,
uint_t  channel,
uint_t  position 
)

read sample value in a buffer

Parameters
svector to read from
channelchannel to read from
positionsample position to read from
void fmat_ones ( fmat_t s)

set all elements to ones

Parameters
svector to modify
void fmat_print ( fmat_t s)

print out fmat data

Parameters
svector to print out
Examples:
io/test-source_multi.c, spectral/test-filterbank.c, spectral/test-filterbank_mel.c, and test-fmat.c.
void fmat_rev ( fmat_t s)

revert order of vector elements

Parameters
svector to revert
void fmat_set ( fmat_t s,
smpl_t  val 
)

set all elements to a given value

Parameters
svector to modify
valvalue to set elements to
void fmat_set_sample ( fmat_t s,
smpl_t  data,
uint_t  channel,
uint_t  position 
)

write sample value in a buffer

Parameters
svector to write to
datavalue to write in s->data[channel][position]
channelchannel to write to
positionsample position to write to
void fmat_weight ( fmat_t s,
fmat_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 fmat_zeros ( fmat_t s)

set all elements to zero

Parameters
svector to modify
fmat_t* new_fmat ( uint_t  height,
uint_t  length 
)

fmat_t buffer creation function

Parameters
lengththe length of the matrix to create
heightthe height of the matrix to create
Examples:
io/test-source_multi.c, and test-fmat.c.