sos
2 次セクションへの変換
説明
例
IIR 離散時間フィルター オブジェクトを、対応する SOS セクションをもつ SOS フィルター オブジェクトに変換します。
関数 butter を使用して、10 次のローパス バタワース フィルターを設計します。
N = 10; Fc = 0.4; [b,a] = butter(N,Fc);
dsp.IIRFilter オブジェクトを作成し、設計した係数をオブジェクトの Numerator および Denominator プロパティに割り当てます。
iir = dsp.IIRFilter(Numerator=b,Denominator=a)
iir =
dsp.IIRFilter with properties:
Structure: 'Direct form II transposed'
Numerator: [4.9945e-04 0.0050 0.0225 0.0599 0.1049 0.1259 0.1049 0.0599 0.0225 0.0050 4.9945e-04]
Denominator: [1 -1.9924 3.0195 -2.8185 2.0387 -1.0545 0.4144 -0.1157 0.0225 -0.0027 1.4876e-04]
InitialConditions: 0
Show all properties
関数 sos を使用して、IIR フィルター オブジェクトを、対応する SOS セクションをもつ SOS フィルターに変換します。
sosFilt = sos(iir)
sosFilt =
dsp.SOSFilter with properties:
Structure: 'Direct form II transposed'
CoefficientSource: 'Property'
Numerator: [5×3 double]
Denominator: [5×3 double]
HasScaleValues: true
ScaleValues: [4.9945e-04 1 1 1 1 1]
Show all properties
SOS フィルター オブジェクトから SOS 行列とスケール値を取得できます。
sMatrix = [sosFilt.Numerator,sosFilt.Denominator]
sMatrix = 5×6
1.0000 2.0958 1.0984 1.0000 -0.3187 0.0313
1.0000 2.0576 1.0602 1.0000 -0.3345 0.0826
1.0000 1.9981 1.0005 1.0000 -0.3695 0.1958
1.0000 1.9412 0.9436 1.0000 -0.4317 0.3969
1.0000 1.9073 0.9097 1.0000 -0.5380 0.7410
sValues = sosFilt.ScaleValues
sValues = 1×6
0.0005 1.0000 1.0000 1.0000 1.0000 1.0000
これらの値を、関数tf2sosを使用して取得した値と比較し、値が同じであることを確認します。
[sMatrixfn,g] = tf2sos(b,a)
sMatrixfn = 5×6
1.0000 2.0958 1.0984 1.0000 -0.3187 0.0313
1.0000 2.0576 1.0602 1.0000 -0.3345 0.0826
1.0000 1.9981 1.0005 1.0000 -0.3695 0.1958
1.0000 1.9412 0.9436 1.0000 -0.4317 0.3969
1.0000 1.9073 0.9097 1.0000 -0.5380 0.7410
g = 4.9945e-04
isequal(sMatrix,sMatrixfn)
ans = logical
1
isequal(sValues(1),g)
ans = logical
1
入力引数
IIR 離散時間フィルター オブジェクト。dsp.IIRFilter System object として指定します。
極の方向フラグ。以下のいずれかとして指定します。
'up'–– 第 1 行には原点に最も近い極が含まれ、最後の行には単位円に最も近い極が含まれます。'down'–– セクションの順序は逆になります。零点は常に最も近い極との組み合わせになります。
出力引数
2 次セクション フィルター オブジェクト。dsp.SOSFilter System object として返されます。関数 sos は、入力の IIR フィルターの分子と分母の係数を SOS 行列およびスケール値に変換し、その値を dsp.SOSFilter オブジェクトに割り当てます。
バージョン履歴
R2011a で導入dsp.BiquadFilter オブジェクトと UseLegacyBiquadFilter フラグは、将来のリリースで削除される予定です。
dsp.BiquadFilter オブジェクトと UseLegacyBiquadFilter フラグは、将来のリリースで削除される予定です。
関数 sos は、dsp.BiquadFilter オブジェクトの代わりに dsp.SOSFilter オブジェクトを生成するようになりました。
dsp.IIRFilter オブジェクトを初期化します。関数 sos を使用して、IIR フィルター オブジェクトを、対応する SOS セクションをもつ双二次フィルターに変換します。出力は dsp.SOSFilter フィルター オブジェクトです。
iirFilt = dsp.IIRFilter convFilt = sos(iirFilt)
convFilt =
dsp.SOSFilter with properties:
Structure: 'Direct form II transposed'
CoefficientSource: 'Property'
Numerator: [1 1 0]
Denominator: [1 0.1000 0]
HasScaleValues: false
Show all properties
dsp.SOSFilter オブジェクトの代わりに dsp.BiquadFilter オブジェクトを設計するには、UseLegacyBiquadFilter フラグを使用してそれを true に設定できます。
convFilt = sos(iirFilt,UseLegacyBiquadFilter=true)
convFilt =
dsp.BiquadFilter with properties:
Structure: 'Direct form II transposed'
SOSMatrixSource: 'Property'
SOSMatrix: [1 1 0 1 0.1000 0]
ScaleValues: [2×1 double]
InitialConditions: 0
OptimizeUnityScaleValues: true
Show all properties
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)