# 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)
```

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

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

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

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

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

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)
```

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

where \(\xs\) describes the position of the point source.

Transformed to the temporal domain this becomes

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

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

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)
```

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.

Transformed to the temporal domain this becomes

## 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)
```

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

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

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

The expansion coefficients for circular basis functions are given as

The expansion coefficients for linear basis functions are given as

[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. |