forked from simonas-dev/aubio-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuffer_utils.go
67 lines (54 loc) · 1.5 KB
/
buffer_utils.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package aubio
/*
#cgo LDFLAGS: -laubio
#include <aubio/aubio.h>
*/
import "C"
// Inplace compute the exp(x) of each vector elements
func (buf *SimpleBuffer) Exp() {
C.fvec_exp(buf.vec)
}
// Inplace compute the cos(x) of each vector elements
func (buf *SimpleBuffer) Cos() {
C.fvec_cos(buf.vec)
}
// Inplace compute the sin(x) of each vector elements
func (buf *SimpleBuffer) Sin() {
C.fvec_sin(buf.vec)
}
// Inplace compute the abs(x) of each vector elements
func (buf *SimpleBuffer) Abs() {
C.fvec_abs(buf.vec)
}
// Inplace compute the sqrt(x) of each vector elements
func (buf *SimpleBuffer) Sqrt() {
C.fvec_sqrt(buf.vec)
}
// Inplace compute the log10(x) of each vector elements
func (buf *SimpleBuffer) Log10() {
C.fvec_log10(buf.vec)
}
// Inplace compute the log(x) (natural log, ln) of each vector elements
func (buf *SimpleBuffer) Log() {
C.fvec_log(buf.vec)
}
// Inplace compute the floor(x) of each vector elements
func (buf *SimpleBuffer) Floor() {
C.fvec_floor(buf.vec)
}
// Inplace compute the ceil(x) of each vector elements
func (buf *SimpleBuffer) Ceil() {
C.fvec_ceil(buf.vec)
}
// Inplace compute the round(x) of each vector elements
func (buf *SimpleBuffer) Round() {
C.fvec_round(buf.vec)
}
// Inplace raise each vector elements to the power pow
func (buf *SimpleBuffer) Pow(pow float64) {
C.fvec_pow(buf.vec, C.smpl_t(pow))
}
// Inplace clamp the values of a buffer within the range [-abs(max), abs(max)]
func (buf *SimpleBuffer) Clamp(absmax float64) {
C.fvec_clamp(buf.vec, C.smpl_t(absmax))
}