aubio: fvec.h File Reference

aubio 0.4.9

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_t * | new_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_t * | fvec_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_t buffer deletion function

Parameters

  s | buffer to delete as returned by new_fvec()

Examples
  examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, io/test-sink.c, io/test-source.c, onset/test-onset.c, pitch/test-pitch.c, spectral/test-dct.c, spectral/test-fft.c, spectral/test-filterbank.c, spectral/test-filterbank_mel.c, spectral/test-mfcc.c, spectral/test-phasevoc.c, spectral/test-specdesc.c, spectral/test-tss.c, synth/test-sampler.c, synth/test-wavetable.c, tempo/test-tempo.c, temporal/test-biquad.c, temporal/test-filter.c, and test-fvec.c.

## ◆ fvec_copy()

void fvec_copy | ( | const fvec_t * | s,
|  | fvec_t * | t
| ) |  |

make a copy of a vector

Parameters

  s | source vector
  t | vector 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

  s | vector 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

  s | vector to read from
  position | sample 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

  s | vector to modify

Examples
  test-fvec.c.

## ◆ fvec_print()

void fvec_print | ( | const fvec_t * | s | ) |

print out fvec data

Parameters

  s | vector to print out

Examples
  io/test-source.c, spectral/test-dct.c, spectral/test-mfcc.c, spectral/test-phasevoc.c, temporal/test-biquad.c, temporal/test-filter.c, and test-fvec.c.

## ◆ fvec_rev()

void fvec_rev | ( | fvec_t * | s | ) |

revert order of vector elements

Parameters

  s | vector to revert

## ◆ fvec_set_all()

void fvec_set_all | ( | fvec_t * | s,
|  | smpl_t | val
| ) |  |

set all elements to a given value

Parameters

  s | vector to modify
  val | value 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

  s | vector to write to
  data | value to write in s->data[position]
  position | sample 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

  s | vector to weight
  weight | weighting 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

  in | input vector
  weight | weights vector
  out | output vector

## ◆ fvec_zeros()

void fvec_zeros | ( | fvec_t * | s | ) |

set all elements to zero

Parameters

  s | vector 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 | ) |

fvec_t buffer creation function

Parameters

  length | the length of the buffer to create

Examples
  examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, io/test-sink.c, io/test-source.c, onset/test-onset.c, pitch/test-pitch.c, spectral/test-dct.c, spectral/test-fft.c, spectral/test-filterbank.c, spectral/test-filterbank_mel.c, spectral/test-mfcc.c, spectral/test-phasevoc.c, spectral/test-specdesc.c, spectral/test-tss.c, synth/test-sampler.c, synth/test-wavetable.c, tempo/test-tempo.c, temporal/test-biquad.c, temporal/test-filter.c, and test-fvec.c.