Skip to main content

Diffraction Enhanced Image Source Method - Arbitrary Room Geometry (DEISM-ARG)

DOI Documentation Status PyPI version

The code in this folder is able to solve the following problem:

A source and a receiver transducer with arbitrary directivity are mounted on one/two speakers; The local scattering and diffraction effects around the transducers result in complex directivity patterns. The directivity patterns can be obtained by analytical expressions, numerical simulations or measurements.

In DEISM-ARG, we can model the room transfer function between transducers mounted on one/two speakers using the image source method while incorporating the local diffraction effects around the transducers. The local diffraction effects are captured using spherical-harmonic directivity coefficients obtained on a sphere around the transducers. In addition to DEISM in shoebox rooms, DEISM-ARG can model more complex room shapes. However, for version 2.0, we now only supports convex shapes. In short, DEISM-ARG has the following features:

  1. Arbitrary directivities of the source and receiver
  2. Angle-dependent reflection coefficients, frequency- and wall-dependent impedance definition.
  3. Convex room shapes

image-20240812131054348

📚 Documentation

📖 Read the full documentation on Read the Docs

Installation

DEISM supports Python 3.9, 3.10, and 3.11 on Windows, macOS, and Linux. The current documentation is organized around the class-based workflow implemented by deism.core_deism.DEISM.

Useful entry points:

Check Python version

On macOS or Linux:

python3 --version

On Windows PowerShell:

python --version

If you do not have a supported Python version, install one from python.org.

Installation method 1: Python virtual environment

End users

On macOS or Linux:

python3 -m venv ~/.venv/deism
source ~/.venv/deism/bin/activate
python -m pip install --upgrade pip
python -m pip install deism

On Windows PowerShell:

python -m venv C:\Users\<YourUsername>\venvs\deism
C:\Users\<YourUsername>\venvs\deism\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install deism

If PowerShell blocks activation, run:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Developers

On macOS or Linux:

git clone https://github.com/audiolabs/DEISM.git
cd DEISM
python3 -m venv ~/.venv/deism_dev
source ~/.venv/deism_dev/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -e .

On Windows PowerShell:

git clone https://github.com/audiolabs/DEISM.git
cd DEISM
python -m venv C:\Users\<YourUsername>\venvs\deism_dev
C:\Users\<YourUsername>\venvs\deism_dev\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -e .

Installation method 2: Conda environment

End users

conda create -n deism python=3.9
conda activate deism
python -m pip install --upgrade pip
python -m pip install deism

Developers

git clone https://github.com/audiolabs/DEISM.git
cd DEISM
conda env create -f deism_env.yml
conda activate DEISM
python -m pip install -e .

If deism_env.yml does not work on your machine, try:

conda env create -f deism_env_exact.yml
conda activate DEISM
python -m pip install -e .

Optional build tools

DEISM can build an optional C++ helper during installation. If a compiler is missing, the package still runs, but the optional count_reflections helper will not be available.

macOS:

xcode-select --install

Ubuntu or Debian:

sudo apt-get update
sudo apt-get install build-essential g++ python3-dev

RHEL, CentOS, or Fedora:

sudo yum install gcc-c++ python3-devel

Windows:

Verify the installation

Basic import check:

python -c "import deism; print('DEISM import OK')"

Quick help check:

python examples/deism_singleparam_example.py --help

Quick smoke run:

python examples/deism_singleparam_example.py

Additional notes

  • Some plotting utilities use matplotlib with text.usetex = True, so a LaTeX installation may be needed for figure rendering. See the Matplotlib usetex documentation.
  • Most example outputs are written below outputs/.

Running DEISM

The current public workflow is class-based:

from deism.core_deism import DEISM

deism = DEISM("RIR", "shoebox")
deism.update_room()
deism.update_wall_materials()
deism.update_freqs()
deism.update_directivities()
deism.update_source_receiver()
deism.run_DEISM()

Default configuration files

DEISM selects its default YAML configuration from the pair (mode, roomtype):

Mode Room type Default config file
RTF shoebox examples/configSingleParam_RTF.yml
RIR shoebox examples/configSingleParam_RIR.yml
RTF convex examples/configSingleParam_ARG_RTF.yml
RIR convex examples/configSingleParam_ARG_RIR.yml

Workflow order

Shoebox workflow:

  • update_room()
  • update_wall_materials()
  • update_freqs()
  • update_directivities() and update_source_receiver() in either order
  • run_DEISM()

Convex workflow:

  • update_room()
  • update_wall_materials()
  • update_freqs()
  • update_source_receiver()
  • update_directivities()
  • run_DEISM()

The convex order is stricter because ARG directivity setup depends on reflection-path state computed during update_source_receiver().

Recommended starting examples

