# Filter response is changed according to its order

I want to build a band-reject filter for the 60 Hz noise. So, I tried to use Butterworth filter to implement this specification. However, when I chose an order of 8, I got the following response, which makes sense.

However when I chose an order of 30. I got this weird response. Why is that?

The code to get the coefficient for the 8 and 30 order respectively is shown below

# fs = 200 b, a = signal.butter(8, [58 / (fs / 2), 62 / (fs / 2)], btype='bandstop') b, a = signal.butter(30, [58 / (fs / 2), 62 / (fs / 2)], btype='bandstop')

• Using a Butterworth design really only makes sense if you're planning to implement it in analog. And you won't be building a 30th order filter in discrete analog components. Not only because you couldn't even get the components with tolerances small enough that would allow for such high order to work, but also simply because that is going to be a hell of a schematic to design, lay out, fabricate, test and measure as well as to tune. – Marcus Müller Nov 4 '17 at 6:00

Your a coefficients correspond to an order 30 polynomial with the 30 roots corresponding to the poles of the filter.