Main Content

複素バンドパス フィルター設計

この例では、複素数バンドパス フィルターの設計法を示します。複素バンドパス フィルターは、IF サブサンプリング デジタル周波数変換器からアナログとデジタル TV 放送の残留側波帯変調スキームまで、多くの用途で使用されます。複素バンドパス フィルターを設計する簡単な方法は、ローパス プロトタイプから開始して、複素シフト周波数変換を適用することです。この例では、単一ステージのシングルレート FIR フィルターから、多段のマルチレート FIR フィルターや IIR フィルターまで、ローパス プロトタイプを検証します。

単一ステージのシングルレート FIR 設計とマルチレート FIR 設計

シングルレート FIR 設計の場合、フィルター係数の各セットを複素指数関数を乗算します (「ヘテロダイン処理を施す」とも言われます)。

ローパス ナイキスト フィルター プロトタイプの零点を正規化周波数 0.6 で回転させます。

Hlp = design(fdesign.nyquist(8),SystemObject=true);     % Lowpass prototype
N = length(Hlp.Numerator)-1;
Fc = .6;   % Desired frequency shift
Hbp = clone(Hlp);
Hbp.Numerator = Hbp.Numerator.*exp(1j*Fc*pi*(0:N));
hfvt = fvtool(Hlp,Hbp,Color='white');
legend(hfvt,'Lowpass Prototype','Complex Bandpass',Location='NorthWest')

Figure Figure 1: Magnitude Response (dB) contains an axes object. The axes object with title Magnitude Response (dB), xlabel Normalized Frequency ( times pi blank rad/sample), ylabel Magnitude (dB) contains 2 objects of type line. These objects represent Lowpass Prototype, Complex Bandpass.

同じ手法は、単一ステージのマルチレート フィルターにも適用できます。

多段のマルチレート FIR 設計

多段のマルチレート FIR フィルターでは、各フィルターの異なる相対周波数を考慮に入れる必要があります。多段間引きでは、目的の周波数シフトは 1 つ目の段にのみ適用されます。後続の段も該当する累積間引き係数で目的の周波数シフトをスケールしなければなりません。

Hd = designMultistageDecimator(16,16,0.1,75);

Fc  = -.2;  % Desired frequency shift 
Hdbp = clone(Hd);

Fck = Fc;
for k = 1:Hdbp.getNumStages
    Stagek = Hdbp.(sprintf('Stage%i',k));
    Nk = length(Stagek.Numerator)-1;
    Stagek.Numerator = Stagek.Numerator.*exp(1j*Fck*pi*(0:Nk));

    % Update the frequency shift applied to the k-th stage
    Fck = Fck*Stagek.DecimationFactor; 
end

hfvt = fvtool(Hd,Hdbp);
legend(hfvt,'Lowpass Prototype','Complex Bandpass',Location='NorthWest')

Figure Figure 2: Magnitude Response (dB) contains an axes object. The axes object with title Magnitude Response (dB), xlabel Frequency (Hz), ylabel Magnitude (dB) contains 3 objects of type line. These objects represent Lowpass Prototype, Complex Bandpass.

同様に、多段内挿では、目的の周波数シフトは最後の段にのみ適用されます。それ以前の段も該当する内挿係数で目的の周波数シフトをスケールしなければなりません。

Hi = designMultistageInterpolator(16,16,0.1,75);

Fc = .4;   % Desired frequency shift 
Hibp = clone(Hi);

Fck = Fc;
for k = Hibp.getNumStages:-1:1
    Stagek = Hibp.(sprintf('Stage%i',k));
    Nk = length(Stagek.Numerator)-1;
    Stagek.Numerator = Stagek.Numerator.*exp(1j*Fck*pi*(0:Nk));

    % Update the frequency shift applied to the k-th stage
    Fck = Fck* Stagek.InterpolationFactor;
end