Beginner examples:

  • examples/deism_singleparam_example.py for the current shoebox path
  • examples/deism_arg_singleparam_example.py for the current convex path

Advanced or research-oriented examples:

  • examples/deisms_lc_mix_test.py
  • examples/shoebox_images_cal_compare.py
  • examples/deism_args_compare.py
  • examples/deism_arg_pra_compare.py
  • examples/deism_arg_IWAENC_fig5_fig6.py
  • examples/deism_JASA_fig8.py
  • examples/deism_JASA_fig9.py

For more detail, use the docs pages linked above instead of relying only on the older example scripts.

Directivities

Modeling the directivities of the source and receiver in the room acoustics simulation is receiving increasing attention. The directivities of the source or receiver can include both the transducer directional properties and the local diffraction and scatterring effects caused by the enclosure where the transducers are mounted. Modern smart speakers are typical embodiments of such scenarios. Human heads are also a very common case.

Simple directivities

  • Monopole

Arbitrary directivities

Some key information should be provided if you want to include your own directivity data:

  1. Frequencies at which the directivities are simulated or measured. A 1D array.
  2. The spherical sampling directions around the transducer: azimuth from $0$ ( $+x$ direction) to $2 \pi$, inclination angle from $0$ ($+z$ direction) to $\pi$. A 2D array with size (number of directions, 2).
  3. The sampled pressure field at the specified directions and frequencies. A 2D array with size (number of frequencies, number of directions).
  4. The radius of the sampling sphere. A 1D array or float number.

For more information about directivity definition used in DEISM and DEISM-ARG, please refer to the following publication:

Zeyu Xu, Adrian Herzog, Alexander Lodermeyer, Emanuël A. P. Habets, Albert G. Prinn; Acoustic reciprocity in the spherical harmonic domain: A formulation for directional sources and receivers. JASA Express Lett. 1 December 2022; 2 (12): 124801. https://doi.org/10.1121/10.0016542

Contributors

  • M. Sc. Zeyu Xu
  • Songjiang Tan
  • M. Sc. Hasan Nazım Biçer
  • Dr. Albert Prinn
  • Prof. Dr. ir. Emanuël Habets
  • Anjana Rajasekhar

Academic publications

If you use this package in your research, please cite our paper:

Zeyu Xu, Adrian Herzog, Alexander Lodermeyer, Emanuël A. P. Habets, Albert G. Prinn; Simulating room transfer functions between transducers mounted on audio devices using a modified image source method. J. Acoust. Soc. Am. 1 January 2024; 155 (1): 343–357. https://doi.org/10.1121/10.0023935

Z. Xu, E.A.P. Habets and A.G. Prinn; Simulating sound fields in rooms with arbitrary geometries using the diffraction-enhanced image source method, Proc. of International Workshop on Acoustic Signal Enhancement (IWAENC), 2024.

Configuration files

The current default configuration files are:

  • examples/configSingleParam_RTF.yml for shoebox RTF
  • examples/configSingleParam_RIR.yml for shoebox RIR
  • examples/configSingleParam_ARG_RTF.yml for convex RTF
  • examples/configSingleParam_ARG_RIR.yml for convex RIR

