Changeset 1030a7b for python


Ignore:
Timestamp:
Dec 4, 2018, 2:14:34 AM (8 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
6342fd1
Parents:
e5efa0f
Message:

[py] add docstrings for digital_filter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-filter.c

    re5efa0f r1030a7b  
    1111} Py_filter;
    1212
    13 static char Py_filter_doc[] = "filter object";
     13static char Py_filter_doc[] = ""
     14"digital_filter(order=7)\n"
     15"\n"
     16"Create a digital filter.\n"
     17"";
     18
     19static char Py_filter_set_c_weighting_doc[] = ""
     20"set_c_weighting(samplerate)\n"
     21"\n"
     22"Set filter coefficients to C-weighting.\n"
     23"\n"
     24"`samplerate` should be one of 8000, 11025, 16000, 22050, 24000, 32000,\n"
     25"44100, 48000, 88200, 96000, or 192000. `order` of the filter should be 5.\n"
     26"\n"
     27"Parameters\n"
     28"----------\n"
     29"samplerate : int\n"
     30"    Sampling-rate of the input signal, in Hz.\n"
     31"";
     32
     33static char Py_filter_set_a_weighting_doc[] = ""
     34"set_a_weighting(samplerate)\n"
     35"\n"
     36"Set filter coefficients to A-weighting.\n"
     37"\n"
     38"`samplerate` should be one of 8000, 11025, 16000, 22050, 24000, 32000,\n"
     39"44100, 48000, 88200, 96000, or 192000. `order` of the filter should be 7.\n"
     40"\n"
     41"Parameters\n"
     42"----------\n"
     43"samplerate : int\n"
     44"    Sampling-rate of the input signal.\n"
     45"";
     46
     47static char Py_filter_set_biquad_doc[] = ""
     48"set_biquad(b0, b1, b2, a1, a2)\n"
     49"\n"
     50"Set biquad coefficients. `order` of the filter should be 3.\n"
     51"\n"
     52"Parameters\n"
     53"----------\n"
     54"b0 : float\n"
     55"    Forward filter coefficient.\n"
     56"b1 : float\n"
     57"    Forward filter coefficient.\n"
     58"b2 : float\n"
     59"    Forward filter coefficient.\n"
     60"a1 : float\n"
     61"    Feedback filter coefficient.\n"
     62"a2 : float\n"
     63"    Feedback filter coefficient.\n"
     64"";
    1465
    1566static PyObject *
     
    157208static PyMethodDef Py_filter_methods[] = {
    158209  {"set_c_weighting", (PyCFunction) Py_filter_set_c_weighting, METH_VARARGS,
    159       "set filter coefficients to C-weighting"},
     210      Py_filter_set_c_weighting_doc},
    160211  {"set_a_weighting", (PyCFunction) Py_filter_set_a_weighting, METH_VARARGS,
    161       "set filter coefficients to A-weighting"},
     212      Py_filter_set_a_weighting_doc},
    162213  {"set_biquad", (PyCFunction) Py_filter_set_biquad, METH_VARARGS,
    163       "set b0, b1, b2, a1, a2 biquad coefficients"},
     214      Py_filter_set_biquad_doc},
    164215  {NULL}
    165216};
Note: See TracChangeset for help on using the changeset viewer.