source: src/lvec.h @ c698d1b

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since c698d1b was c698d1b, checked in by Paul Brossier <piem@piem.org>, 11 years ago

src/{c,l}vec.h: update documentation

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*
2   Copyright (C) 2003-2007 Paul Brossier <piem@piem.org>
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU General Public License as published by
6   the Free Software Foundation; either version 2 of the License, or
7   (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   GNU General Public License for more details.
13
14   You should have received a copy of the GNU General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18*/
19
20#ifndef _LVEC_H
21#define _LVEC_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/** \file
28
29  Real buffers
30
31  This file specifies the lvec_t buffer type, which is used in aubio to store
32  double precision real data. Note that the lvec_t data type is mostly used for
33  IIR filters (see temporal/filter.h).
34
35*/
36
37/** Sample buffer type */
38typedef struct _lvec_t lvec_t;
39/** Buffer for real values */
40struct _lvec_t {
41  uint_t length;   /**< length of buffer */
42  uint_t channels; /**< number of channels */
43  lsmp_t **data;   /**< data array of size [length] * [channels] */
44};
45/** lvec_t buffer creation function
46
47  \param length the length of the buffer to create
48  \param channels the number of channels in the buffer
49
50*/
51lvec_t * new_lvec(uint_t length, uint_t channels);
52/** lvec_t buffer deletion function
53
54  \param s buffer to delete as returned by new_lvec()
55
56*/
57void del_lvec(lvec_t *s);
58/** read sample value in a buffer
59
60  Note that this function is not used in the aubio library, since the same
61  result can be obtained using vec->data[channel][position]. Its purpose is to
62  access these values from wrappers, as created by swig.
63
64  \param s vector to read from
65  \param channel channel to read from
66  \param position sample position to read from
67
68*/
69lsmp_t lvec_read_sample(lvec_t *s, uint_t channel, uint_t position);
70/** write sample value in a buffer
71
72  Note that this function is not used in the aubio library, since the same
73  result can be obtained by assigning vec->data[channel][position]. Its purpose
74  is to access these values from wrappers, as created by swig.
75
76  \param s vector to write to
77  \param data value to write in s->data[channel][position]
78  \param channel channel to write to
79  \param position sample position to write to
80
81*/
82void  lvec_write_sample(lvec_t *s, lsmp_t data, uint_t channel, uint_t position);
83/** read channel vector from a buffer
84
85  Note that this function is not used in the aubio library, since the same
86  result can be obtained with vec->data[channel]. Its purpose is to access
87  these values from wrappers, as created by swig.
88
89  \param s vector to read from
90  \param channel channel to read from
91
92*/
93lsmp_t * lvec_get_channel(lvec_t *s, uint_t channel);
94/** write channel vector into a buffer
95
96  Note that this function is not used in the aubio library, since the same
97  result can be obtained by assigning vec->data[channel]. Its purpose is to
98  access these values from wrappers, as created by swig.
99
100  \param s vector to write to
101  \param data vector of [length] values to write
102  \param channel channel to write to
103
104*/
105void lvec_put_channel(lvec_t *s, lsmp_t * data, uint_t channel);
106/** read data from a buffer
107
108  Note that this function is not used in the aubio library, since the same
109  result can be obtained with vec->data. Its purpose is to access these values
110  from wrappers, as created by swig.
111
112  \param s vector to read from
113
114*/
115lsmp_t ** lvec_get_data(lvec_t *s);
116
117/** print out lvec data
118
119  \param s vector to print out
120
121*/
122void lvec_print(lvec_t *s);
123
124#ifdef __cplusplus
125}
126#endif
127
128#endif /* _LVEC_H */
Note: See TracBrowser for help on using the repository browser.