History

[python] add docstrings to bintofreq and freqtobin

Paul Brossier committed 8 years ago

Commit 7df8df71 parent 57ce9b21 file · +41 −7Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/ext/aubiomodule.c+41−7
@@ -76,24 +76,58 @@ static char Py_miditobin_doc[] = "" · 75 unmodified lines
76"";76"";
77 77
78static char Py_bintofreq_doc[] = ""78static char Py_bintofreq_doc[] = ""
79"bintofreq(float, samplerate = integer, fftsize = integer) -> float\n"79"bintofreq(fftbin, samplerate, fftsize)\n"
80"\n"80"\n"
81"Convert bin number (float) in frequency (Hz), given the sampling rate and the FFT size\n"81"Convert FFT bin to frequency in Hz, given the sampling rate\n"
82"and the size of the FFT.\n"
83"\n"
84"Parameters\n"
85"----------\n"
86"fftbin : float\n"
87" input frequency bin\n"
88"samplerate : float\n"
89" sampling rate of the signal\n"
90"fftsize : float\n"
91" size of the FFT\n"
92"\n"
93"Returns\n"
94"-------\n"
95"float\n"
96" Frequency converted to Hz.\n"
82"\n"97"\n"
83"Example\n"98"Example\n"
84"-------\n"99"-------\n"
85"\n"100"\n"
86">>> freq = bintofreq(bin, samplerate = 44100, fftsize = 1024)";101">>> aubio.bintofreq(10, 44100, 1024)\n"
102"430.6640625\n"
103"";
87 104
88static char Py_freqtobin_doc[] = ""105static char Py_freqtobin_doc[] = ""
89"freqtobin(float, samplerate = integer, fftsize = integer) -> float\n"106"freqtobin(freq, samplerate, fftsize)\n"
90"\n"107"\n"
91"Convert frequency (Hz) in bin number (float), given the sampling rate and the FFT size\n"108"Convert frequency in Hz to FFT bin, given the sampling rate\n"
109"and the size of the FFT.\n"
92"\n"110"\n"
93"Example\n"111"Parameters\n"
112"----------\n"
113"midi : float\n"
114" input frequency, in midi note\n"
115"samplerate : float\n"
116" sampling rate of the signal\n"
117"fftsize : float\n"
118" size of the FFT\n"
119"\n"
120"Returns\n"
94"-------\n"121"-------\n"
122"float\n"
123" Frequency converted to FFT bin.\n"
124"\n"
125"Examples\n"
126"--------\n"
95"\n"127"\n"
96">>> bin = freqtobin(freq, samplerate = 44100, fftsize = 1024)";128">>> aubio.freqtobin(440, 44100, 1024)\n"
129"10.216779708862305\n"
130"";
97 131
98static char Py_zero_crossing_rate_doc[] = ""132static char Py_zero_crossing_rate_doc[] = ""
99"zero_crossing_rate(fvec) -> float\n"133"zero_crossing_rate(fvec) -> float\n"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t