Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search


Finite Difference Approximation

As introduced in Appendix L, the finite difference approximation (FDA) amounts to replacing derivatives by finite differences, or

$\displaystyle \frac{d}{dt} x(t) \isdef \lim_{\delta\to 0} \frac{x(t) - x(t-\delta)}{\delta} \approx \frac{x(n T)-x[(n-1)T]}{T} \protect$ (J.1)

for sufficiently small $ T$.J.3

See §G.2.1 for a discussion of using the FDA to model ideal vibrating strings.

Viewing Eq. (J.1) in the frequency domain, the transfer function of an ideal differentiator is $ H(s)=s$, which can be viewed as the Laplace transform of the operator $ d/dt$ (left-hand side of Eq. (J.1)). Moving to the right-hand side, the z transform of the first-order difference operator is $ (1-z^{-1})/T$. Thus, in the frequency domain, the finite-difference approximation may be performed by making the substitution

$\displaystyle s \leftarrow \frac{1-z^{-1}}{T} \protect$ (J.2)

in any continuous-time transfer function (Laplace transform of an integro-differential operator) to obtain a discrete-time transfer function (z transform of a finite-difference operator).

The inverse of substitution Eq. (J.2) is

$\displaystyle z = \frac{1}{1 - sT} = 1 + sT+ (sT)^2 + \cdots \, .
$

The FDA is a special case of the matched $ z$ transformation [340] applied to the point $ s=0$. In general, the matched $ z$ transformation maps a pole at $ s = -a$ to the point $ z =
e^{-aT}$, where $ T$ is the sampling period. Thus, each pole and zero are mapped according to

$\displaystyle z_i = e^{s_i T} = 1 + {s_i T} + \frac{(s_i T)^2}{2} + \cdots\, .
$

The actual transformation is carried out by factoring $ H(s)$ into a product of first-order terms such as $ (s+a)$, and substituting

$\displaystyle s+a \to 1 - z^{-1}e^{-aT}.
$

Setting $ a=0$ gives the FDA for $ T=1$.J.4

Since the FDA is the matched $ z$ transformation for poles and zeros at the origin of the $ s$ plane, it follows that it maps analog dc ($ s=0$) to digital dc ($ z=1$). However, that is the only ideal mapping in the frequency domain, as discussed further below.

Note that the FDA does not alias, since the conformal mapping $ s = {1 -
z^{-1}}$ is one to one, but it does warp the poles and zeros in a way which may not be desirable.

It is convenient to think of the FDA in terms of time-domain difference operators using a delay operator notation. The delay operator $ d$ is defined by

$\displaystyle d^k x(n) = x(n-k).
$

Thus, the first-order difference (derivative approximation) is represented in the time domain by $ (1-d)/T$. We can think of $ d$ as $ z^{-1}$ since, by the shift theorem for $ z$ transforms, $ z^{-k}
X(z)$ is the $ z$ transform of $ x$ delayed (right shifted) by $ k$ samples.

The obvious definition for the second derivative is

$\displaystyle {\hat{\ddot x}}(n) = \frac{(1-d)^2}{T^2} x(n)$ (J.3)

However, a better definition is

$\displaystyle {\hat{\ddot x}}(n) \isdef \frac{(d^{-1}-1)(1-d)}{T^2} x(n) = \frac{d^{-1}-2+d}{T^2}x(n)$ (J.4)

where $ d^{-1}$ denotes a unit-sample advance. This definition is preferable as long as one sample of look-ahead is available, since it avoids an operator delay of one sample. Equation (J.4) is a zero phase filter, meaning it has no delay at any frequency, while (J.3) is a linear phase filter having a delay of $ 1$ sample at all frequencies.
Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite and copy this work] 
``Physical Audio Signal Processing for Virtual Musical Instruments and Digital Audio Effects'', by Julius O. Smith III, (December 2005 Edition).
Copyright © 2006-07-01 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA  [Automatic-links disclaimer]