source: python/ext/aubio-docstrings.h @ 4b16721

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/timestretchfix/ffmpeg5
Last change on this file since 4b16721 was d91566e, checked in by Paul Brossier <piem@piem.org>, 6 years ago

[py] improve specdesc dosctring

  • Property mode set to 100644
File size: 4.7 KB
Line 
1#define PYAUBIO_dct_doc \
2    "dct(size=1024)\n"\
3    "\n"\
4    "Compute Discrete Fourier Transorms of Type-II.\n"\
5    "\n"\
6    "Parameters\n"\
7    "----------\n"\
8    "size : int\n"\
9    "    size of the DCT to compute\n"\
10    "\n"\
11    "Example\n"\
12    "-------\n"\
13    ">>> d = aubio.dct(16)\n"\
14    ">>> d.size\n"\
15    "16\n"\
16    ">>> x = aubio.fvec(np.ones(d.size))\n"\
17    ">>> d(x)\n"\
18    "array([4., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n"\
19    "      dtype=float32)\n"\
20    ">>> d.rdo(d(x))\n"\
21    "array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.],\n"\
22    "      dtype=float32)\n"\
23    "\n"\
24    "References\n"\
25    "----------\n"\
26    "`DCT-II in Discrete Cosine Transform\n"\
27    "<https://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-II>`_\n"\
28    "on Wikipedia.\n"
29
30#define PYAUBIO_mfcc_doc \
31    "mfcc(buf_size=1024, n_filters=40, n_coeffs=13, samplerate=44100)\n"\
32    "\n"\
33    "Compute Mel Frequency Cepstrum Coefficients (MFCC).\n"\
34    "\n"\
35    "`mfcc` creates a callable which takes a `cvec` as input.\n"\
36    "\n"\
37    "If `n_filters = 40`, the filterbank will be initialized with\n"\
38    ":meth:`filterbank.set_mel_coeffs_slaney`. Otherwise, if `n_filters`\n"\
39    "is greater than `0`, it will be initialized with\n"\
40    ":meth:`filterbank.set_mel_coeffs` using `fmin = 0`,\n"\
41    "`fmax = samplerate/`.\n"\
42    "\n"\
43    "Example\n"\
44    "-------\n"\
45    ">>> buf_size = 2048; n_filters = 128; n_coeffs = 13; samplerate = 44100\n"\
46    ">>> mf = aubio.mfcc(buf_size, n_filters, n_coeffs, samplerate)\n"\
47    ">>> fftgrain = aubio.cvec(buf_size)\n"\
48    ">>> mf(fftgrain).shape\n"\
49    "(13,)\n"\
50    ""
51
52#define PYAUBIO_notes_doc \
53    "notes(method=\"default\", buf_size=1024, hop_size=512, samplerate=44100)\n"\
54    "\n"\
55    "Note detection\n"
56
57#define PYAUBIO_onset_doc \
58    "onset(method=\"default\", buf_size=1024, hop_size=512, samplerate=44100)\n"\
59    "\n"\
60    "Onset detection object. `method` should be one of method supported by\n"\
61    ":class:`specdesc`.\n"
62
63#define PYAUBIO_pitch_doc \
64    "pitch(method=\"default\", buf_size=1024, hop_size=512, samplerate=44100)\n"\
65    "\n"\
66    "Pitch detection.\n"\
67    "\n"\
68    "Supported methods: `yinfft`, `yin`, `yinfast`, `fcomb`, `mcomb`,\n"\
69    "`schmitt`, `specacf`, `default` (`yinfft`).\n"
70
71#define PYAUBIO_sampler_doc \
72    "sampler(hop_size=512, samplerate=44100)\n"\
73    "\n"\
74    "Sampler.\n"
75
76#define PYAUBIO_specdesc_doc \
77    "specdesc(method=\"default\", buf_size=1024)\n"\
78    "\n"\
79    "Spectral description functions. Creates a callable that takes a\n"\
80    ":class:`cvec` as input, typically created by :class:`pvoc` for\n"\
81    "overlap and windowing, and returns a single float.\n"\
82    "\n"\
83    "`method` can be any of the values listed below. If `default` is used\n"\
84    "the `hfc` function will be selected.\n"\
85    "\n"\
86    "Onset novelty functions:\n"\
87    "\n"\
88    "- `energy`: local energy,\n"\
89    "- `hfc`: high frequency content,\n"\
90    "- `complex`: complex domain,\n"\
91    "- `phase`: phase-based method,\n"\
92    "- `wphase`: weighted phase deviation,\n"\
93    "- `specdiff`: spectral difference,\n"\
94    "- `kl`: Kullback-Liebler,\n"\
95    "- `mkl`: modified Kullback-Liebler,\n"\
96    "- `specflux`: spectral flux.\n"\
97    "\n"\
98    "Spectral shape functions:\n"\
99    "\n"\
100    "- `centroid`: spectral centroid (barycenter of the norm vector),\n"\
101    "- `spread`: variance around centroid,\n"\
102    "- `skewness`: third order moment,\n"\
103    "- `kurtosis`: a measure of the flatness of the spectrum,\n"\
104    "- `slope`: decreasing rate of the amplitude,\n"\
105    "- `decrease`: perceptual based measurement of the decreasing rate,\n"\
106    "- `rolloff`: 95th energy percentile.\n"\
107    "\n"\
108    "Parameters\n"\
109    "----------\n"\
110    "method : str\n"\
111    "    Onset novelty or spectral shape function.\n"\
112    "buf_size : int\n"\
113    "    Length of the input frame.\n"\
114    "\n"\
115    "Example\n"\
116    "-------\n"\
117    ">>> win_s = 1024; hop_s = win_s // 2\n"\
118    ">>> pv = aubio.pvoc(win_s, hop_s)\n"\
119    ">>> sd = aubio.specdesc(\"mkl\", win_s)\n"\
120    ">>> sd(pv(aubio.fvec(hop_s))).shape\n"\
121    "(1,)\n"\
122    "\n"\
123    "References\n"\
124    "----------\n"\
125    "`Detailed description "\
126    "<https://aubio.org/doc/latest/specdesc_8h.html#details>`_ in\n"\
127    "`aubio API documentation <https://aubio.org/doc/latest/index.html>`_.\n"\
128    ""
129
130#define PYAUBIO_tempo_doc \
131    "tempo(method=\"default\", buf_size=1024, hop_size=512, samplerate=44100)\n"\
132    "\n"\
133    "Tempo detection and beat tracking.\n"
134
135#define PYAUBIO_tss_doc \
136    "tss(buf_size=1024, hop_size=512)\n"\
137    "\n"\
138    "Transient/Steady-state separation.\n"
139
140#define PYAUBIO_wavetable_doc \
141    "wavetable(samplerate=44100, hop_size=512)\n"\
142    "\n"\
143    "Wavetable synthesis.\n"
Note: See TracBrowser for help on using the repository browser.