Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

FVTool

フィルターの可視化ツール

説明

フィルターの可視化ツールは、フィルターの応答や係数などの情報を表示して解析することができる対話型アプリです。また、FVToolフィルター デザイナーを同期すれば、フィルター設計に加えた変更を即時に可視化できます。

このアプリでは、以下を表示できます。

  • 振幅応答

  • 位相応答

  • 群遅延

  • 位相遅延

  • インパルス応答

  • ステップ応答

  • 極-零点プロット

  • フィルター係数

  • フィルター情報

詳細については、解析タイプを参照してください。

DSP System Toolbox™ がインストールされている場合、FVTool はフィルター System object™ の周波数応答も可視化できます。ストリーミング データをリアルタイムにフィルター処理する必要がある場合は、System object を使用することをお勧めします。詳細については、fvtool (DSP System Toolbox)を参照してください。

Filter Visualization Tool

FVTool を開く

FVTool は、プログラムでの使用で説明されているいずれかの方法を使用して、プログラムによって開くことができます。

すべて展開する

通過帯域リップル 3 dB、阻止帯域の減衰量 50 dB、サンプル レート 1 kHz、正規化された通過帯域エッジ 300 Hz の 6 次の楕円フィルターを考えます。フィルターの振幅応答を表示します。

[b,a] = ellip(6,3,50,300/500);
fvtool(b,a)

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 an object of type line.

阻止帯域周波数が 150 Hz および 350 Hz、通過帯域周波数が 200 Hz および 300 Hz である 50 次のバンドパス FIR フィルターを設計します。サンプル レートは 1000 Hz です。フィルターの振幅応答と位相応答を可視化します。

N = 50;
Fstop1 = 150;
Fstop2 = 350;

Fpass1 = 200;
Fpass2 = 300;

Fs = 1e3;

bpFilt = designfilt("bandpassfir",FilterOrder=N, ...
StopbandFrequency1=Fstop1,StopbandFrequency2=Fstop2,...
PassbandFrequency1=Fpass1,PassbandFrequency2=Fpass2,...
SampleRate=Fs);

fvtool(bpFilt,Analysis="freq")

Figure Figure 1: Magnitude Response (dB) and Phase Response contains an axes object. The axes object with title Magnitude Response (dB) and Phase Response, xlabel Frequency (Hz), ylabel Magnitude (dB) contains an object of type line.

ツールストリップの [解析パラメーター] ボタンを選択します。[解析パラメーター] ウィンドウが開き、プロットに関連付けられているパラメーターが表示されます。

fvtool_analysisparams2.png

6 次の楕円フィルターの振幅応答を表示します。通過帯域リップル 3 dB、阻止帯域の減衰量 50 dB、サンプル レート 1 kHz、正規化された通過帯域エッジ 300 Hz を指定します。FVTool のハンドルを取得します。

[b,a] = ellip(6,3,50,300/500);
h = fvtool(b,a)

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 an object of type line.

h = 
  Figure (filtervisualizationtool) with properties:

      Number: []
        Name: 'Figure 1: Magnitude Response (dB)'
       Color: [0.9400 0.9400 0.9400]
    Position: [348 376 583 437]
       Units: 'pixels'

  Use GET to show all properties

FVTool ハンドルを使用して、フィルターの位相応答を表示します。

h.Analysis = "phase"

Figure Figure 1: Phase Response contains an axes object. The axes object with title Phase Response, xlabel Normalized Frequency ( times pi blank rad/sample), ylabel Phase (radians) contains an object of type line.

h = 
  Figure (filtervisualizationtool) with properties:

      Number: []
        Name: 'Figure 1: Phase Response'
       Color: [0.9400 0.9400 0.9400]
    Position: [1 1 1024 657]
       Units: 'pixels'

  Use GET to show all properties

プロットの凡例を有効にしてテキストを追加します。

legend(h,"Phase plot")

Figure Figure 1: Phase Response contains an axes object. The axes object with title Phase Response, xlabel Normalized Frequency ( times pi blank rad/sample), ylabel Phase (radians) contains an object of type line. This object represents Phase plot.

サンプル レートを 1 kHz に指定します。中央揃えの両側応答を表示します。

h.Fs = 1000;
h.FrequencyRange = "[-Fs/2, Fs/2)"

Figure Figure 1: Phase Response contains an axes object. The axes object with title Phase Response, xlabel Frequency (Hz), ylabel Phase (radians) contains an object of type line. This object represents Phase plot.

h = 
  Figure (filtervisualizationtool) with properties:

      Number: []
        Name: 'Figure 1: Phase Response'
       Color: [0.9400 0.9400 0.9400]
    Position: [1 1 1024 657]
       Units: 'pixels'

  Use GET to show all properties

プロットのすべてのプロパティを表示します。FVTool 固有のプロパティはリストの最後にあります。