See docs/configuration.rst for the configuration groups and runtime parameter mappings.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deism-2.2.1.14.tar.gz (10.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

deism-2.2.1.14-cp311-cp311-win_amd64.whl (3.7 MB view details)

Uploaded CPython 3.11Windows x86-64

deism-2.2.1.14-cp311-cp311-manylinux_2_39_x86_64.whl (18.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

deism-2.2.1.14-cp311-cp311-macosx_26_0_universal2.whl (3.8 MB view details)

Uploaded CPython 3.11macOS 26.0+ universal2 (ARM64, x86-64)

deism-2.2.1.14-cp310-cp310-win_amd64.whl (3.7 MB view details)

Uploaded CPython 3.10Windows x86-64

deism-2.2.1.14-cp310-cp310-manylinux_2_39_x86_64.whl (17.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

deism-2.2.1.14-cp310-cp310-macosx_26_0_universal2.whl (3.8 MB view details)

Uploaded CPython 3.10macOS 26.0+ universal2 (ARM64, x86-64)

deism-2.2.1.14-cp39-cp39-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.9Windows x86-64

deism-2.2.1.14-cp39-cp39-manylinux_2_39_x86_64.whl (18.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.39+ x86-64

File details

Details for the file deism-2.2.1.14.tar.gz.

File metadata

  • Download URL: deism-2.2.1.14.tar.gz
  • Upload date:
  • Size: 10.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for deism-2.2.1.14.tar.gz
Algorithm Hash digest
SHA256 1ff549470dd8cad0a9c175c4ef490d5d9114454fd78152b2f4438bf5e971d993
MD5 a65579d072478e05ae34185982de2ffa
BLAKE2b-256 d57ac09b5b32b3de580812d2498ef76847b7fef6b1ba510dff31b82b30fcdefd

See more details on using hashes here.

File details

Details for the file deism-2.2.1.14-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: deism-2.2.1.14-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for deism-2.2.1.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 beb8690cf34ad0f7331251892bdd89abf4c028ae8d0cd3df4254c3c1577eee03
MD5 c3cb6c3dcf1e0ec2548ac8a36ddaf6ce
BLAKE2b-256 c7f9ef0d1e5baa6e014c7017df1e1fea03cce38d6006b15859b6e68a0266e614

See more details on using hashes here.

File details

Details for the file deism-2.2.1.14-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for deism-2.2.1.14-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6847e5c2c43bf0b6d6647d6c7e647804fd05b041a55077c1b0f676a75f01cd66
MD5 18c5db614466b343a567e07d92efda95
BLAKE2b-256 1425d686b0bec35ad68c36d0741413bdb039ff63d8567015356176fe49b823d3

See more details on using hashes here.

File details

Details for the file deism-2.2.1.14-cp311-cp311-macosx_26_0_universal2.whl.

File metadata

File hashes

Hashes for deism-2.2.1.14-cp311-cp311-macosx_26_0_universal2.whl
Algorithm Hash digest
SHA256 6346087c3e5f831251dba57d90aac5f18d5b2bc73840a94a163c5b855c7cafc6
MD5 96cad31db0ca5cd59153c0dcc6e7af6b
BLAKE2b-256 7fcd998839e5f7190e2863b8426e0c3a8f4d6e2d08b5448aba33f7c7eb89a5ec

See more details on using hashes here.

File details

Details for the file deism-2.2.1.14-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: deism-2.2.1.14-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for deism-2.2.1.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ebeb13c17ddc3bf2058563921d63490a0ce5f9186f5730ba84001828e0e5d4fb
MD5 2bd17e2405c77c1cf41127ed9401db72
BLAKE2b-256 3ddef66aa72859b17498cceccb4f9a4b1d4b6f5b74cce56cc7bc402601d597db

See more details on using hashes here.

File details

Details for the file deism-2.2.1.14-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for deism-2.2.1.14-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a98a156286eda21de7facc8c34436c6ed2a547c0fafd0b640a6830a177b04ee9
MD5 c29119b292021dbd7c3de125757b05f8
BLAKE2b-256 c1eeae73e4ce197b84591305048bbdbcc1ffefd5a2aa93f3320d94db0d9c5a28

See more details on using hashes here.

File details

Details for the file deism-2.2.1.14-cp310-cp310-macosx_26_0_universal2.whl.

File metadata

File hashes

Hashes for deism-2.2.1.14-cp310-cp310-macosx_26_0_universal2.whl
Algorithm Hash digest
SHA256 df7f573eb1afb584f02ece416981126a975dcd3523c5a2fbefee27362579e59e
MD5 e5fc1e71af5b504f3ff4ba61d1e404c8
BLAKE2b-256 449851ce2f475f586f6383e460fe3e80cb0ffaed8f5697a0915cbb5985901662

See more details on using hashes here.

File details

Details for the file deism-2.2.1.14-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: deism-2.2.1.14-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for deism-2.2.1.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b146c2ff76c546dee5d30ef8e8b06c1b46d53d23a82c51294c6891e129d595ba
MD5 61211903ac775c67d0a7cce90699eae7
BLAKE2b-256 b7831f37df3c8b823358bed4085db18db9a387e25c711219b1f2be9316997814

See more details on using hashes here.

File details

Details for the file deism-2.2.1.14-cp39-cp39-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for deism-2.2.1.14-cp39-cp39-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 cc1fa18e5420ddf4afe309c5c21e82e3045d6678744237af6b147b4ed892023b
MD5 1d1ef84b03a95406fbe7043129e21e48
BLAKE2b-256 e254fc303a6031e00a54c42b9fdcfac36a5a66d7217485844e70ff7b2beef87d

See more details on using hashes here.

Release history Release notifications | RSS feed

2.2.1.15

10 files

This release

2.2.1.14 This release

9 files

2.2.1.13

9 files

2.2.1.12

9 files

2.2.1.11

9 files

2.2.1.10

9 files

2.2.1.9

9 files

2.2.1.8

9 files

2.2.1.7

9 files

2.2.1.6

9 files

2.2.1.5

8 files

2.2.1.4

12 files

2.2.1.2

9 files

2.2.1.1

9 files

2.1.3

9 files

2.1.2

9 files

2.1.1

9 files

2.1.0

9 files

2.0.2

9 files

2.0.1

11 files

2.0

10 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page