def sosfreqz(sos, ws = None): if ws is None: H = [1] * 512 else: H = [1] * len(ws) for i in range(len(sos)): w, h = freqz(sos[i,:3], sos[i, 3:], worN = ws) H *= h return w, H