hfvt = fvtool(Hi,Hibp);
legend(hfvt,'Lowpass Prototype','Complex Bandpass',Location='NorthWest')

Figure Figure 3: Magnitude Response (dB) contains an axes object. The axes object with title Magnitude Response (dB), xlabel Frequency (Hz), ylabel Magnitude (dB) contains 3 objects of type line. These objects represent Lowpass Prototype, Complex Bandpass.

dsp.ComplexBandpassDecimator System object™ を使用すると、多段バンドパス フィルターを容易に設計できます。オブジェクトは、指定された間引き係数、中心周波数およびサンプル レートに基づいてバンドパス フィルターを設計します。前の手順で設計したフィルターのようにローパス係数をバンドパスに変換する必要はありません。オブジェクトがそれを行います。

System object を使用して、間引き係数が 16、中心周波数が 5 KHz、サンプリング レートが 44.1 KHz、遷移幅が 100 Hz、阻止帯域の減衰量が 75 dB の複素バンドパス フィルターを設計します。

bp = dsp.ComplexBandpassDecimator(16,5000,SampleRate=44100,...
                                  TransitionWidth=100,...
                                  StopbandAttenuation=75);

関数 freqz を使用してフィルター応答を可視化します。

freqz(bp)

Figure contains 2 axes objects. Axes object 1 with xlabel Frequency (Hz), ylabel Magnitude (dB) contains an object of type line. Axes object 2 with xlabel Frequency (Hz), ylabel Phase (degrees) contains an object of type line.

関数 visualizeFilterStages を使用してさまざまなフィルター段階の応答を可視化します。

visualizeFilterStages(bp);

Figure Figure 4: Magnitude Response (dB) contains an axes object. The axes object with title Magnitude Response (dB), xlabel Frequency (kHz), ylabel Magnitude (dB) (normalized to 0 dB) contains 4 objects of type line. These objects represent Filter #1, Filter #2, Filter #3, Filter #4.

最初のフィルターのみが 5 KHz にシフトされます。後続のフィルター段階はローパスであり、実数係数をもっています。MinimizeComplexCoefficients プロパティを false に設定し、すべてのフィルター段階を 5000 KHz にシフトします。

関数 cost を使用してバンドパス フィルターのコストを計算します。

cost(bp)
ans = struct with fields:
                      NumCoefficients: 144
                            NumStates: 272
    RealMultiplicationsPerInputSample: 27.8750
          RealAdditionsPerInputSample: 27

シングルレート IIR 設計

シングルレート IIR 設計では、複素周波数シフト変換またはローパスからの複素バンドパス IIR 変換のいずれかを使用できます。後者の場合、バンドパス フィルターの帯域幅も変更できます。

Fp = .2;

% Design a lowpass prototype, and obtain the second order coefficients
Hiirlp = design(fdesign.lowpass(Fp,.25,.5,80),'ellip',SystemObject=true);
B = (Hiirlp.ScaleValues(1:end-1)').*Hiirlp.Numerator;
A = Hiirlp.Denominator;

% Perform lowpass to complex bandpass transform
Fc = .6;  % Desired frequency shift 

[Bc,Ac] = iirlp2bpc(B,A, ...            % Transform lowpass to complex bandpass
                    Fp,[Fc-Fp, Fc+Fp]); % Lowpass passband frequency mapped
                                        % to bandpass passband frequencies 

% Construct a filter object and plot the responses
Hiircbp = dsp.SOSFilter(Bc, Ac);

hfvt = fvtool(Hiirlp,Hiircbp);
legend(hfvt,'Lowpass Prototype','Complex Bandpass',Location='NorthWest')

Figure Figure 5: Magnitude Response (dB) contains an axes object. The axes object with title Magnitude Response (dB), xlabel Normalized Frequency ( times pi blank rad/sample), ylabel Magnitude (dB) contains 2 objects of type line. These objects represent Lowpass Prototype, Complex Bandpass.

参考

| | | | | | | |

関連するトピック