# 7. Model-Based Rendering¶

Knowing the pressure field of the desired source $$S(\x,\w)$$ is required in order to derive the driving signal for the secondary source distribution. It can either be measured, i.e. recorded, or modeled. While the former is known as data-based rendering, the latter is known as model-based rendering. For data-based rendering, the problem of how to capture a complete sound field still has to be solved. Avni et al. [AAG+13] discuss some influences of the recording limitations on the perception of the reproduced sound field. This document will consider only model-based rendering.

Frequently applied models in model-based rendering are plane waves, point sources, or sources with a prescribed complex directivity. In the following the models used within the SFS Toolbox are presented.

## 7.1. Plane Wave¶

nk = sfs.util.direction_vector(np.radians(45))  # direction of plane wave
xs = 0, 0, 0  # center of plane wave
omega = 2 * np.pi * 800  # frequency
grid = sfs.util.xyz_grid([-1.75, 1.75], [-1.75, 1.75], 0, spacing=0.02)
p = sfs.fd.source.plane(omega, xs, nk, grid)
sfs.plot2d.amplitude(p, grid)


Fig. 7.1 Sound pressure for a monochromatic plane wave (7.1) going into the direction $$(1, 1, 0)$$. Parameters: $$f = 800$$ Hz.

The source model for a plane wave is given after [Wil99], eq. (2.24) [1] as

(7.1)$S(\x,\w) = A(\w) \e{-\i\wc \scalarprod{\n_k}{\x}},$

where $$A(\w)$$ denotes the frequency spectrum of the source and $$\n_k$$ a unit vector pointing into the direction of the plane wave.

Transformed in the temporal domain this becomes

(7.2)$s(\x,t) = a(t) * \dirac{t -\frac{\scalarprod{\n_k}{\x}}{c}},$

where $$a(t)$$ is the Fourier transformation of the frequency spectrum $$A(\w)$$.

The expansion coefficients for spherical basis functions are given after [Ahr12], eq. (2.38) as

(7.3)$\breve{S}_n^m(\theta_k,\phi_k,\w) = 4\pi\i^{-n} Y_n^{-m}(\theta_k,\phi_k),$

where $$(\phi_k,\theta_k)$$ is the radiating direction of the plane wave.

In a similar manner the expansion coefficients for circular basis functions are given as

(7.4)$\breve{S}_m(\phi_\text{s},\w) = \i^{-n} \Phi_{-m}(\phi_\text{s}).$

The expansion coefficients for linear basis functions are given after [Ahr12], eq. (C.5) as

(7.5)$\breve{S}(k_x,y,\w) = 2\pi\dirac{k_x-k_{x,\text{s}}} \chi(k_{y,\text{s}},y),$

where $$(k_{x,\text{s}},k_{y,\text{s}})$$ points into the radiating direction of the plane wave.

## 7.2. Point Source¶

xs = 0, 0, 0  # position of source
omega = 2 * np.pi * 800  # frequency
grid = sfs.util.xyz_grid([-1.75, 1.75], [-1.75, 1.75], 0, spacing=0.02)
p = sfs.fd.source.point(omega, xs, grid)
normalization = 4 * np.pi
sfs.plot2d.amplitude(normalization * p, grid)


Fig. 7.2 Sound pressure for a monochromatic point source (7.6) placed at $$(0, 0, 0)$$. Parameters: $$f = 800$$ Hz.

The source model for a point source is given by the three dimensional Green’s function after [Wil99], eq. (6.73) as

(7.6)$S(\x,\w) = A(\w) \frac{1}{4\pi} \frac{\e{-\i \wc |\x-\xs|}}{|\x-\xs|},$

where $$\xs$$ describes the position of the point source.

Transformed to the temporal domain this becomes

(7.7)$s(\x,t) = a(t) * \frac{1}{4\pi} \frac{1}{|\x-\xs|} \dirac{t - \frac{|\x-\xs|}{c}}.$

The expansion coefficients for spherical basis functions are given after [Ahr12], eq. (2.37) as

(7.8)$\breve{S}_n^m(\theta_\text{s},\phi_\text{s},r_\text{s},\w) = -\i\wc \hankel{2}{n}{\wc r_\text{s}} Y_n^{-m}(\theta_\text{s},\phi_\text{s}),$

where $$(\phi_\text{s},\theta_\text{s},r_\text{s})$$ describes the position of the point source.

The expansion coefficients for linear basis functions are given after [Ahr12], eq. (C.10) as

