Professional Documents
Culture Documents
Mathcad - Butterworth NG
Mathcad - Butterworth NG
1
Tbw2( s) :=
2 Two Pole Butterworth filter
s + 2⋅ s + 1
ω ω
c c
1
Tp1( s) :=
s Single pole low pass filter
+1
ωc
1
Tp2( s) :=
2 Two pole low pass filter
s + 2⋅ s + 1
ω ω
c c
n
−2
64
n := 0 .. 256 hz := 10
n
( (
arg Tbw2 2 ⋅ π ⋅ j ⋅ hz ))
( ( ))
n
M bw2 := 20⋅ log Tbw2 2 ⋅ π j ⋅ hz Φ bw2 :=
n n n deg
( (
M p1 := 20⋅ log Tp1 2 ⋅ π j ⋅ hz
n ))
n Φ p1 :=
( (
arg Tp1 2 ⋅ π ⋅ j ⋅ hz
n ))
n deg
( (
M p2 := 20⋅ log Tp2 2 ⋅ π j ⋅ hz
n ))
n Φ p2 :=
( (
arg Tp2 2 ⋅ π ⋅ j ⋅ hz
n ))
n deg
Magnitude
0
20
Magnitude
40
60
0.01 0.1 1 10 100
Frequency
2 Pole Butterworth
1 Pole Low Pass
2 Pole Low Pass
Phase
0
9
18
27
36
45
54
63
72
81
Phase
90
99
108
117
126
135
144
153
162
171
180
0.01 0.1 1 10 100
Frequency
2 Pole Butterworth
1 Pole Low Pass
2 Pole Low Pass
The coefficients below were computes using matched z transforms, MZT, Euler's identity,and a
lot of substitution and simplification. The MZT technique does not introduce zeros in the z
domain or require frequency warping.
− 2⋅ ω c⋅ Τ ⋅ ζ
A2 := e A2 = 0.4112407014427743
− ω c⋅ Τ ⋅ ζ
A1 := −2 ⋅ e (
⋅ cos ζ ⋅ ωc⋅ Τ ) A1 = −1.1580458998309644
− ω c⋅ Τ ⋅ ζ − 2⋅ ω c⋅ Τ ⋅ ζ
B 0 := 1 − 2 ⋅ e ( )
⋅ cos ωc⋅ Τ ⋅ ζ + e B 0 = 0.2531948016118099
Butterworth
2
1
Input and Output
2
0 0.5 1 1.5 2
Time
Input
Output
2 ωc⋅ Τ
Perform frequency warping w := ⋅ tan w = 32.49196962329063
Τ 2
z−1
⋅
2
Tustin's approximation is . When the filter expressed as a
Τ z + 1
2 1
normalized filter the can also be combined with the term to yield
Τ w
ωc⋅ Τ z − 1 ωc⋅ Τ z−1
cot ⋅ . The cot should be pre calculated so c⋅
2 z + 1 2 z + 1
can be substituted for s.
ωc⋅ Τ
c := cot
2 c = 3.077683537175253
z−1
substitute , s = c⋅
z+1
1 1
H( z) = expand → H( z) =
2 2
1+ 2⋅ s + s float , 6 z − 1. ( z − 1.)
1. + 4.35250 ⋅ + 9.47218 ⋅
implicit z + 1. 2
( z + 1.)
2
z + 2⋅ z + 1
H( z) =
1 1 Simplify
2 2 2 2 2 2 2 2
z + 2 ⋅ z + 1 + 2 ⋅ c⋅ z − 2 ⋅ c + c ⋅ z − 2 ⋅ c ⋅ z + c
2
z + 2⋅ z + 1
H( z) =
Collect in powers of z.
1 1
2 2
2 2 ( 2
1 + c + 2 ⋅ c ⋅ z + 2 − 2 ⋅ c ⋅ z − 2 ⋅ c + 1 + c)2
1
2 2
−2 ⋅ c + 1 + c
A2 := A2 = 0.4128015980961886
1
2 2
1 + c + 2 ⋅c
1
B 0 := B 0 = 0.06745527388907192
1
2 2
1 + c + 2 ⋅c
2
B 1 := B 1 = 0.13491054777814385
1
2 2
1 + c + 2 ⋅c
1
B 2 := B 2 = 0.06745527388907192
1
2 2
1 + c + 2 ⋅c
−A1 − A2 + B0 + B 1 + B2 = 1
n := 0 .. 1 y := 0 Initialize
n
2
n := 2 .. Simulate for .1 seconds.
Τ
Butterworth
2
1
Output
2
0 0.5 1 1.5 2
Time
Input
Output