Loading...
Searching...
No Matches
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_t * | new_fmat (uint_t height, uint_t length)
| fmat_t buffer creation function
void | del_fmat (fmat_t *s)
| fmat_t buffer deletion function
smpl_t | fmat_get_sample (const fmat_t *s, uint_t channel, uint_t position)
| read sample value in a buffer
void | fmat_set_sample (fmat_t *s, smpl_t data, uint_t channel, uint_t position)
| write sample value in a buffer
void | fmat_get_channel (const fmat_t *s, uint_t channel, fvec_t *output)
| read channel vector from a buffer
smpl_t * | fmat_get_channel_data (const fmat_t *s, uint_t channel)
| get vector buffer from an fmat data
smpl_t ** | fmat_get_data (const fmat_t *s)
| read data from a buffer
void | fmat_print (const fmat_t *s)
| print out fmat data
void | fmat_set (fmat_t *s, smpl_t val)
| set all elements to a given value
void | fmat_zeros (fmat_t *s)
| set all elements to zero
void | fmat_ones (fmat_t *s)
| set all elements to ones
void | fmat_rev (fmat_t *s)
| revert order of vector elements
void | fmat_weight (fmat_t *s, const fmat_t *weight)
| apply weight to vector
void | fmat_copy (const fmat_t *s, fmat_t *t)
| make a copy of a matrix
void | fmat_vecmul (const fmat_t *s, const fvec_t *scale, fvec_t *output)
| compute the product of a matrix by a vector

## 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

## del_fmat()

void del_fmat | ( | fmat_t * | s | ) |

fmat_t buffer deletion function

Parameters

  s | buffer to delete as returned by new_fmat()

Examples
  io/test-sink.c, io/test-source.c, and test-fmat.c.

## fmat_copy()

void fmat_copy | ( | const fmat_t * | s,
|  | fmat_t * | t )

make a copy of a matrix

Parameters

  s | source vector
  t | vector to copy to

Examples
  test-fmat.c.

## fmat_get_channel()

void fmat_get_channel | ( | const fmat_t * | s,
|  | uint_t | channel,
|  | fvec_t * | output )

read channel vector from a buffer

Parameters

  s | vector to read from
  channel | channel to read from
  output | fvec_t to output to

Examples
  test-fmat.c.

## fmat_get_channel_data()

smpl_t * fmat_get_channel_data | ( | const fmat_t * | s,
|  | uint_t | channel )

get vector buffer from an fmat data

Parameters

  s | vector to read from
  channel | channel to read from

Examples
  test-fmat.c.

## fmat_get_data()

smpl_t ** fmat_get_data | ( | const fmat_t * | s | ) |

read data from a buffer

Parameters

  s | vector to read from

Examples
  test-fmat.c.

## fmat_get_sample()

smpl_t fmat_get_sample | ( | const fmat_t * | s,
|  | uint_t | channel,
|  | uint_t | position )

read sample value in a buffer

Parameters

  s | vector to read from
  channel | channel to read from
  position | sample position to read from

Examples
  test-fmat.c.

## fmat_ones()

void fmat_ones | ( | fmat_t * | s | ) |

set all elements to ones

Parameters

  s | vector to modify

Examples
  test-fmat.c.

## fmat_print()

void fmat_print | ( | const fmat_t * | s | ) |

print out fmat data

Parameters

  s | vector to print out

Examples
  spectral/test-filterbank.c, spectral/test-filterbank_mel.c, and test-fmat.c.

## fmat_rev()

void fmat_rev | ( | fmat_t * | s | ) |

revert order of vector elements

Parameters

  s | vector to revert

Examples
  test-fmat.c.

## fmat_set()

void fmat_set | ( | fmat_t * | s,
|  | smpl_t | val )

set all elements to a given value

Parameters

  s | vector to modify
  val | value to set elements to

Examples
  test-fmat.c.

## fmat_set_sample()

void fmat_set_sample | ( | fmat_t * | s,
|  | smpl_t | data,
|  | uint_t | channel,
|  | uint_t | position )

write sample value in a buffer

Parameters

  s | vector to write to
  data | value to write in s->data[channel][position]
  channel | channel to write to
  position | sample position to write to

Examples
  test-fmat.c.

## fmat_vecmul()

void fmat_vecmul | ( | const fmat_t * | s,
|  | const fvec_t * | scale,
|  | fvec_t * | output )

compute the product of a matrix by a vector

Parameters

  s | matrix to compute product with
  scale | vector to compute product with
  output | vector to store restults in

## fmat_weight()

void fmat_weight | ( | fmat_t * | s,
|  | const 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

  s | vector to weight
  weight | weighting coefficients

Examples
  test-fmat.c.

## fmat_zeros()

void fmat_zeros | ( | fmat_t * | s | ) |

set all elements to zero

Parameters

  s | vector to modify

## new_fmat()

fmat_t * new_fmat | ( | uint_t | height,
|  | uint_t | length )

fmat_t buffer creation function

Parameters

  length | the length of the matrix to create
  height | the height of the matrix to create

Examples
  io/test-sink.c, io/test-source.c, and test-fmat.c.