Import and Export Filter Coefficients
R2026bIn the Filter Analyzer and Filter Designer apps, you can import filter coefficients from the MATLAB® workspace for analysis and visualization. In Filter Designer, you can also import filter coefficients for quantization and further design, or export filter coefficients.
Import Filter Coefficients — Import filter designs specified as numerator and denominator coefficients with a scaling gain.
Export Filter Coefficients — Save the filter numerator and denominator coefficients as matrices in the MATLAB workspace.
Import Filter Coefficients
To import the designs, use Import Filters and specify the coefficients and scaling gain. Specify the coefficients as two L-row matrices B and A, and specify the scaling gain as an L + 1-element vector Γ.
Filter Designer and Filter Designer assume you have specified the filter as a sequence of L cascaded transfer functions (CTF), such that the full transfer function of the filter is
,
where m ≥ 0 is the numerator order of the filter and n ≥ 0 is the denominator order.
If B is a scalar, then the apps assume that the filter is a cascade of all-pole IIR filters.
If A is a scalar, then the apps assume that the filter is a cascade of FIR filters.
If both B and A are vectors (L = 1), then the apps assume that B and A represent the transfer function of an IIR filter.
If Γ is a scalar, then the apps distribute the value uniformly to all the CTF sections.
If Γ is a vector, then the apps assume that the first L elements are scaling gains that apply to the corresponding CTF sections, and the last value corresponds to the overall scaling gain of the filter.
Tip
Export Filter Coefficients
You can also use Filter Designer to export a selected filter design to the
MATLAB workspace as coefficients. To export the design,click
Export on the Designer tab, select
Export to MATLAB Workspace, and select
Coefficients. The app exports the coefficients as
matrices of cascaded second-order transfer functions, each with unit gain.