aubio: lvec.h File Reference

aubio 0.4.9

Loading...
Searching...
No Matches
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
void | del_lvec (lvec_t *s)
| lvec_t buffer deletion function
lsmp_t | lvec_get_sample (lvec_t *s, uint_t position)
| read sample value in a buffer
void | lvec_set_sample (lvec_t *s, lsmp_t data, uint_t position)
| write sample value in a buffer
lsmp_t * | lvec_get_data (const lvec_t *s)
| read data from a buffer
void | lvec_print (const lvec_t *s)
| print out lvec data
void | lvec_set_all (lvec_t *s, smpl_t val)
| set all elements to a given value
void | lvec_zeros (lvec_t *s)
| set all elements to zero
void | lvec_ones (lvec_t *s)
| set all elements to ones

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

Examples
  test-lvec.c.

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

Examples
  test-lvec.c.

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