(7.9)$\breve{S}(k_x,y,\w) = -\frac{\i}{4} \Hankel{2}{0}{\sqrt{(\tfrac{\w}{c})^2-k_x^2} \; |y-y_\text{s}|} \chi(-k_x,x_\text{s}),$

for $$|k_x|<|\wc |$$ and with $$(x_\text{s},y_\text{s})$$ describing the position of the point source.

## 7.3. Dipole Point Source¶

xs = 0, 0, 0  # position of source
ns = sfs.util.direction_vector(0)  # direction of source
omega = 2 * np.pi * 800  # frequency
grid = sfs.util.xyz_grid([-1.75, 1.75], [-1.75, 1.75], 0, spacing=0.02)
p = sfs.fd.source.point_dipole(omega, xs, ns, grid)
sfs.plot2d.amplitude(p, grid)


Fig. 7.3 Sound pressure for a monochromatic dipole point source (7.10) placed at $$(0, 0, 0)$$ and pointing towards $$(1, 0, 0)$$. Parameters: $$f = 800$$ Hz.

The source model for a three dimensional dipole source is given by the directional derivative of the three dimensional Green’s function with respect to $${\n_\text{s}}$$ defining the orientation of the dipole source.

(7.10)\begin{aligned} S(\x,\w) &= A(\w) \frac{1}{4\pi} \scalarprod{\nabla_{\xs} \frac{\e{-\i \wc |\x-\xs|}}{|\x-\xs|}}{\n_\text{s}} \\ &= A(\w) \frac{1}{4\pi} \left( \frac{1}{|\x-\xs|} + \i\wc \right) \frac{\scalarprod{\x-\xs}{\n_\text{s}}}{|\x-\xs|^2} \e{-\i\wc |\x-\xs|}. \\ \end{aligned}

Transformed to the temporal domain this becomes

(7.11)$s(\x,t) = a(t) * \left( \frac{1}{|\x-\xs|} + {\mathcal{F}^{-1}\left\{ \frac{\i\w}{c} \right\}} \right) * \frac{\scalarprod{\x-\xs}{\n_\text{s}}}{4\pi|\x-\xs|^2} \dirac{t - \frac{|\x-\xs|}{c}}.$

## 7.4. Line Source¶

xs = 0, 0, 0  # position of source
omega = 2 * np.pi * 800  # frequency
grid = sfs.util.xyz_grid([-1.75, 1.75], [-1.75, 1.75], 0, spacing=0.02)
p = sfs.fd.source.line(omega, xs, grid)
normalization = (np.sqrt(8 * np.pi * omega / sfs.default.c)
* np.exp(1j * np.pi / 4))
sfs.plot2d.amplitude(normalization * p, grid)


Fig. 7.4 Sound pressure for a monochromatic line source (7.12) placed at $$(0, 0, 0)$$. Parameters: $$f = 800$$ Hz.

The source model for a line source is given by the two dimensional Green’s function after [Wil99], eq. (8.47) as

(7.12)$S(\x,\w) = -A(\w) \frac{\i}{4} \Hankel{2}{0}{\wc |\x-\xs|}.$

Applying the large argument approximation of the Hankel function [Wil99], eq. (4.23) and transformed to the temporal domain this becomes

(7.13)$s(\x,t) = a(t) * \mathcal{F}^{-1}\left\{\sqrt{ \frac{c}{\i\w}}\right\} * \sqrt{\frac{1}{8\pi}} \frac{1}{\sqrt{|\x-\xs|}} \dirac{t - \frac{|\x-\xs|}{c}}.$

The expansion coefficients for spherical basis functions are given after [HS15], eq. (15) as

(7.14)$\breve{S}_n^m(\phi_\text{s},r_\text{s},\w) = -\pi \i^{m-n+1} \Hankel{2}{m}{\wc r_\text{s}} Y_n^{-m}(0,\phi_\text{s}).$

The expansion coefficients for circular basis functions are given as

(7.15)$\breve{S}_m(\phi_\text{s},r_\text{s},\w) = -\frac{\i}{4} \Hankel{2}{m}{\wc r_\text{s}} \Phi_{-m}(\phi_\text{s}).$

The expansion coefficients for linear basis functions are given as

(7.16)$\breve{S}(k_x,y_\text{s},\w) = -\frac{\i}{2} \frac{1}{\sqrt{(\wc )^2-k_x^2}} \chi(k_y,y_\text{s}).$
 [1] Note that [Wil99] defines the Fourier transform with transposed signs as $$F(\w) = \int f(t) \e{\i\w t}$$. This leads also to changed signs in his definitions of the Green’s functions and field expansions.