主要内容

Quantize Filters

Once you import, create, or design filters in the Filter Designer app, you can quantize the filter coefficients by setting the Arithmetic parameter under Parameters > Coefficient Quantization to Fixed point.

Note

To use the fixed-point arithmetic, you must have a DSP System Toolbox™ and Fixed-Point Designer™ license.

When you set the Arithmetic parameter to Fixed point:

  • The app quantizes the designed filter based on the Fixed-Point Coefficient Settings that you specify.

  • The analysis plot shows the frequency response of the reference filter and the quantized filter.

  • The Filter Information panel in the app shows the fixed-point arithmetic and filter coefficient information.

Fixed-Point Coefficient Settings

The Coefficient Quantization panel provides fixed-point settings to quantize the filter coefficients. These settings customize the word length and fraction length of filter coefficients and scale values.

Fixed-Point Parameter

Supported Filter Response

Description

Numerator word length

All FIR filter responses

Set the word length of numerator coefficients in FIR filters.

Coefficient word length

All IIR filter responses

Set the word length of numerator and denominator coefficients in IIR filters.

You cannot set different word lengths for the numerator and denominator coefficients.

Auto scale coefficient fraction length

All FIR and IIR filter responses

Scale the fraction length of filter coefficients (numerator and denominator) automatically, so that they have the best possible precision for the given word length.

Selecting this option disables all the fraction length options for the filter.

Numerator fraction length

All FIR and IIR filter responses

Set the fraction length of numerator coefficients in FIR and IIR filters.

This option appears only when you clear the Auto scale coefficient fraction length parameter.

Denominator fraction length

All IIR filter responses

Set the fraction length of denominator coefficients in IIR filters.

This option appears only when you clear the Auto scale coefficient fraction length parameter.

Scale values fraction length

All IIR filter responses

Set the fraction length of scale values in the second-order section matrices of the IIR filters.

Export Quantized Filter

Once you design the quantized filter, you can export this filter to:

  • The MATLAB® workspace as a filter System object™ or a coefficient variable.

  • A Simulink® model as a filter block or a system of basic elements.

  • The DSP HDL IP Designer (DSP HDL Toolbox) app.

    Note

    This workflow requires a DSP HDL Toolbox™ license.

  • A MATLAB function as a filter System object.

  • A MATLAB function and perform filtering using this filter System object.

  • A C header file.

  • A coefficients (.coe) file.

For more information, see Export and Share Filters.

See Also

Apps

Functions

Live Editor Tasks

Topics