for a school project, we were supposed to filter out 4 rogue cosine waves of a given frequency. I created a filter of my own by choosing zeroes and poles by hand. Here, I made 4 poles and 4 zeroes (and a conjugated pair to each one):
I put these zeroes in one array, all these poles into another, and by using np.poly on both of these arrays, I made the B and A coefficients of a filter. The resulting filter frequency response was what I expected:
However, this filter was not perfect enough, so I made a different one using scipy.buttord and scipy.butter. I made four separate bandstop filters, one for each rogue cosine wave. Each bandstop filter had 4 zeroes on the same place and 4 poles around the same-place zeroes (they had their conjugate parts on the other side of the unit circle) like this:
What I wanted to do next was combine these four filters into one. So what I did was concatenate the four arrays of zeroes into one, then concatenate four different arrays of poles into one. Then, using np.poly, I thought I would receive the coefficients of the resulting filter. However, the frequency response looks like this (obviously wrong):
I did some reading and I've been unable to see why this happens. If combining multiple filters like this was not possible, why did it work the first time in my handmade filter? If it is possible, why does it not work here, for the generated filter?
edit:
This is how the frequency response of a single filter looks like. The remaining three look the same, except the zero is at different frequencies.