You haven’t initialised the class (IIR2Filter), so filter(self, v) is not being passed self; x[i] is therefore the first positional argument (self) and the second positional argument (v) is missing.