Directivity patterns¶
In this notebook we have a look at several directivity patterns.
%matplotlib inline
from acoustic_toolbox.directivity import *
Omni-directional¶
The first directivity pattern we consider is the simplest of them all, an omni-directional pattern. The omni-directional response is equal in all directions.
d = Omni()
fig = plot(d)
Uni-directional: Cardioid¶
A cardioid pattern is a uni-directional pattern.
The response is given by $D = a \left[ \cos{\left( k \theta \right)} + 1 \right] $.
d = Cardioid()
fig = plot(d)
Bi-directional: Figure Eight¶
The figure eight is a bi-directional pattern.
d = FigureEight()
fig = plot(d)
Besides the default representation it is also possible to plot the directivity on the surface of a sphere.
fig = plot(d, sphere=True)
A directivity pattern can be sampled using spherical angles, the inclination angle $\theta$ and the azimuth $\phi$, as well as a Cartesian (unit) vector.
d.using_spherical(np.pi / 4.0, np.pi / 4.0)
np.float64(0.7071067811865476)
d.using_cartesian(0.5, 0.5, 0.5)
array([0.57735027])
Spherical Harmonics¶
Spherical harmonics can be used to represent any multipole. The omni-directional pattern shown above corresponds to a monopole, which is a spherical harmonic of degree 0 and order 0. The figure eight shown above is a dipole having degree 1. The order of that specific figure eight is 0.
d = SphericalHarmonic(m=0, n=1)
fig = plot(d)
Spherical harmonics of degree 2 correspond to a quadrupole
d = SphericalHarmonic(m=1, n=2)
fig = plot(d)
and spherical harmonics of degree 3 correspond to a Octupole.
d = SphericalHarmonic(m=-2, n=3)
fig = plot(d)