Created
October 28, 2024 07:10
-
-
Save GaryLee/3d6b84f2e72b4072ffc07e45919a5330 to your computer and use it in GitHub Desktop.
How to calculate the coefficient of low-pass filter of z-domain?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python | |
from math import pi | |
# The first-order low-pass filter has following transfer function of s-domain | |
# H(s) = a / (s + a). | |
# Its pole is s = −a, and the pole in digital filter will be z = e^−aT | |
# Therefore the H(z) is (1 - e^-aT)*z / ( z - e^-aT ) | |
FREQ_SAMPLING = 50e3 | |
TIME_SAMPLING = 1 / FREQ_SAMPLING | |
FREQ_CUTOFF = 10 # Unit: Hz. | |
# The coefficient a is | |
a = 2 * pi * FREQ_CUTOFF * TIME_SAMPLING | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment