# Allpass impulse response modelling

Matthew R Flax<EMAIL_ADDRESS>
This document defines a method for FIR system modelling which is very trivial
as it only depends on phase introduction and removal (allpass filters). As
magnitude is not altered, the processing is numerically stable. It is limited
to phase alteration which maintains the time domain magnitude to force a
system within its linear limits.

##  1 Introduction

A trivial method for capturing the impulse response of a system is to force it
with impulses. The captured response is the impulse model (impulse response)
of the system. In practice forcing systems with impulses either requires high
energy signals or a very long time to stack captures to reduce noise. Problems
with using high energy signals is that the systems become nonlinear and the
impulse models do not represent the linear components of system accurately.

By spreading the signal energy out in time, other common approaches are to use
uncorrelated noise signals or chirping sinusoids. The captured output of the
system from these forcing signals is then processed in magnitude and phase to
generate the impulse model of the system. For example the Levinson-Durban
algorithm is an auto-regressive process which uses signal correlations and
cross correlations to generate the impulse model [1]. For a long impulse
model, the Levinson-Durban algorithm becomes computationally complex and takes
a long time.

Another direct method for impulse model generation is to simply divide the
captured signal (in the Fourier domain) from the reference signal which is a
simple form of deconvolution. This simple method of deconvolution is
numerically unstable for signals with no power at particular frequencies.

This document introduces a simple method for finite impulse response (FIR)
system identification. It is a very simple approach and is numerically stable.
The approach uses a band limited impulse (Section 2) and applies an allpass
filter to generate a linear chirp (Section 3). A system is forced with this
linear chirp (Section 4) and the impulse model of the system is produced by
removing the phase of the allpass filter (5). As magnitude is not used in the
processing, it is numerically stable.

The accuracy of the technique presented in this document is limited by the
noise level in the captured signal, as noise is not suppressed by anything
other then stacking.

##  2 Zero phase impulse

A zero phase band limited impulse ($\Delta$, with minimum frequency ($f_{i}$)
and maximum frequency ($f_{a}$)) is defined for frequencies between 0 and the
half the sample rate ($f_{s}$)

$\displaystyle\Delta_{f_{i},f_{a}}$ $\displaystyle=\begin{cases}0&0\leq
f<f_{i}\\\ 2N^{-1}&f_{i}\leq f\leq f_{a}\\\
0&f_{a}<f\leq\frac{f_{s}}{2}\end{cases}$ (1)

where N is the number of samples in the signal and $\Delta$ is the discrete
Fourier transform of $\delta$111In this document lower case symbols represent
signals in the time domain and upper case symbols represent signals in the
discrete Fourier domain. This band limited impulse is shown in Figure 1.

Figure 1: Band limited impulse

##  3 Allpass chirping filter

The band limited zero phase impulse $\Delta$ is filtered to a linear chirp
using the relationship between instantaneous frequency and phase
($\phi=2\pi\int fdn$)

$\displaystyle f_{c}$
$\displaystyle=\frac{1}{2T}\left(\left(f_{a}-f_{i}\right)t+f_{i}\right)$
$\displaystyle\phi_{c}$
$\displaystyle=2\pi\int\frac{1}{2T}\left(\left(f_{a}-f_{i}\right)t+f_{i}\right)dt$
$\displaystyle=\frac{\pi}{T}\left(\left(f_{a}-f_{i}\right)t^{2}+f_{i}t\right)+c$
(2)

where T is the total duration of the signal and $c$ is a constant. The
definition of the reference filter (r) is the convolution of the band limited
impulse (Equation 1) with the all pass filter (phase specified in Equation 2)

$R=\Delta_{f_{i},f_{a}}e^{j\phi_{c}}$

shown in Figure 2

Figure 2: A linear chirp formed by allpass filtering a band limited impulse.

##  4 Forcing the system

A system is forced by the reference signal (r). In this theoretical treatment,
a random wide band system is used (h), shown in Figure 3. The forced system
response (y) is defined as

$Y=HR$

Figure 3: A random wide band system used in this theoretical experiment.

##  5 Generating the impulse model

To find the impulse model ($\hat{h}$), the forced system (y) is filtered by
the inverse allpass filter

$\displaystyle\hat{H}$ $\displaystyle=Ye^{-j\phi_{c}}$ (3)
$\displaystyle=HRe^{-j\phi_{c}}$
$\displaystyle=H\Delta_{f_{i},f_{a}}e^{j\phi_{c}}e^{-j\phi_{c}}$
$\displaystyle=H\Delta_{f_{i},f_{a}}$

which is the system convolved by a bandlimited impulse (in other words, the
band limited system itself), shown in Figure 4. The error between the system
and the impulse model of the system is shown by the bottom image in Figure 4.
There is very little error in the band of the impulse, outside the band of the
impulse, the system is not defined. This highlights the power of using only
phase and not magnitude in the computation, the resulting impulse model is
numerically stable.

