11:mod: `Filters ` - filter design and filtering
22============================================
33
4- Linear time-invariant filter representations
5- --------------------------------------------
4+ DSP.jl differentiates between filter coefficients and filters. Filter
5+ coefficient objects specify the response of the filter in one of
6+ several standard forms. Filter objects carry the state of the filter
7+ together with filter coefficients in an implementable form
8+ (``PolynomialRatio ``, ``Biquad ``, or ``SecondOrderSections ``).
9+ When invoked on a filter coefficient object, ``filt `` preserves state
10+ between invocations.
611
7- DSP.jl supports common filter representations. Filters can be converted
8- from one type to another using ``convert ``.
12+ Linear time-invariant filter coefficient objects
13+ ------------------------------------------------
14+
15+ DSP.jl supports common filter representations. Filter coefficients can
16+ be converted from one type to another using ``convert ``.
917
1018.. function :: ZeroPoleGain(z, p, k)
1119
@@ -45,28 +53,45 @@ from one type to another using ``convert``.
4553 sections and gain. ``biquads `` must be specified as a vector of
4654 ``Biquads ``.
4755
56+
57+ Filter objects
58+ ----------------------------------
59+
60+ .. function :: DF2TFilter(coef[, si])
61+
62+ Construct a stateful direct form II transposed filter with
63+ coefficients ``coef ``. ``si `` is an optional array representing the
64+ initial filter state (defaults to zeros). If ``f `` is a
65+ ``PolynomialRatio ``, ``Biquad ``, or ``SecondOrderSections ``,
66+ filtering is implemented directly. If ``f `` is a ``ZeroPoleGain ``
67+ object, it is first converted to a ``SecondOrderSections `` object.
68+
69+
4870Filter application
4971------------------
5072
5173.. function :: filt(f, x[, si])
5274
53- Apply filter ``f `` along the first dimension of array ``x ``. ``si ``
54- is an optional array representing the initial filter state
55- (defaults to zeros). If ``f `` is a ``PolynomialRatio ``, ``Biquad ``,
56- or ``SecondOrderSections ``, filtering is implemented directly. If ``f `` is a
57- ``ZeroPoleGain ``, it is first converted to an ``SecondOrderSections ``.
75+ Apply filter or filter coefficients ``f `` along the first dimension
76+ of array ``x ``. If ``f `` is a filter coefficient object, ``si ``
77+ is an optional array representing the initial filter state (defaults
78+ to zeros). If ``f `` is a ``PolynomialRatio ``, ``Biquad ``, or
79+ ``SecondOrderSections ``, filtering is implemented directly. If
80+ ``f `` is a ``ZeroPoleGain `` object, it is first converted to a
81+ ``SecondOrderSections `` object.
5882
5983.. function :: filt!(out, f, x[, si])
6084
6185 Same as :func: `filt() ` but writes the result into the ``out ``
6286 argument, which may alias the input ``x `` to modify it in-place.
6387
64- .. function :: filtfilt(f , x)
88+ .. function :: filtfilt(coef , x)
6589
66- Filter ``x `` in the forward and reverse directions. The initial
67- state of the filter is computed so that its response to a step
68- function is steady state. Before filtering, the data is
69- extrapolated at both ends with an odd-symmetric extension of length
90+ Filter ``x `` in the forward and reverse directions using filter
91+ coefficients ``f ``. The initial state of the filter is computed so
92+ that its response to a step function is steady state. Before
93+ filtering, the data is extrapolated at both ends with an
94+ odd-symmetric extension of length
7095 ``3*(max(length(b), length(a))-1) ``.
7196
7297 Because ``filtfilt `` applies the given filter twice, the effective
@@ -84,6 +109,7 @@ Filter application
84109 choosing the optimal algorithm based on the lengths of ``b `` and
85110 ``x ``.
86111
112+
87113Filter design
88114-------------
89115
@@ -95,6 +121,7 @@ Filter design
95121
96122 Construct a digital filter.
97123
124+
98125Filter response types
99126---------------------
100127
0 commit comments