メインコンテンツ

firtype

線形位相 FIR フィルターのタイプ

説明

t = firtype(b) は、FIR フィルターのタイプ t を判定します。フィルター係数をベクトル b で指定します。t は 1、2、3、または 4 になります。フィルターは実数で、線形位相をもたなければなりません。

t = firtype(d) は FIR フィルター d のタイプ t を判定します。t は 1、2、3 または 4 になります。フィルターは実数で、線形位相をもたなければなりません。

すべて折りたたむ

ウィンドウ法を使用して 2 つの FIR フィルターを設計します。片方の次数は偶数、もう一方の次数は奇数です。タイプを判別し、インパルス応答をプロットします。

subplot(2,1,1)
b = fir1(8,0.5);
impz(b), title(['Type ' int2str(firtype(b))])

subplot(2,1,2)
b = fir1(9,0.5);
impz(b), title(['Type ' int2str(firtype(b))])

Figure contains 2 axes objects. Axes object 1 with title Type 1, xlabel n (samples), ylabel Amplitude contains an object of type stem. Axes object 2 with title Type 2, xlabel n (samples), ylabel Amplitude contains an object of type stem.

2 つの等リップル ヒルベルト変換器を設計します。片方の次数は偶数、もう一方の次数は奇数です。タイプを判別し、インパルス応答をプロットします。

subplot(2,1,1)
b = firpm(8,[0.2 0.8],[1 1],'hilbert');
impz(b), title(['Type ' int2str(firtype(b))])


subplot(2,1,2)
b = firpm(9,[0.2 0.8],[1 1],'hilbert');
impz(b), title(['Type ' int2str(firtype(b))])

Figure contains 2 axes objects. Axes object 1 with title Type 3, xlabel n (samples), ylabel Amplitude contains an object of type stem. Axes object 2 with title Type 4, xlabel n (samples), ylabel Amplitude contains an object of type stem.

designfilt を使用して、前述の例のフィルターを設計します。タイプを表示します。

d1 = designfilt("lowpassfir",DesignMethod="window", ...
                FilterOrder=8,CutoffFrequency=0.5);
disp(["d1 is of type " int2str(firtype(d1))])
    "d1 is of type "    "1"
d2 = designfilt("lowpassfir",DesignMethod="window", ...
                FilterOrder=9,CutoffFrequency=0.5);
disp(["d2 is of type " int2str(firtype(d2))])
    "d2 is of type "    "2"
d3 = designfilt("hilbertfir",DesignMethod="equiripple", ...
                FilterOrder=8,TransitionWidth=0.4);
disp(["d3 is of type " int2str(firtype(d3))])
    "d3 is of type "    "3"
d4 = designfilt("hilbertfir",DesignMethod="equiripple", ...
                FilterOrder=9,TransitionWidth=0.4);
disp(["d4 is of type " int2str(firtype(d4))])
    "d4 is of type "    "4"

入力引数

すべて折りたたむ

FIR フィルターのフィルター係数。倍精度または単精度の実数値の行ベクトルまたは列ベクトルで指定します。

データ型: double | single

FIR フィルター。digitalFilter オブジェクトで指定します。デジタル フィルターを周波数応答仕様に基づいて生成するには、関数 designfilt を使用します。

出力引数

すべて折りたたむ

フィルター タイプ。1、2、3 または 4 のいずれかとして返されます。フィルター タイプの定義は次のとおりです。

  • タイプ 1 — 偶数の次数で対称の係数

  • タイプ 2 — 奇数の次数で対称の係数

  • タイプ 3 — 偶数の次数で反対称の係数

  • タイプ 4 — 奇数の次数で反対称の係数

バージョン履歴

R2013a で導入