ref: 7df8df7b80670b940b4a74badfb838e2b4d52b7c
parent: 57ce9b2f6228bca21c1274137d100dc11bc199d3
author: Paul Brossier <piem@piem.org>
date: Fri Oct 26 14:11:36 EDT 2018
[python] add docstrings to bintofreq and freqtobin
--- a/python/ext/aubiomodule.c
+++ b/python/ext/aubiomodule.c
@@ -76,24 +76,58 @@
"";
static char Py_bintofreq_doc[] = ""
-"bintofreq(float, samplerate = integer, fftsize = integer) -> float\n"
+"bintofreq(fftbin, samplerate, fftsize)\n"
"\n"
-"Convert bin number (float) in frequency (Hz), given the sampling rate and the FFT size\n"
+"Convert FFT bin to frequency in Hz, given the sampling rate\n"
+"and the size of the FFT.\n"
"\n"
+"Parameters\n"
+"----------\n"
+"fftbin : float\n"
+" input frequency bin\n"
+"samplerate : float\n"
+" sampling rate of the signal\n"
+"fftsize : float\n"
+" size of the FFT\n"
+"\n"
+"Returns\n"
+"-------\n"
+"float\n"
+" Frequency converted to Hz.\n"
+"\n"
"Example\n"
"-------\n"
"\n"
-">>> freq = bintofreq(bin, samplerate = 44100, fftsize = 1024)";
+">>> aubio.bintofreq(10, 44100, 1024)\n"
+"430.6640625\n"
+"";
static char Py_freqtobin_doc[] = ""
-"freqtobin(float, samplerate = integer, fftsize = integer) -> float\n"
+"freqtobin(freq, samplerate, fftsize)\n"
"\n"
-"Convert frequency (Hz) in bin number (float), given the sampling rate and the FFT size\n"
+"Convert frequency in Hz to FFT bin, given the sampling rate\n"
+"and the size of the FFT.\n"
"\n"
-"Example\n"
+"Parameters\n"
+"----------\n"
+"midi : float\n"
+" input frequency, in midi note\n"
+"samplerate : float\n"
+" sampling rate of the signal\n"
+"fftsize : float\n"
+" size of the FFT\n"
+"\n"
+"Returns\n"
"-------\n"
+"float\n"
+" Frequency converted to FFT bin.\n"
"\n"
-">>> bin = freqtobin(freq, samplerate = 44100, fftsize = 1024)";
+"Examples\n"
+"--------\n"
+"\n"
+">>> aubio.freqtobin(440, 44100, 1024)\n"
+"10.216779708862305\n"
+"";
static char Py_zero_crossing_rate_doc[] = ""
"zero_crossing_rate(fvec) -> float\n"