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/ext (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
7676 "";
7777
7878 static char Py_bintofreq_doc[] = ""
79−"bintofreq(float, samplerate = integer, fftsize = integer) -> float\n"
79+"bintofreq(fftbin, samplerate, fftsize)\n"
8080 "\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"
8297 "\n"
8398 "Example\n"
8499 "-------\n"
85100 "\n"
86−">>> freq = bintofreq(bin, samplerate = 44100, fftsize = 1024)";
101+">>> aubio.bintofreq(10, 44100, 1024)\n"
102+"430.6640625\n"
103+"";
87104
88105 static char Py_freqtobin_doc[] = ""
89−"freqtobin(float, samplerate = integer, fftsize = integer) -> float\n"
106+"freqtobin(freq, samplerate, fftsize)\n"
90107 "\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"
92110 "\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"
94121 "-------\n"
122+"float\n"
123+" Frequency converted to FFT bin.\n"
124+"\n"
125+"Examples\n"
126+"--------\n"
95127 "\n"
96−">>> bin = freqtobin(freq, samplerate = 44100, fftsize = 1024)";
128+">>> aubio.freqtobin(440, 44100, 1024)\n"
129+"10.216779708862305\n"
130+"";
97131
98132 static char Py_zero_crossing_rate_doc[] = ""
99133 "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