Changes in python/ext/aubiomodule.c [55b6260:72d08ae]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/aubiomodule.c
r55b6260 r72d08ae 11 11 12 12 static char Py_alpha_norm_doc[] = "" 13 "alpha_norm(vec, alpha)\n" 14 "\n" 15 "Compute `alpha` normalisation factor of vector `vec`.\n" 16 "\n" 17 "Parameters\n" 18 "----------\n" 19 "vec : fvec\n" 20 " input vector\n" 21 "alpha : float\n" 22 " norm factor\n" 23 "\n" 24 "Returns\n" 25 "-------\n" 26 "float\n" 27 " p-norm of the input vector, where `p=alpha`\n" 28 "\n" 29 "Example\n" 30 "-------\n" 31 "\n" 32 ">>> a = aubio.fvec(np.arange(10)); alpha = 2\n" 33 ">>> aubio.alpha_norm(a, alpha), (sum(a**alpha)/len(a))**(1./alpha)\n" 34 "(5.338539123535156, 5.338539126015656)\n" 35 "\n" 36 "Note\n" 37 "----\n" 38 "Computed as:\n" 39 "\n" 40 ".. math::\n" 41 " l_{\\alpha} = \n" 42 " \\|\\frac{\\sum_{n=0}^{N-1}{{x_n}^{\\alpha}}}{N}\\|^{1/\\alpha}\n" 43 ""; 13 "alpha_norm(fvec, integer) -> float\n" 14 "\n" 15 "Compute alpha normalisation factor on vector, given alpha\n" 16 "\n" 17 "Example\n" 18 "-------\n" 19 "\n" 20 ">>> b = alpha_norm(a, 9)"; 44 21 45 22 static char Py_bintomidi_doc[] = "" 46 "bintomidi(fftbin, samplerate, fftsize)\n" 47 "\n" 48 "Convert FFT bin to frequency in midi note, given the sampling rate\n" 49 "and the size of the FFT.\n" 50 "\n" 51 "Parameters\n" 52 "----------\n" 53 "fftbin : float\n" 54 " input frequency bin\n" 55 "samplerate : float\n" 56 " sampling rate of the signal\n" 57 "fftsize : float\n" 58 " size of the FFT\n" 59 "\n" 60 "Returns\n" 61 "-------\n" 62 "float\n" 63 " Frequency converted to midi note.\n" 64 "\n" 65 "Example\n" 66 "-------\n" 67 "\n" 68 ">>> aubio.bintomidi(10, 44100, 1024)\n" 69 "68.62871551513672\n" 70 ""; 23 "bintomidi(float, samplerate = integer, fftsize = integer) -> float\n" 24 "\n" 25 "Convert bin (float) to midi (float), given the sampling rate and the FFT size\n" 26 "\n" 27 "Example\n" 28 "-------\n" 29 "\n" 30 ">>> midi = bintomidi(float, samplerate = 44100, fftsize = 1024)"; 71 31 72 32 static char Py_miditobin_doc[] = "" 73 "miditobin(midi, samplerate, fftsize)\n" 74 "\n" 75 "Convert frequency in midi note to FFT bin, given the sampling rate\n" 76 "and the size of the FFT.\n" 77 "\n" 78 "Parameters\n" 79 "----------\n" 80 "midi : float\n" 81 " input frequency, in midi note\n" 82 "samplerate : float\n" 83 " sampling rate of the signal\n" 84 "fftsize : float\n" 85 " size of the FFT\n" 86 "\n" 87 "Returns\n" 88 "-------\n" 89 "float\n" 90 " Frequency converted to FFT bin.\n" 91 "\n" 92 "Examples\n" 93 "--------\n" 94 "\n" 95 ">>> aubio.miditobin(69, 44100, 1024)\n" 96 "10.216779708862305\n" 97 ">>> aubio.miditobin(75.08, 32000, 512)\n" 98 "10.002175331115723\n" 99 ""; 33 "miditobin(float, samplerate = integer, fftsize = integer) -> float\n" 34 "\n" 35 "Convert midi (float) to bin (float), given the sampling rate and the FFT size\n" 36 "\n" 37 "Example\n" 38 "-------\n" 39 "\n" 40 ">>> bin = miditobin(midi, samplerate = 44100, fftsize = 1024)"; 100 41 101 42 static char Py_bintofreq_doc[] = "" 102 "bintofreq(fftbin, samplerate, fftsize)\n" 103 "\n" 104 "Convert FFT bin to frequency in Hz, given the sampling rate\n" 105 "and the size of the FFT.\n" 106 "\n" 107 "Parameters\n" 108 "----------\n" 109 "fftbin : float\n" 110 " input frequency bin\n" 111 "samplerate : float\n" 112 " sampling rate of the signal\n" 113 "fftsize : float\n" 114 " size of the FFT\n" 115 "\n" 116 "Returns\n" 117 "-------\n" 118 "float\n" 119 " Frequency converted to Hz.\n" 120 "\n" 121 "Example\n" 122 "-------\n" 123 "\n" 124 ">>> aubio.bintofreq(10, 44100, 1024)\n" 125 "430.6640625\n" 126 ""; 43 "bintofreq(float, samplerate = integer, fftsize = integer) -> float\n" 44 "\n" 45 "Convert bin number (float) in frequency (Hz), given the sampling rate and the FFT size\n" 46 "\n" 47 "Example\n" 48 "-------\n" 49 "\n" 50 ">>> freq = bintofreq(bin, samplerate = 44100, fftsize = 1024)"; 127 51 128 52 static char Py_freqtobin_doc[] = "" 129 "freqtobin(freq, samplerate, fftsize)\n" 130 "\n" 131 "Convert frequency in Hz to FFT bin, given the sampling rate\n" 132 "and the size of the FFT.\n" 133 "\n" 134 "Parameters\n" 135 "----------\n" 136 "midi : float\n" 137 " input frequency, in midi note\n" 138 "samplerate : float\n" 139 " sampling rate of the signal\n" 140 "fftsize : float\n" 141 " size of the FFT\n" 142 "\n" 143 "Returns\n" 144 "-------\n" 145 "float\n" 146 " Frequency converted to FFT bin.\n" 147 "\n" 148 "Examples\n" 149 "--------\n" 150 "\n" 151 ">>> aubio.freqtobin(440, 44100, 1024)\n" 152 "10.216779708862305\n" 153 ""; 53 "freqtobin(float, samplerate = integer, fftsize = integer) -> float\n" 54 "\n" 55 "Convert frequency (Hz) in bin number (float), given the sampling rate and the FFT size\n" 56 "\n" 57 "Example\n" 58 "-------\n" 59 "\n" 60 ">>> bin = freqtobin(freq, samplerate = 44100, fftsize = 1024)"; 154 61 155 62 static char Py_zero_crossing_rate_doc[] = "" 156 "zero_crossing_rate(vec)\n" 157 "\n" 158 "Compute zero-crossing rate of `vec`.\n" 159 "\n" 160 "Parameters\n" 161 "----------\n" 162 "vec : fvec\n" 163 " input vector\n" 164 "\n" 165 "Returns\n" 166 "-------\n" 167 "float\n" 168 " Zero-crossing rate.\n" 169 "\n" 170 "Example\n" 171 "-------\n" 172 "\n" 173 ">>> a = np.linspace(-1., 1., 1000, dtype=aubio.float_type)\n" 174 ">>> aubio.zero_crossing_rate(a), 1/1000\n" 175 "(0.0010000000474974513, 0.001)\n" 176 ""; 63 "zero_crossing_rate(fvec) -> float\n" 64 "\n" 65 "Compute Zero crossing rate of a vector\n" 66 "\n" 67 "Example\n" 68 "-------\n" 69 "\n" 70 ">>> z = zero_crossing_rate(a)"; 177 71 178 72 static char Py_min_removal_doc[] = "" 179 "min_removal(vec)\n" 180 "\n" 181 "Remove the minimum value of a vector to each of its element.\n" 182 "\n" 183 "Modifies the input vector in-place and returns a reference to it.\n" 184 "\n" 185 "Parameters\n" 186 "----------\n" 187 "vec : fvec\n" 188 " input vector\n" 189 "\n" 190 "Returns\n" 191 "-------\n" 192 "fvec\n" 193 " modified input vector\n" 194 "\n" 195 "Example\n" 196 "-------\n" 197 "\n" 198 ">>> aubio.min_removal(aubio.fvec(np.arange(1,4)))\n" 199 "array([0., 1., 2.], dtype=" AUBIO_NPY_SMPL_STR ")\n" 200 ""; 73 "min_removal(fvec) -> float\n" 74 "\n" 75 "Remove the minimum value of a vector, in-place modification\n" 76 "\n" 77 "Example\n" 78 "-------\n" 79 "\n" 80 ">>> min_removal(a)"; 201 81 202 82 extern void add_ufuncs ( PyObject *m ); … … 238 118 smpl_t output; 239 119 240 if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR , &input, &samplerate, &fftsize)) { 120 if (!PyArg_ParseTuple (args, 121 "" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, 122 &input, &samplerate, &fftsize)) { 241 123 return NULL; 242 124 } … … 253 135 smpl_t output; 254 136 255 if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR , &input, &samplerate, &fftsize)) { 137 if (!PyArg_ParseTuple (args, 138 "" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, 139 &input, &samplerate, &fftsize)) { 256 140 return NULL; 257 141 } … … 268 152 smpl_t output; 269 153 270 if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, &input, &samplerate, &fftsize)) { 154 if (!PyArg_ParseTuple (args, 155 "" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, 156 &input, &samplerate, &fftsize)) { 271 157 return NULL; 272 158 } … … 283 169 smpl_t output; 284 170 285 if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, &input, &samplerate, &fftsize)) { 171 if (!PyArg_ParseTuple (args, 172 "" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, 173 &input, &samplerate, &fftsize)) { 286 174 return NULL; 287 175 }
Note: See TracChangeset
for help on using the changeset viewer.