A digital allpass filter is a filters that, while modifying a signal, does not attenuate any of it’s frequencies. The basic allpass filter has transfer function

with 0 ≤ A ≤ 1. This is an approximation of the ideal transfer function H(z) = z^{−(1 − A)}. Thus allpass filters can be used to delay a signal by a fraction of a sample. In addition, these filters have an implementation that requires less work, computationally, than would be expected. This is given by the algorithm:
for(i=0; i<length; i++)
{
Y = in[i] – state;
X = A * Y;
out[i] = state + X;
state = in[i] + X;
}
Here, the indirect nature of the algorithm is required to reduce the number of multiplies from 2 * length to length.
These simple allpass filters can also be used to build more complicated filters. This can be accomplished by performing two filters in series to achieve an allpass filter that is a better approximation of H(z) = z^{−(1 − A)}. They can also be used to create upsampling and downsampling filters. An upsampling by a factor of N can be accomplished by filtering the same signal N times with A = 1/n, 2/n,…, 1 and then interleaving the resulting signals. The comparable downsampling filter is created by deinterleaving N signals from the original, performing an allpass filter on each, and then averaging the results.
These allpass filtering techniques can be used in voice coding to handle conversion from one sampling rate to another. This is an issue that has become important with the increased popularity of wideband codecs that must be interoperable with legacy narrowband codecs. In addition, allpass filters can be useful in beamforming, where they can be used as the delay aspect of delay and sum techniques.