Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _coeffsBA(f, samplerate):
- """ return 12db/oct low pass biquad coeffs for given frequency """
- w0 = 2 * pi * f / samplerate
- alpha = sin(w0) / 2 / 0.7071067811865476 # Butterworth characteristic, Q = 0.707...
- cs = cos(w0)
- norm = 1 / (1 + alpha)
- b0 = (1 - cs) / 2 * norm
- b1 = (1 - cs) * norm
- b2 = b0
- a1 = -2 * cs * norm
- a2 = (1 - alpha) * norm
- return (b0, b1, b2), (1, a1, a2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement