aubio: lvec.h File Reference

aubio 0.4.6

Data Structures | Functions
lvec.h File Reference

Vector of real-valued data in double precision. More...

Go to the source code of this file.

## Data Structures
struct | lvec_t
| Buffer for real data in double precision. More...

## Functions
lvec_t * | new_lvec (uint_t length)
| lvec_t buffer creation function More...
void | del_lvec (lvec_t *s)
| lvec_t buffer deletion function More...
lsmp_t | lvec_get_sample (lvec_t *s, uint_t position)
| read sample value in a buffer More...
void | lvec_set_sample (lvec_t *s, lsmp_t data, uint_t position)
| write sample value in a buffer More...
lsmp_t * | lvec_get_data (const lvec_t *s)
| read data from a buffer More...
void | lvec_print (const lvec_t *s)
| print out lvec data More...
void | lvec_set_all (lvec_t *s, smpl_t val)
| set all elements to a given value More...
void | lvec_zeros (lvec_t *s)
| set all elements to zero More...
void | lvec_ones (lvec_t *s)
| set all elements to ones More...

## Detailed Description

Vector of real-valued data in double precision.

This file specifies the lvec_t buffer type, which is used in some places in aubio to store a vector of lsmp_t.

Note: the lvec_t data type is required in some algorithms such as IIR filters (see temporal/filter.h).

Definition in file lvec.h.

## Function Documentation

## ◆ del_lvec()

void del_lvec | ( | lvec_t * | s | ) |

lvec_t buffer deletion function

Parameters

  s | buffer to delete as returned by new_lvec()

Examples:
  test-lvec.c.

## ◆ lvec_get_data()

lsmp_t* lvec_get_data | ( | const lvec_t * | s | ) |

read data from a buffer

Parameters

  s | vector to read from

## ◆ lvec_get_sample()

lsmp_t lvec_get_sample | ( | lvec_t * | s,
|  | uint_t | position
| ) |  |

read sample value in a buffer

Parameters

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

Examples:
  test-lvec.c.

## ◆ lvec_ones()

void lvec_ones | ( | lvec_t * | s | ) |

set all elements to ones

Parameters

  s | vector to modify

Examples:
  test-lvec.c.

## ◆ lvec_print()

void lvec_print | ( | const lvec_t * | s | ) |

print out lvec data

Parameters

  s | vector to print out

Examples:
  test-lvec.c.

## ◆ lvec_set_all()

void lvec_set_all | ( | lvec_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-lvec.c.

## ◆ lvec_set_sample()

void lvec_set_sample | ( | lvec_t * | s,
|  | lsmp_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-lvec.c.

## ◆ lvec_zeros()

void lvec_zeros | ( | lvec_t * | s | ) |

set all elements to zero

Parameters

  s | vector to modify

## ◆ new_lvec()

lvec_t* new_lvec | ( | uint_t | length | ) |

lvec_t buffer creation function

Parameters

  length | the length of the buffer to create

Examples:
  test-lvec.c.