| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Filter Design Toolbox |
| Contents | Index |
| Learn more about Filter Design Toolbox |
| On this page… |
|---|
When you import a quantized filter into FDATool, or export a quantized filter from FDATool to your workspace, the import and export functions use objects and you specify the filter as a variable. This contrasts with importing and exporting nonquantized filters, where you select the filter structure and enter the filter numerator and denominator for the filter transfer function.
You have the option of exporting quantized filters to your MATLAB workspace, exporting them to text files, or exporting them to MAT-files.
For general information about importing and exporting filters in FDATool, refer to FDATool: A Filter Design and Analysis GUI in the Signal Processing Toolbox User's Guide.
FDATool imports quantized filters having the following structures:
Direct form I
Direct form II
Direct form I transposed
Direct form II transposed
Direct form symmetric FIR
Direct form antisymmetric FIR
Lattice allpass
Lattice AR
Lattice MA minimum phase
Lattice MA maximum phase
Lattice ARMA
Lattice coupled-allpass
Lattice coupled-allpass power complementary
After you design or open a quantized filter in your MATLAB workspace, FDATool lets you import the filter for analysis. Follow these steps to import your filter in to FDATool:
Select Filter > Import Filter from the menu bar.
In the lower region of FDATool, the Design Filter pane becomes Import Filter, and options appear for importing quantized filters, as shown.

From the Filter Structure list, select Filter object.
The options for importing filters change to include:
Discrete filter — Enter the variable name for the discrete-time, fixed-point filter in your workspace.
Frequency units — Select the frequency units from the Units list under Sampling Frequency, and specify the sampling frequency value in Fs if needed. Your sampling frequency must correspond to the units you select. For example, when you select Normalized (0 to 1), Fs defaults to one. But if you choose one of the frequency options, enter the sampling frequency in your selected units. If you have the sampling frequency defined in your workspace as a variable, enter the variable name for the sampling frequency.
Click Import to import the filter.
FDATool checks your workspace for the specified filter. It imports the filter if it finds it, displaying the magnitude response for the filter in the analysis area. If it cannot find the filter it returns an FDATool Error dialog box.
Note
If, during any FDATool session, you switch to quantization mode
and create a fixed-point filter, FDATool remains in quantization mode.
If you import a double-precision filter, FDATool automatically quantizes
your imported filter applying the most recent quantization parameters. |
To save your filter design, FDATool lets you export the quantized filter to your MATLAB workspace (or you can save the current session in FDATool). When you choose to save the quantized filter by exporting it, you select one of these options:
You can save the filter as filter coefficients variables or as a dfilt filter object variable. To save the filter to the MATLAB workspace:
Select Export from the File menu. The Export dialog box appears.
Select Coefficients from the Export As list to save the filter coefficients or select Objects to save the filter in a filter object.
For coefficients, assign variable names using the Numerator and Denominator options under Variable Names. For objects, assign the variable name in the Discrete or Quantized filter option. If you have variables with the same names in your workspace and you want to overwrite them, select the Overwrite Variables box.
If you try to export the filter to a variable name that exists in your workspace, and you did not select Overwrite existing variables, FDATool stops the export operation and returns a warning that the variable you specified as the quantized filter name already exists in the workspace. To continue to export the filter to the existing variable, click OK to dismiss the warning dialog box, select the Overwrite existing variables check box and click OK or Apply.
To extract the filter coefficients from your quantized filter after you export the filter to MATLAB, use the celldisp function in MATLAB. For example, create a quantized filter in FDATool and export the filter as Hq. To extract the filter coefficients for Hq, use
celldisp(Hq.referencecoefficients)
which returns the cell array containing the filter reference coefficients, or
celldisp(Hq.quantizedcoefficients
to return the quantized coefficients.
To save your quantized filter as a text file, follow these steps:
Click OK to export the filter and close the dialog box. Click Apply to export the filter without closing the Export dialog box. Clicking Apply lets you export your quantized filter to more than one name without leaving the Export dialog box.
The Export Filter Coefficients to Text-file dialog box appears. This is the standard Microsoft Windows save file dialog box.
Choose or enter a directory and filename for the text file and click OK.
FDATool exports your quantized filter as a text file with the name you provided, and the MATLAB editor opens, displaying the file for editing.
To save your quantized filter as a MAT-file, follow these steps:
Click OK to export the filter and close the dialog box. Click Apply to export the filter without closing the Export dialog box. Clicking Apply lets you export your quantized filter to more than one name without leaving the Export dialog box.
The Export Filter Coefficients to MAT-file dialog box appears. This is the standard Microsoft Windows save file dialog box.
Choose or enter a directory and filename for the text file and click OK.
FDATool exports your quantized filter as a MAT-file with the specified name.
![]() | Viewing SOS Filter Sections | Importing XILINX Coefficient (.COE) Files | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |