## Documentation |

Discrete-time, second-order section, direct-form I filter

`Hd = dfilt.df1sos(s)Hd = dfilt.df1sos(b1,a1,b2,a2,...)Hd = dfilt.df1sos(...,g)Hd = dfilt.df1sos`

`Hd = dfilt.df1sos(s)` returns
a discrete-time, second-order section, direct-form I filter, `Hd`,
with coefficients given in the `s` matrix. The filter
states for this object are stored in a `filtstates` object.

`Hd = dfilt.df1sos(b1,a1,b2,a2,...)` returns
a discrete-time, second-order section, direct-form I filter, `Hd`,
with coefficients for the first section given in the `b1` and `a1` vectors,
for the second section given in the `b2` and `a2` vectors,
etc.

`Hd = dfilt.df1sos(...,g)` includes
a gain vector `g`. The elements of `g` are
the gains for each section. The maximum length of `g` is
the number of sections plus one. If `g` is not specified,
all gains default to one.

`Hd = dfilt.df1sos` returns
a default, discrete-time, second-order section, direct-form I filter, `Hd`.
This filter passes the input through to the output unchanged.

To display the filter states, use this code to access the `filtstates` object.

Hs = Hd.states % Where Hd is the dfilt.df1 object and double (Hs) % Hs is the filtstates object

The vector is

$$\left(\begin{array}{cc}zb1(1)& zb2(1)\\ zb1(2)& zb2(2)\\ za1(1)& za2(1)\\ za1(2)& za2(2)\end{array}\right)$$

For filters with more than one section, each section is a separate column in the matrix.

Specify a second-order sections, direct-form I discrete-time filter with coefficients from a sixth order, lowpass, elliptical filter using the following code. The resulting filter has three sections.

[z,p,k] = ellip(6,1,60,.4); % Obtain filter coefficients [s,g] = zp2sos(z,p,k); % Convert to SOS Hd = dfilt.df1sos(s,g)

Was this topic helpful?