アナログフィルタ設計
アナログフィルタ設計
| BiquadraticFilterModel | 双二次フィルタモデル |
| ButterworthFilterModel | バターワースフィルタモデル |
| Chebyshev1FilterModel | 第一種チェビシェフフィルタモデル |
| Chebyshev2FilterModel | 第二種チェビシェフフィルタモデル |
| EllipticFilterModel | 楕円フィルタモデル |
| BesselFilterModel | ベッセルフィルタモデル |
| TransferFunctionModel | アナログフィルタの伝達関数 |
| TransferFunctionExpand | 展開された伝達関数 |
| TransferFunctionFactor | 因数分解された伝達関数 |
tf = ButterworthFilterModel[2, s]//TransferFunctionExpand//ChopPlot3D[Evaluate[Abs@ButterworthFilterModel[5, s][σ + I ω][[1, 1]]], {σ, -1.5, 0.5}, {ω, -1.5, 1.5}, PlotRange -> {0, 40}, Mesh -> False, AxesLabel -> {σ, ω, None}]Manipulate[Chop@TransferFunctionExpand[filter[n, s]], {{n, 2, "filter order"}, 2, 8, 1, Appearance -> "Labeled"}, {{filter, ButterworthFilterModel}, {ButterworthFilterModel -> *"Butterworth"*, Chebyshev1FilterModel -> *"Chebyshev 1"*, Chebyshev2FilterModel -> *"Chebyshev 2"*, EllipticFilterModel -> *"elliptic"*}}]Manipulate[Plot3D[Evaluate[Abs@filter[n, s][σ + I ω][[1, 1]]], {σ, -1.5, 0.5}, {ω, -1.5, 1.5}, PlotRange -> {0, n^2.6}, Mesh -> False, AxesLabel -> {σ, ω, None}], {{n, 5, "filter order"}, 2, 8, 1, Appearance -> "Labeled"}, {{filter, ButterworthFilterModel}, {ButterworthFilterModel -> *"Butterworth"*, Chebyshev1FilterModel -> *"Chebyshev 1"*, Chebyshev2FilterModel -> *"Chebyshev 2"*, EllipticFilterModel -> *"elliptic"*}}]| TransferFunctionPoles | アナログフィルタの極を抽出する |
| TransferFunctionZeros | アナログフィルタの零点を抽出する |
poles = Flatten@TransferFunctionPoles[ButterworthFilterModel[5]]ListPlot[Transpose[{Re[poles], Im[poles]}], PlotRange -> 1.2{{-1, 1}, {-1, 1}}, PlotStyle -> {PointSize[Large]}, AxesOrigin -> {0, 0}, Epilog -> {Dashed, Pink, Circle[]}, AspectRatio -> Automatic]tf = EllipticFilterModel[5];TransferFunctionPoles[tf]//FlattenTransferFunctionZeros[tf]//Flattentf = ButterworthFilterModel[2, s]//TransferFunctionExpand//Chop;
response = (tf[I ω][[1, 1]]) ^ 2Plot[Abs[response], {ω, 0, 3}, PlotRange -> {0, 1}, Epilog -> {Dashed, Pink, Line[{{0, .5}, {1, .5}, {1, 0}}]}]BodePlot[tf, GridLines -> Automatic, PlotLayout -> "HorizontalGrid"]//GraphicsRowManipulate[First@BodePlot[filter[n, s], {0.1, 100}, PlotRange -> {{Full, {-60, 5}}, Automatic}, PlotLayout -> List, GridLines -> Automatic], {{n, 2, "filter order"}, 2, 8, 1, Appearance -> "Labeled"}, {{filter, ButterworthFilterModel}, {ButterworthFilterModel -> *"Butterworth"*, Chebyshev1FilterModel -> *"Chebyshev 1"*, Chebyshev2FilterModel -> *"Chebyshev 2"*, EllipticFilterModel -> *"elliptic"*}}]tf = ButterworthFilterModel[{2, 1}, s];
OutputResponse[tf, UnitStep[t], t]OutputResponse[tf, UnitStep[t], {t, 0, 10}]Plot[%, {t, 0, 10}]With[{tf = ButterworthFilterModel[{2, 1}, s]},
Manipulate[Plot[Evaluate[{Sin[a t], OutputResponse[tf, Sin[a t], {t, 0, 50}]}], {t, 0, 50}], {{a, 1, "frequency"}, .5, 5}]]tf = ButterworthFilterModel[{"Lowpass", {1., 3.}, {1., 20.}}];
input = (Sin[t / 5] + 1 / 2 Sin[5t]) UnitStep[t];
response1 = OutputResponse[tf, input, {t, 0, 60}];
Plot[{input, response1}, {t, 0, 50}]tf2 = ButterworthFilterModel[{"Highpass", {1., 3.}, {20., 1.}}];
response2 = OutputResponse[tf2, input, {t, 0, 60}];
Plot[{input, response2}, {t, 0, 50}]異なるタイプのフィルタを作成する
tf = ButterworthFilterModel[{"Lowpass", 2π{500, 1000}, {1., 20.}}, s];
Plot[Evaluate[Abs[tf[I ω][[1, 1]]]], {ω, 0, 15000}, PlotRange -> {0, 1}, AxesLabel -> {ω, None}, Ticks -> {{0, 5000, 10000, 15000}}, Epilog -> {Opacity[0.3], Pink, Rectangle[{0, 0}, {2π 500, 0.89}], Rectangle[{2π 1000, 0.1}, {15000, 1}]}]tf = ButterworthFilterModel[{"Highpass", 2π{500, 1000}, {20., 1.}}, s];
Plot[Evaluate[Abs[tf[I ω][[1, 1]]]], {ω, 0, 15000}, PlotRange -> {0, 1}, AxesLabel -> {ω, None}, Ticks -> {{0, 5000, 10000, 15000}}, Epilog -> {Opacity[0.3], Pink, Rectangle[{0, 1}, {2π 500, 0.1}], Rectangle[{2π 1000, 0.89}, {15000, 0}]}]tf = ButterworthFilterModel[{"Bandpass", 2π{250, 750, 1500, 1750}, {20., 1.}}, s];
Plot[Evaluate[Abs[tf[I ω][[1, 1]]]], {ω, 0, 15000}, PlotRange -> {0, 1}, AxesLabel -> {ω, None}, Ticks -> {{0, 5000, 10000, 15000}}, Epilog -> {Opacity[0.3], Pink, Rectangle[{2π 750, 0}, {2π 1500, 0.89}]}]tf = ButterworthFilterModel[{"Bandstop", 2π{250, 750, 1500, 1750}, {1., 20.}}, s];
Plot[Evaluate[Abs[tf[I ω][[1, 1]]]], {ω, 0, 15000}, PlotRange -> {0, 1}, AxesLabel -> {ω, None}, Ticks -> {{0, 5000, 10000, 15000}}, Epilog -> {Opacity[0.3], Pink, Rectangle[{2π 750, 1}, {2π 1500, 0.1}]}]フィルタタイプ間の変換
| TransferFunctionTransform | 変換関数を変換する |
With[{tf = ButterworthFilterModel[3, s]},
Manipulate[First@BodePlot[{tf, TransferFunctionTransform[type, tf]}, {0.01, 100}, GridLines -> Automatic, PlotRange -> {{Full, {-60, 5}}, Automatic}, PlotLayout -> "List"], {{type, #&}, {#& -> "Lowpass", 1 / #& -> "Highpass", (1/10)(#^2 + 1/#)& -> "Bandpass", (10 #/#^2 + 1)& -> "Bandstop"}}]]関連するテクニカルノート
-
▪
- オーディオ処理 ▪
- デジタルフィルタ設計