get(h)
                     Grid: on
                   Legend: 'on'
               DesignMask: 'off'
          SOSViewSettings: [1x1 dspopts.sosview]
                       Fs: 1000
                 Alphamap: [0 0.0159 0.0317 0.0476 0.0635 0.0794 0.0952 0.1111 0.1270 0.1429 0.1587 0.1746 0.1905 0.2063 0.2222 0.2381 0.2540 0.2698 0.2857 0.3016 0.3175 0.3333 0.3492 0.3651 0.3810 0.3968 0.4127 0.4286 0.4444 0.4603 ... ] (1x64 double)
          CloseRequestFcn: 'closereq'
                    Color: [0.9400 0.9400 0.9400]
                 Colormap: [256x3 double]
              ContextMenu: [0x0 GraphicsPlaceholder]
              CurrentAxes: [1x1 Axes]
         CurrentCharacter: ''
            CurrentObject: [0x0 GraphicsPlaceholder]
             CurrentPoint: [0 0]
             DockControls: off
                 FileName: ''
            IntegerHandle: off
           InvertHardcopy: on
              KeyPressFcn: ''
            KeyReleaseFcn: ''
                     Name: 'Figure 1: Phase Response'
                 NextPlot: 'add'
              NumberTitle: off
               PaperUnits: 'inches'
         PaperOrientation: 'portrait'
            PaperPosition: [-0.8700 2.2150 10.2400 6.5700]
        PaperPositionMode: 'auto'
                PaperSize: [8.5000 11]
                PaperType: 'usletter'
                  Pointer: 'arrow'
        PointerShapeCData: [16x16 double]
      PointerShapeHotSpot: [1 1]
                 Position: [1 1 1024 657]
                 Renderer: 'opengl'
             RendererMode: 'auto'
                   Resize: on
                ResizeFcn: @(~,~)fix_listbox_position(this,hFVT)
            SelectionType: 'normal'
                  ToolBar: 'none'
                     Type: 'figure'
                    Units: 'pixels'
      WindowButtonDownFcn: ''
    WindowButtonMotionFcn: ''
        WindowButtonUpFcn: ''
        WindowKeyPressFcn: ''
      WindowKeyReleaseFcn: ''
     WindowScrollWheelFcn: ''
              WindowStyle: 'docked'
             BeingDeleted: off
            ButtonDownFcn: ''
                 Children: [5x1 Graphics]
                 Clipping: on
                CreateFcn: ''
                DeleteFcn: ''
               BusyAction: 'queue'
         HandleVisibility: 'off'
                  HitTest: on
            Interruptible: on
                   Parent: [1x1 Root]
                 Selected: off
       SelectionHighlight: on
                      Tag: 'filtervisualizationtool'
                 UserData: []
                  Visible: on
           FrequencyScale: 'Linear'
                 Analysis: 'phase'
      NormalizedFrequency: 'off'
           FrequencyRange: '[-Fs/2, Fs/2)'
          FrequencyVector: [0 0.0039 0.0078 0.0118 0.0157 0.0196 0.0235 0.0275 0.0314 0.0353 0.0392 0.0431 0.0471 0.0510 0.0549 0.0588 0.0627 0.0667 0.0706 0.0745 0.0784 0.0824 0.0863 0.0902 0.0941 0.0980 0.1020 0.1059 0.1098 0.1137 ... ] (1x256 double)
        OverlayedAnalysis: ''
             PhaseDisplay: 'Phase'
            PolyphaseView: 'off'
            ShowReference: 'on'
           NumberofPoints: 8192
               PhaseUnits: 'Radians'

関連する例

プログラムでの使用

すべて展開する

fvtool(b,a) では、FVTool が開き、分子 b と分母 a で定義されるデジタル フィルターの振幅応答が表示されます。係数 ba をべき乗 z-1 の昇順で指定します。

fvtool(sos) では、FVTool が開き、2 次セクションの L 行 6 列の行列で定義されるデジタル フィルターの振幅応答が表示されます。

sos=[b01b11b211a11a21b02b12b221a12a22b0Lb1Lb2L1a1La2L]

sos の行には、2 次セクション H(z) のカスケードの分子と分母の係数 bik および aik が含まれます。

H(z)=gk=1LHk(z)=gk=1Lb0k+b1kz1+b2kz21+a1kz1+a2kz2.

セクション数 L は 2 以上でなければなりません。セクション数が 2 未満の場合は、fvtool は入力を分子ベクトルと見なします。

fvtool(d) では、FVTool が開き、デジタル フィルター d の振幅応答が表示されます。d を周波数応答仕様に基づいて生成するには、関数 designfilt を使用します。

fvtool(b1,a1,b2,a2,...,bN,aN) では、FVTool が開き、分子 b1、…、bN と分母 a1、...、aN で定義される複数のフィルターの振幅応答が表示されます。

fvtool(sos1,sos2,...,sosN) では、FVTool が開き、2 次セクション行列 sos1sos2、...、sosN で定義される複数のフィルターの振幅応答が表示されます。

fvtool(Hd) では、FVTool が開き、dfilt フィルター オブジェクト Hd または dfilt フィルター オブジェクトの配列に対する振幅応答が表示されます。

fvtool(Hd1,Hd2,...,HdN) では、FVTool が開き、dfilt オブジェクト Hd1Hd2、...、HdN のフィルターの振幅応答が表示されます。

h = fvtool(___) では、Figure ハンドル h が返されます。このハンドルを使用して、コマンド ラインから FVTool を操作することができます。詳細については、MATLAB コマンド ラインからの FVTool の制御を参照してください。

詳細

すべて展開する

バージョン履歴

R2006a より前に導入

すべて展開する