In the case of FIR filters it is easy to get a band-pass filter by subtracting the coefficients of two low-pass filter filters or by convolving a high-pass and a low-pass filter:
import matplotlib.pyplot as plt from scipy import signal from math import pi FS = 100.0 # Sampling rate FC1 = 10/FS N = 101 # Number of filter taps a = 1 # Filter denominator b1 = signal.firwin(N, cutoff=FC1, window='hamming') # Filter numerator FC2 = 20/FS b2 = signal.firwin(N, cutoff=FC2, window='hamming') # Filter numerator h = b2-b1 w, H = signal.freqz(h) _, ax = plt.subplots(1) ax.plot(w/(2*pi), abs(H))
However, given two digital IIR filters with possibly different orders, I am not sure if it's possible to get the band-pass coefficients. Since the phase response of IIR filters is nonlinear in general, I can try to subtract the filtered outputs of the two low-pass filters, but this is rather crude. Since I haven't found a similar question on this site, so I am sorry if it doesn't make too much sense.