Figure 4: The narrow band impulse model of the wideband system. The blue line
is the system from Figure 3 and the red line is the impulse model of the
system found using Equation 3.

##  6 Frequency doubling

[take 1]Exponential sweeping of the frequency from DC is defined as

$\displaystyle\omega_{c}$
$\displaystyle=\omega_{i}2^{\left(\frac{t}{T}log_{2}\frac{\left(\omega_{a}\right)}{\left(\omega_{i}\right)}\right)}$
$\displaystyle=\omega_{i}\left(\frac{\omega_{a}}{\omega_{i}}\right)^{\frac{t}{T}}$
$\displaystyle\phi_{c}$ $\displaystyle=\int\omega_{c}dt$
$\displaystyle=\frac{\omega_{i}T\left(\frac{\omega_{a}}{\omega_{i}}\right)^{\frac{t}{T}}}{log\left(\frac{\omega_{a}}{\omega_{i}}\right)}+c$

where the constant c can be set to keep the phase zero at time zero

$c=-\frac{\omega_{i}T}{log\left(\frac{\omega_{a}}{\omega_{i}}\right)}$

In order to keep the amplitude constant for all frequencies a new amplitude
scaling term ($a_{c}$) is introduced

$\displaystyle a_{c}$ $\displaystyle=\left(\frac{d\omega_{c}}{dt}\right)^{-1}$
$\displaystyle=\frac{\omega_{i}log\left(\frac{\omega_{a}}{\omega_{i}}\right)\left(\frac{\omega_{a}}{\omega_{i}}\right)^{\frac{t}{T}}}{T}$

[take 2] Exponential sweeping of the frequency from DC is defined as

$\displaystyle\omega_{c}$
$\displaystyle=2^{\left(\frac{t}{T}log_{2}(\omega_{a}+1)\right)}-1$
$\displaystyle=(\omega_{a}+1)^{\frac{t}{T}}-1$ $\displaystyle\phi_{c}$
$\displaystyle=\int\omega_{c}dt$
$\displaystyle=\frac{T\left(\omega_{a}+1\right)^{\frac{t}{T}}}{log\left(\omega_{a}+1\right)}-t+c$

where the constant c can be set to keep the phase zero at time zero

$c=-\frac{T}{log\left(\omega_{a}+1\right)}$

In order to keep the amplitude constant for all frequencies a new amplitude
scaling term ($a_{c}$) is introduced

$\displaystyle a_{c}$ $\displaystyle=\left(\frac{d\omega_{c}}{dt}\right)^{-1}$
$\displaystyle=\frac{T}{log\left(\omega_{a}+1\right)}\left(\omega_{a}+1\right)^{-\frac{t}{T}}$

[This is old] Exponential sweeping of the frequency is defined as

$\displaystyle f_{c}$
$\displaystyle=f_{i}2^{\left(\frac{t}{T}log_{2}\left(\frac{f_{a}}{f_{i}}\right)\right)}$
$\displaystyle\phi_{c}$ $\displaystyle=2\pi\int f_{c}dt$
$\displaystyle=\frac{2\pi
Tf_{i}}{log\left(\frac{f_{a}}{f_{i}}\right)}\left(\frac{f_{a}}{f_{i}}\right)^{\frac{t}{T}}+c$

In order to keep the amplitude constant for all frequencies a new amplitude
scaling term ($a_{c}$) is introduced

$\displaystyle a_{c}$ $\displaystyle=a_{i}\frac{df_{c}}{dt}$
$\displaystyle=a_{i}\frac{f_{i}log\left(\frac{f_{a}}{f_{i}}\right)}{T}\left(\frac{f_{a}}{f_{i}}\right)^{\frac{t}{T}}$

##  7 Conclusion

This document defines a method for FIR system modelling which is very trivial
as it only depends on phase introduction and removal (allpass filters). As
magnitude is not altered, the processing is numerically stable. It is limited
to phase alteration which maintains the time domain magnitude to force a
system within its linear limits.

The approach starts with a band limited double sided impulse (zero phase - see
Section 2). The impulse is filtered (using an allpass filter) to produce a
linear chirp, in Section 3, see Figure 2. This chirp is used to force a system
(in our example a random system \- shown in Figure 3). Finally to find the
impulse model of the system, an inverted phase allpass filter is used to
produce a band limited model of the system (see Figure 4).

The resulting system model captures both the phase and magnitude of the
system, but only within the specified frequency limits of the band limited
impulse.

## References

  * [1] J.G. Proakis and D.G. Manolakis.  Digital signal processing.  Macmillan Publishing Co., Inc., 3rd edition, 1992.