source: python/ext/py-musicutils.h @ b532275

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretch
Last change on this file since b532275 was b532275, checked in by Paul Brossier <piem@piem.org>, 17 months ago

python/ext/py-musicutils.*: add shift(fvec) and ishift(fvec)

  • Property mode set to 100644
File size: 2.7 KB
Line 
1#ifndef PY_AUBIO_MUSICUTILS_H
2#define PY_AUBIO_MUSICUTILS_H
3
4static char Py_aubio_window_doc[] = ""
5"window(string, integer) -> fvec\n"
6"\n"
7"Create a window\n"
8"\n"
9"Example\n"
10"-------\n"
11"\n"
12">>> window('hanningz', 1024)\n"
13"array([  0.00000000e+00,   9.41753387e-06,   3.76403332e-05, ...,\n"
14"         8.46982002e-05,   3.76403332e-05,   9.41753387e-06], dtype=float32)";
15
16PyObject * Py_aubio_window(PyObject *self, PyObject *args);
17
18static char Py_aubio_level_lin_doc[] = ""
19"level_lin(fvec) -> fvec\n"
20"\n"
21"Compute sound level on a linear scale.\n"
22"\n"
23"This gives the average of the square amplitudes.\n"
24"\n"
25"Example\n"
26"-------\n"
27"\n"
28">>> level_Lin(numpy.ones(1024))\n"
29"1.0";
30
31PyObject * Py_aubio_level_lin(PyObject *self, PyObject *args);
32
33static char Py_aubio_db_spl_doc[] = ""
34"Compute sound pressure level (SPL) in dB\n"
35"\n"
36"This quantity is often wrongly called 'loudness'.\n"
37"\n"
38"This gives ten times the log10 of the average of the square amplitudes.\n"
39"\n"
40"Example\n"
41"-------\n"
42"\n"
43">>> db_spl(numpy.ones(1024))\n"
44"1.0";
45
46PyObject * Py_aubio_db_spl(PyObject *self, PyObject *args);
47
48static char Py_aubio_silence_detection_doc[] = ""
49"Check if buffer level in dB SPL is under a given threshold\n"
50"\n"
51"Return 0 if level is under the given threshold, 1 otherwise.\n"
52"\n"
53"Example\n"
54"-------\n"
55"\n"
56">>> import numpy\n"""
57">>> silence_detection(numpy.ones(1024, dtype=\"float32\"), -80)\n"
58"0";
59
60PyObject * Py_aubio_silence_detection(PyObject *self, PyObject *args);
61
62static char Py_aubio_level_detection_doc[] = ""
63"Get buffer level in dB SPL if over a given threshold, 1. otherwise.\n"
64"\n"
65"Example\n"
66"-------\n"
67"\n"
68">>> import numpy\n"""
69">>> level_detection(0.7*numpy.ones(1024, dtype=\"float32\"), -80)\n"
70"0";
71
72PyObject * Py_aubio_level_detection(PyObject *self, PyObject *args);
73
74static char Py_aubio_shift_doc[] = ""
75"Swap left and right partitions of a vector\n"
76"\n"
77"Returns the swapped vector. The input vector is also modified.\n"
78"\n"
79"For a vector of length N, the partition is split at index N - N//2.\n"
80"\n"
81"Example\n"
82"-------\n"
83"\n"
84">>> import numpy\n"
85">>> shift(numpy.arange(3, dtype=aubio.float_type))\n"
86"array([2., 0., 1.], dtype=" AUBIO_NPY_SMPL_STR ")";
87PyObject * Py_aubio_shift(PyObject *self, PyObject *args);
88
89static char Py_aubio_ishift_doc[] = ""
90"Swap right and left partitions of a vector\n"
91"\n"
92"Returns the swapped vector. The input vector is also modified.\n"
93"\n"
94"Unlike with shift(), the partition is split at index N//2.\n"
95"\n"
96"Example\n"
97"-------\n"
98"\n"
99">>> import numpy\n"
100">>> ishift(numpy.arange(3, dtype=aubio.float_type))\n"
101"array([1., 2., 0.], dtype=" AUBIO_NPY_SMPL_STR ")";
102PyObject * Py_aubio_ishift(PyObject *self, PyObject *args);
103
104#endif /* PY_AUBIO_MUSICUTILS_H */
Note: See TracBrowser for help on using the repository browser.