Skip to Main Content Skip to Search
Product Documentation

Starting Filter Design HDL Coder

Opening the Filter Design HDL Coder GUI From FDATool

To open the initial Generate HDL dialog box from FDATool, do the following:

  1. Enter the fdatool command at the MATLAB command prompt. The FDATool displays its initial dialog box.

  2. If the filter design is quantized, skip to step 3. Otherwise, quantize the filter by clicking the Set Quantization Parameters button . The Filter arithmetic menu appears in the bottom half of the dialog box.

      Note   All supported filter structures allow fixed-point and floating-point (double) realizations.

  3. If desired, adjust the setting of the Filter arithmetic option. The FDATool displays the first of three tabbed panes of its dialog.

  4. Select Targets > Generate HDL. The FDATool displays the Generate HDL dialog box.

    If the coder does not support the structure of the current filter in the FDATool, an error message appears. For example, if the current filter is a quantized, lattice-coupled, allpass filter, the following message appears.

Opening the Filter Design HDL Coder GUI From the filterbuilder GUI

If you are not familiar with the filterbuilder GUI, see the DSP System Toolbox documentation.

To open the initial Generate HDL dialog box from the filterbuilder GUI, do the following:

  1. At the MATLAB command prompt, type a filterbuilder command that corresponds to the filter response or filter object you want to design.

    The following figure shows the default settings of the main pane of the filterbuilder Lowpass Filter Design dialog box.

  2. Set the filter design parameters as required.

  3. Click the Code Generation tab. This activates the Code Generation pane, shown in the following figure.

  4. In the Code Generation pane, click the Generate HDL button. This opens the Generate HDL dialog box, passing in the current filter object from filterbuilder.

  5. Set the desired code generation and test bench options and generate code in the Generate HDL dialog box.

Opening the Filter Design HDL Coder GUI Using the fdhdltool Command

Opening the Generate HDL Dialog Box Using the fdhdltool Command

You can use the fdhdltool command to open the Generate HDL dialog box directly from the MATLAB command line. The syntax is:

fdhdltool(Hd) 

where Hd is any type of filter object that is supported for HDL code generation.

The fdhdltool function is particularly useful when you need to use the Filter Design HDL Coder GUI to generate HDL code for filter structures that are not supported by FDATool or filterbuilder. For example, the following commands create a Farrow linear fractional delay filter object Hd, which is passed in to the fdhdltool function:

D = .3;
farrowfilt = dfilt.farrowlinearfd(D);
farrowfilt.arithmetic = 'fixed';
fdhdltool(farrowfilt); 

fdhdltool operates on a copy of the filter object, rather than the original object in the MATLAB workspace. Any changes made to the original filter object after invoking fdhdltool do not affect the copy and do not update the Generate HDL dialog box.

The naming convention for the copied object is filt_copy, where filt is the name of the original filter object. This naming convention is reflected in the filter Name and test bench File name fields, as shown in the following figure.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS