|
发表于 2024-3-28 15:59:03
|
显示全部楼层
swcap5.sp fifth order elliptic switched capacitor filter.
*.options post
.global phi1 phi2
.tran 2u 3.2m
.probe v(out) v(in) v(phi1) v(phi2)
iin 0 in sin(0,1ma,500hz)
*iin 0 in sin(0,1v,2khz)
vphi1 phi1 0 pulse(0,2 00u,.5u,.5u,7u,20u)
vphi2 phi2 0 pulse(0,2 10u,.5u,.5u,7u,20u)
rsrc in 0 1k
rload out 0 1k
xsh in out1 sh
xlin out1 out2 linear
xhq out2 out3 hqbiq
xlq out3 out lqbiq
* sample and hold
.subckt sh in out
gs1 in 1 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
eop1 out 0 opamp 1 out
ch 1 0 1.0pf
.ends
* linear section
.subckt linear in out
gs1 in 1 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
gs2 1 0 vcr pwl(1) phi2 0 0.5v,100meg 1.0v,1.0
cs 1 2 1.0pf
gs3 2 0 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
gs4 2 3 vcr pwl(1) phi2 0 0.5v,100meg 1.0v,1.0
eop1 out 0 opamp 0 3
ce out 3 9.6725pf
gs5 out 4 vcr pwl(1) phi2 0 0.5v,100meg 1.0v,1.0
gs6 4 0 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
cd 4 2 1.0pf
csh in 3 0.5pf
.ends
* high_q biquad section
.subckt hqbiq in out
gs1 in 1 vcr pwl(1) phi2 0 0.5v,100meg 1.0v,1.0
gs2 1 0 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
c1 1 2 0.5pf
gs3 2 0 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
gs4 2 3 vcr pwl(1) phi2 0 0.5v,100meg 1.0v,1.0
eop1 4 0 opamp 0 3
ca 3 4 7.072pf
gs5 4 5 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
gs6 5 0 vcr pwl(1) phi2 0 0.5v,100meg 1.0v,1.0
c3 5 6 0.59075pf
gs7 6 7 vcr pwl(1) phi2 0 0.5v,100meg 1.0v,1.0
gs8 6 0 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
eop2 out 0 opamp 0 7
cb 7 out 4.3733pf
gs9 out 8 vcr pwl(1) phi2 0 0.5v,100meg 1.0v,1.0
gs10 8 0 vcr pwl(1) phi1 0 0.5v,100meg 1.0v,1.0
c4 out 3 1.6518pf
c2 8 2 0.9963pf
c11 7 in 0.5pf
.ends
* low_q biquad section
.subckt lqbiq in out
gs1 in 1 pwl(1) phi2 0 level=1 0.5v,100meg 1.0v,1.0
gs2 1 2 pwl(1) phi2 0 level=1 0.5v,100meg 1.0v,1.0
c1 2 3 0.9963pf
gs3 2 0 pwl(1) phi1 0 level=1 0.5v,100meg 1.0v,1.0
gs4 3 0 pwl(1) phi1 0 level=1 0.5v,100meg 1.0v,1.0
gs5 3 4 pwl(1) phi2 0 level=1 0.5v,100meg 1.0v,1.0
ca 4 5 8.833pf
eop1 5 0 0 4 level=1
gs6 5 6 pwl(1) phi1 0 level=1 0.5v,100meg 1.0v,1.0
gs7 6 0 pwl(1) phi2 0 level=1 0.5v,100meg 1.0v,1.0
c3 6 7 1.0558pf
gs8 7 8 pwl(1) phi2 0 level=1 0.5v,100meg 1.0v,1.0
gs9 7 0 pwl(1) phi1 0 level=1 0.5v,100meg 1.0v,1.0
eop2 9 0 0 8 level=1
cb 8 9 3.8643pf
gs10 9 10 pwl(1) phi2 0 level=1 0.5v,100meg 1.0v,1.0
gs11 10 0 pwl(1) phi1 0 level=1 0.5v,100meg 1.0v,1.0
c4 10 7 0.5pf
c2 10 3 0.5pf
c11 8 1 3.15425pf
gs12 9 out pwl(1) phi2 0 level=1 0.5v,100meg 1.0v,1.0
.ends
.end
看这个 |
|