# allpass2wdf

Allpass to Wave Digital Filter coefficient transformation

## Description

accepts
the cell array of allpass polynomial coefficient vectors `W`

= allpass2wdf(`A`

)`A`

.
Each cell of `A`

holds the coefficients of a section
of a cascade allpass filter. `W`

is also a cell
array, and each cell of `W`

contains the transformed
version of the coefficients in the corresponding cell of `A`

.
W can be used with allpass filter objects such as `dsp.AllpassFilter`

and `dsp.CoupledAllpassFilter`

,
with structure set to `'Wave Digital Filter'`

.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

In the more general case, the input coefficients `A`

define
a cascade or multisection allpass filter. `allpass2wdf`

applies
separately to each section of the same transformation used in the
single-section case. In the single-section case, the numeric coefficients
vector *a* contains a standard polynomial representation
of an allpass filter of order 1, 2, or 4. For example, in the first
order case,

$$a=\left[{a}_{1}\right]$$

represents the first order transfer function:

$${H}_{1}(z)=\frac{{z}^{-1}+{a}_{1}}{1+{a}_{1}{z}^{-1}}$$

and in the second order case,

$$a=\left[{a}_{1},{a}_{2}\right]$$

represents the second order transfer function:

$${H}_{2}(z)=\frac{{z}^{-2}+{a}_{1}{z}^{-1}+{a}_{2}}{1+{a}_{1}{z}^{-1}+{a}_{2}{z}^{-2}}$$

.

The allpass transfer functions *H _{1}* and

*H*can also have the following alternative representations, using decoupled coefficients in vector

_{2}*w*or

_{1}*w*respectively.

_{2}$${\stackrel{~}{H}}_{1}(z)=\frac{{z}^{-1}+{w}_{1}}{1+{w}_{1}{z}^{-1}}$$

$$\stackrel{}{{\stackrel{~}{H}}_{2}(z)=\frac{{z}^{-2}+{w}_{2}(1+{w}_{1}){z}^{-1}+{w}_{1}}{1+{w}_{2}(1+{w}_{1}){z}^{-1}+{w}_{1}{z}^{-2}}}$$

For allpass coefficients, *w* is often used
to derive adaptor multipliers for Wave Digital Filter structures,
and it is required by a number of allpass based filters in DSP System Toolbox™ when `Structure`

is
set to `'Wave Digital Filter'`

(e.g. `dsp.AllpassFilter`

,
and `dsp.CoupledAllpassFilter`

).

For a given vector of section coefficients *a*, `allpass2wdf`

computes
the corresponding vector *w* such that

$$\begin{array}{l}when\text{}i\text{}=\text{}1,\text{}2\text{}or\text{}4\\ {\stackrel{~}{H}}_{i}(z)={H}_{i}(z)\end{array}$$

This results in using the following formulas:

$$\begin{array}{l}for\text{}order\text{}1:\\ {w}_{1}={a}_{1}\\ for\text{}order\text{}2:\\ {w}_{1}={a}_{2}\\ {w}_{2}=\frac{{a}_{1}}{1+{a}_{2}}\\ for\text{}order\text{}4:\\ {w}_{1}={a}_{4}\\ {w}_{3}=\frac{{a}_{2}}{1+{a}_{4}}\\ {w}_{2}={w}_{4}=0\end{array}$$

## References

[1] M. Lutovac, D. Tosic, B. Evans, *Filter Design
for Signal Processing using MATLAB and Mathematica*. Prentice
Hall, 2001.

## Version History

**Introduced in R2014a**