From 7df8df7b80670b940b4a74badfb838e2b4d52b7c Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 26 Oct 2018 18:11:36 +0200 Subject: [PATCH] [python] add docstrings to bintofreq and freqtobin --- python/ext/aubiomodule.c | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/python/ext/aubiomodule.c b/python/ext/aubiomodule.c index 01d2e9c8..d6b111ef 100644 --- a/python/ext/aubiomodule.c +++ b/python/ext/aubiomodule.c @@ -76,24 +76,58 @@ static char Py_miditobin_doc[] = "" ""; 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" +"Examples\n" +"--------\n" "\n" -">>> bin = freqtobin(freq, samplerate = 44100, fftsize = 1024)"; +">>> aubio.freqtobin(440, 44100, 1024)\n" +"10.216779708862305\n" +""; static char Py_zero_crossing_rate_doc[] = "" "zero_crossing_rate(fvec) -> float\n" -- 2.11.0