(Local) In[1]:=
settings=<|"ωc"2Pi*100,"ϵ"0.1|>
(Local) Out[1]=
ωc200π,ϵ0.1
Second kind Chebyshev filter transfer function
Second kind Chebyshev filter transfer function
Low pass
Low pass
(Local) In[2]:=
p
(Local) In[17]:=
a[ωc_,ϵ_,n_]:=Abs[Product[I*ωc-[ωc,ϵ,n,k],{k,0,n-1}]]
p
(Local) In[18]:=
ϕ[ωc_,ϵ_,n_,s_]:=Sqrt[1+ϵ^2]*Product[-ωc^2/s-[ωc,ϵ,n,k],{k,0,n-1}]/a[ωc,ϵ,n]
p
(Local) In[19]:=
ϕ[settings[["ωc"]],settings[["ϵ"]],5,s]
(Local) Out[19]=
1.63388×(-399.757+0.)-(-323.41-437.728)-(-323.41+437.728)-(-123.532-708.259)-(-123.532+708.259)-
-14
10
40000
2
π
s
40000
2
π
s
40000
2
π
s
40000
2
π
s
40000
2
π
s
(Local) In[7]:=
ϕ[settings[["ωc"]],settings[["ϵ"]],5,I*settings[["ωc"]]]
(Local) Out[7]=
0.843037-0.547073
(Local) In[8]:=
q[ωc_,n_,k_]:=Cos[Pi(2k+1)/(2n)]/(I*ωc)
(Local) In[20]:=
b[ωc_,n_]:=((-1)^n)*Abs[Product[1/(I*ωc)-q[ωc,n,k],{k,0,n-1}]]
(Local) In[21]:=
ψ[ωc_,ϵ_,n_,s_]:=ϵ*Product[1/s-q[ωc,n,k],{k,0,n-1}]/b[ωc,n]
(Local) In[22]:=
ψ[settings[["ωc"]],settings[["ϵ"]],5,s]
(Local) Out[22]=
-
1.56682×-++-++
14
10
-
5
8
5
8
200π
1
s
-
5
8
5
8
200π
1
s
+
5
8
5
8
200π
1
s
+
5
8
5
8
200π
1
s
s
(Local) In[23]:=
ψ[settings[["ωc"]],settings[["ϵ"]],5,I*settings[["ωc"]]]
(Local) Out[23]=
0.+0.1
(Local) In[24]:=
H[ωc_,ϵ_,n_,s_]:=ψ[ωc,ϵ,n,s]/ϕ[ωc,ϵ,n,s]
(Local) In[25]:=
Simplify[H[settings[["ωc"]],settings[["ϵ"]],5,s]]
(Local) Out[25]=
((93648.+0.)+(0.296517+0.)+1.87771×)/(93648.+(306.868+0.)s+(0.799294-8.56052×)+(0.00121219+5.82107×)+(1.21832×+6.77214×)+(5.97695×+0.))
2
s
-7
10
4
s
-18
10
2
s
-20
10
3
s
-6
10
-23
10
4
s
-10
10
5
s
(Local) In[14]:=
Plot[{Abs[H[settings[["ωc"]],settings[["ϵ"]],4,I*ω]],Abs[H[settings[["ωc"]],settings[["ϵ"]],5,I*ω]],Abs[H[settings[["ωc"]],settings[["ϵ"]],6,I*ω]],Abs[H[settings[["ωc"]],settings[["ϵ"]],7,I*ω]]},{ω,0,3*settings[["ωc"]]},PlotRangeFull,PlotLegends{"n=4","n=5","n=6","n=7"},PlotLabel"Gain spec (ωc="<>ToString[settings[["ωc"]]]<>",ϵ="<>ToString[settings[["ϵ"]]]<>")"]
(Local) Out[14]=
(Local) In[15]:=
Plot[{Arg[H[settings[["ωc"]],settings[["ϵ"]],4,I*ω]],Arg[H[settings[["ωc"]],settings[["ϵ"]],5,I*ω]],Arg[H[settings[["ωc"]],settings[["ϵ"]],6,I*ω]],Arg[H[settings[["ωc"]],settings[["ϵ"]],7,I*ω]]},{ω,0,3*settings[["ωc"]]},PlotRangeFull,PlotLegends{"n=4","n=5","n=6","n=7"},PlotLabel"Phase spec (ωc="<>ToString[settings[["ωc"]]]<>",ϵ="<>ToString[settings[["ϵ"]]]<>")"]
(Local) Out[15]=
High pass
High pass
(Local) In[16]:=
p[ωc_,ϵ_,n_,k_]:=-ωc*Sinh[ArcSinh[1/ϵ]/n]Sin[Pi(2k+1)/(2n)]+I*ωc*Cosh[ArcSinh[1/ϵ]/n]*Cos[Pi(2k+1)/(2n)]
(Local) In[27]:=
a2[ωc_,ϵ_,n_]:=Abs[Product[I*ωc-p[ωc,ϵ,n,k],{k,0,n-1}]]
(Local) In[28]:=
ϕ2[ωc_,ϵ_,n_,s_]:=Sqrt[1+ϵ^2]*Product[s-p[ωc,ϵ,n,k],{k,0,n-1}]/a2[ωc,ϵ,n]
(Local) In[29]:=
ψ2[ωc_,ϵ_,n_,s_]:=ϵ*Product[-s/ωc^2-q[ωc,n,k],{k,0,n-1}]/b[ωc,n]
(Local) In[30]:=
H2[ωc_,ϵ_,n_,s_]:=ψ2[ωc,ϵ,n,s]/ϕ2[ωc,ϵ,n,s]
(Local) In[31]:=
Simplify[H2[settings[["ωc"]],settings[["ϵ"]],5,s]]
(Local) Out[31]=
((0.+0.)+(4.87045×+0.)s+(493480.+0.)+1.)/((6.12039×+0.)+(3.1601×+0.)s+(7.96437×+5.81722×)+(1.33023×+1.45519×)+(1293.64+0.)+)
10
10
3
s
5
s
13
10
11
10
8
10
-9
10
2
s
6
10
-11
10
3
s
4
s
5
s
(Local) In[32]:=
Plot[{Abs[H2[settings[["ωc"]],settings[["ϵ"]],4,I*ω]],Abs[H2[settings[["ωc"]],settings[["ϵ"]],5,I*ω]],Abs[H2[settings[["ωc"]],settings[["ϵ"]],6,I*ω]],Abs[H2[settings[["ωc"]],settings[["ϵ"]],7,I*ω]]},{ω,0,3*settings[["ωc"]]},PlotRangeFull,PlotLegends{"n=4","n=5","n=6","n=7"},PlotLabel"Gain spec (ωc="<>ToString[settings[["ωc"]]]<>",ϵ="<>ToString[settings[["ϵ"]]]<>")"]
(Local) Out[32]=
(Local) In[33]:=
Plot[{Arg[H2[settings[["ωc"]],settings[["ϵ"]],4,I*ω]],Arg[H2[settings[["ωc"]],settings[["ϵ"]],5,I*ω]],Arg[H2[settings[["ωc"]],settings[["ϵ"]],6,I*ω]],Arg[H2[settings[["ωc"]],settings[["ϵ"]],7,I*ω]]},{ω,0,3*settings[["ωc"]]},PlotRangeFull,PlotLegends{"n=4","n=5","n=6","n=7"},PlotLabel"Phase spec (ωc="<>ToString[settings[["ωc"]]]<>",ϵ="<>ToString[settings[["ϵ"]]]<>")"]