};
static PyMethodDef Py_filter_methods[] = {
- {"set_c_weighting", (PyCFunction) Py_filter_set_c_weighting, METH_NOARGS,
+ {"set_c_weighting", (PyCFunction) Py_filter_set_c_weighting, METH_VARARGS,
"set filter coefficients to C-weighting"},
- {"set_a_weighting", (PyCFunction) Py_filter_set_a_weighting, METH_NOARGS,
+ {"set_a_weighting", (PyCFunction) Py_filter_set_a_weighting, METH_VARARGS,
"set filter coefficients to A-weighting"},
{NULL}
};
f(fvec())
def test_cweighting_error(self):
- f = digital_filter (44100, 2, 1)
- self.assertRaises ( ValueError, f.set_c_weighting )
- f = digital_filter (44100, 8, 1)
- self.assertRaises ( ValueError, f.set_c_weighting )
- f = digital_filter (4000, 5, 1)
- self.assertRaises ( ValueError, f.set_c_weighting )
- f = digital_filter (193000, 5, 1)
- self.assertRaises ( ValueError, f.set_c_weighting )
- f = digital_filter (193000, 7, 1)
- self.assertRaises ( ValueError, f.set_a_weighting )
- f = digital_filter (192000, 5, 1)
- self.assertRaises ( ValueError, f.set_a_weighting )
+ f = digital_filter (2, 1)
+ self.assertRaises ( ValueError, f.set_c_weighting, 44100 )
+ f = digital_filter (8, 1)
+ self.assertRaises ( ValueError, f.set_c_weighting, 44100 )
+ f = digital_filter (5, 1)
+ self.assertRaises ( ValueError, f.set_c_weighting, 4000 )
+ f = digital_filter (5, 1)
+ self.assertRaises ( ValueError, f.set_c_weighting, 193000 )
+ f = digital_filter (7, 1)
+ self.assertRaises ( ValueError, f.set_a_weighting, 193000 )
+ f = digital_filter (5, 1)
+ self.assertRaises ( ValueError, f.set_a_weighting, 192000 )
def test_c_weighting(self):
expected = array_from_text_file('c_weighting_test_simple.expected')