* Z:\home\khalils\Downloads\files\data\raw_asc\01bdb1ffaaa0_Z_filter_4_freq_laplace_a.asc
* Generated by LTspice 26.0.1 for Windows.
* Direct Form II
* Example: 4th order Butterworth lowpass, fg=0.1*fs
* sampling frequency
* Source for step response and AC
* AC Simulation Of Sampled Systems with Z-transform\n \nInstead of the delay element z^-1, the Laplace equivalent e^-sT is used.\n \nH(z) = G1 * ( B0 + B1*z^-1 + B2*z^-2 + .... Bn*z^-n) / (1 + A1*z^^-1 + A2*z^-2 + A3*z^-3 + ... Am*z^-m) B0 = 1
* Delay with Laplace exp(-sT)
* Z
* -1
* Z
* -1
* Z
* -1
* Z
* -1
* A2
* A1
* A3
* A4
* G1
* +
* IN
* +
* +
* +
* +
* -
* B2
* B1
* B3
* B4
* +
* +
* +
* +
* B0
* +
* OUT
* sum
* Direct Form II 4th Order System
B4 z_4 0 V=V(z_3) LAPLACE(exp(-s*{TS}))
BSUM2 out 0 V=B0*V(sum) + B1*V(z_1) + B2*V(z_2) + B3*V(z_3) + B4*V(z_4)
BSUM1 sum 0 V={G1}*V(in) -(A1*V(z_1)+A2*V(z_2)+A3*V(z_3)+A4*V(z_4))
B1 z_1 0 V=V(sum) LAPLACE(exp(-s*{TS}))
V1 in 0 AC 1
B3 z_3 0 V=V(z_2) LAPLACE(exp(-s*{TS}))
B2 z_2 0 V=V(z_1) LAPLACE(exp(-s*{TS}))
.PARAM FS=10k
.PARAM TS=1/FS
.AC LIN 1000 10 {FS/2}
.PARAM G1=0.00482434336
.PARAM B0=1 B1=4 B2=6 B3=4 B4=1
.PARAM A0=1.0 A1=-2.369513 A2=2.3139884 A3=-1.0546654 A4=0.187379492
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2816 1348
WIRE 16 160 16 128
WIRE 16 240 16 288
WIRE 16 128 240 128
WIRE 944 1024 944 992
WIRE 944 912 944 864
WIRE 944 864 1024 864
WIRE 16 576 80 576
WIRE 432 576 560 576
WIRE 848 576 912 576
WIRE 848 624 848 576
WIRE 848 704 848 736
WIRE 432 624 432 576
WIRE 432 704 432 736
WIRE 16 624 16 576
WIRE 16 704 16 736
WIRE 1248 576 1312 576
WIRE 1248 624 1248 576
WIRE 1248 704 1248 736
WIRE 0 1024 0 992
WIRE 0 912 0 864
WIRE 0 864 32 864
WIRE 1568 -192 1632 -192
IOPIN 240 128 Out
IOPIN 1024 864 Out
IOPIN 80 576 Out
IOPIN 560 576 Out
IOPIN 912 576 Out
IOPIN 1312 576 Out
IOPIN 32 864 Out
LINE Normal 896 112 800 112
LINE Normal 896 112 896 112
LINE Normal 1072 112 976 112
LINE Normal 1072 112 1072 112
LINE Normal 1248 112 1152 112
LINE Normal 1376 112 1328 112
LINE Normal 848 112 848 208
LINE Normal 1024 112 1024 208
LINE Normal 1200 112 1200 208
LINE Normal 1376 112 1376 208
LINE Normal 848 304 848 272
LINE Normal 704 304 848 304
LINE Normal 1024 336 1024 272
LINE Normal 704 336 1024 336
LINE Normal 1200 368 1200 272
LINE Normal 704 368 1200 368
LINE Normal 1376 400 1376 272
LINE Normal 704 400 1376 400
LINE Normal 608 352 640 352
LINE Normal 592 352 608 352
LINE Normal 592 144 592 352
LINE Normal 720 112 672 112
LINE Normal 720 112 720 112
LINE Normal 624 112 672 112
LINE Normal 448 112 416 112
LINE Normal 448 112 448 112
LINE Normal 560 112 512 112
LINE Normal 560 112 560 112
LINE Normal 1024 -16 1024 112
LINE Normal 848 -16 848 112
LINE Normal 1200 -16 1200 112
LINE Normal 1376 -16 1376 112
LINE Normal 672 -16 672 112
LINE Normal 848 -176 848 -80
LINE Normal 848 -224 848 -176
LINE Normal 1504 -224 848 -224
LINE Normal 1024 -160 1024 -80
LINE Normal 1024 -192 1024 -160
LINE Normal 1200 -160 1200 -80
LINE Normal 1200 -160 1200 -160
LINE Normal 1376 -96 1376 -80
LINE Normal 1376 -128 1376 -96
LINE Normal 672 -160 672 -80
LINE Normal 672 -256 672 -160
LINE Normal 1504 -192 1024 -192
LINE Normal 1504 -160 1200 -160
LINE Normal 1504 -128 1376 -128
LINE Normal 1504 -256 672 -256
RECTANGLE Normal 1632 816 -80 464 2
RECTANGLE Normal 336 320 -64 32 2
RECTANGLE Normal 1152 144 1072 80
RECTANGLE Normal 1328 144 1248 80
RECTANGLE Normal 976 144 896 80
RECTANGLE Normal 800 144 720 80
RECTANGLE Normal 704 416 640 288
RECTANGLE Normal 1568 -112 1504 -272
CIRCLE Normal 1056 272 992 208
CIRCLE Normal 880 272 816 208
CIRCLE Normal 1232 272 1168 208
CIRCLE Normal 1408 272 1344 208
CIRCLE Normal 512 144 448 80
CIRCLE Normal 624 144 560 80
CIRCLE Normal 1056 -16 992 -80
CIRCLE Normal 880 -16 816 -80
CIRCLE Normal 1232 -16 1168 -80
CIRCLE Normal 1408 -16 1344 -80
CIRCLE Normal 704 -16 640 -80
SYMBOL bv 0 896 R0
SYMATTR InstName SUM1
SYMATTR Value V={G1}*V(in) -(A1*V(z_1)+A2*V(z_2)+A3*V(z_3)+A4*V(z_4))
SYMBOL bv 16 608 R0
SYMATTR InstName B1
SYMATTR Value V=V(sum)   LAPLACE(exp(-s*{TS}))
SYMBOL voltage 16 144 R0
WINDOW 123 24 132 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value2 AC 1
SYMATTR InstName V1
SYMATTR Value ""
SYMBOL bv 944 896 R0
SYMATTR InstName SUM2
SYMATTR Value V=B0*V(sum)  + B1*V(z_1) + B2*V(z_2) + B3*V(z_3) + B4*V(z_4)
SYMBOL bv 432 608 R0
SYMATTR InstName B2
SYMATTR Value V=V(z_1)   LAPLACE(exp(-s*{TS}))
SYMBOL bv 1248 608 R0
SYMATTR InstName B4
SYMATTR Value V=V(z_3)   LAPLACE(exp(-s*{TS}))
SYMBOL bv 848 608 R0
SYMATTR InstName B3
SYMATTR Value V=V(z_2)   LAPLACE(exp(-s*{TS}))
FLAG 16 288 0
FLAG 240 128 in
FLAG 944 1024 0
FLAG 1024 864 out
FLAG 80 576 z_1
FLAG 560 576 z_2
FLAG 912 576 z_3
FLAG 16 736 0
FLAG 432 736 0
FLAG 848 736 0
FLAG 1312 576 z_4
FLAG 1248 736 0
FLAG 0 1024 0
FLAG 32 864 sum
TEXT -8 -184 Left 0 !.PARAM FS=10k
TEXT -8 -152 Left 0 !.PARAM TS=1/FS
TEXT -8 -232 Left 0 !.AC LIN 1000 10 {FS/2}
TEXT -8 -360 Left 0 !.PARAM  G1=0.00482434336   \n.PARAM   B0=1  B1=4  B2=6  B3=4  B4=1\n.PARAM   A0=1.0  A1=-2.369513   A2=2.3139884 A3=-1.0546654  A4=0.187379492
TEXT -16 504 Left 0 ;Direct Form II
TEXT -8 -392 Left 0 ;Example: 4th order Butterworth lowpass, fg=0.1*fs
TEXT 224 -184 Left 0 ;sampling frequency
TEXT -24 72 Left 0 ;Source for step response and AC
TEXT -8 -568 Left 0 ;AC Simulation Of Sampled Systems with Z-transform\n \nInstead of the delay element z^-1, the Laplace equivalent  e^-sT is used.\n \nH(z) = G1 * ( B0 + B1*z^-1 + B2*z^-2  + .... Bn*z^-n) / (1 + A1*z^^-1 + A2*z^-2 + A3*z^-3 + ... Am*z^-m)    B0 = 1
TEXT 400 512 Left 0 ;Delay with Laplace exp(-sT)
TEXT 1096 120 Left 0 ;Z
TEXT 1112 104 Left 0 ;-1
TEXT 1272 120 Left 0 ;Z
TEXT 1288 104 Left 0 ;-1
TEXT 920 120 Left 0 ;Z
TEXT 936 104 Left 0 ;-1
TEXT 744 120 Left 0 ;Z
TEXT 760 104 Left 0 ;-1
TEXT 1008 240 Left 0 ;A2
TEXT 832 240 Left 0 ;A1
TEXT 1184 240 Left 0 ;A3
TEXT 1360 240 Left 0 ;A4
TEXT 464 112 Left 0 ;G1
TEXT 568 112 Left 0 ;+
TEXT 408 96 Left 0 ;IN
TEXT 688 304 Left 0 ;+
TEXT 688 336 Left 0 ;+
TEXT 688 368 Left 0 ;+
TEXT 688 400 Left 0 ;+
TEXT 592 128 Left 0 ;-
TEXT 1008 -48 Left 0 ;B2
TEXT 832 -48 Left 0 ;B1
TEXT 1184 -48 Left 0 ;B3
TEXT 1360 -48 Left 0 ;B4
TEXT 1512 -224 Left 0 ;+
TEXT 1512 -192 Left 0 ;+
TEXT 1512 -160 Left 0 ;+
TEXT 1512 -128 Left 0 ;+
TEXT 656 -48 Left 0 ;B0
TEXT 1512 -256 Left 0 ;+
TEXT 1592 -216 Left 0 ;OUT
TEXT 648 128 Left 0 ;sum
TEXT 912 -304 Left 0 ;Direct Form II  4th Order System