Skip to content

Commit dfd3fcb

Browse files
committed
Update README.md and python-publish.yml
1 parent 50260ec commit dfd3fcb

File tree

2 files changed

+38
-47
lines changed

2 files changed

+38
-47
lines changed

.github/workflows/python-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525
- name: Set up Python
26-
uses: actions/setup-python@v3
26+
uses: actions/setup-python@v5
2727
with:
2828
python-version: '3.x'
2929
- name: Install dependencies

README.md

+37-46
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
[![DOI](https://zenodo.org/badge/862362090.svg)](https://zenodo.org/doi/10.5281/zenodo.13838577)
22

3-
# **Generating coherence-constrained multisensor signals using balanced mixing and spectrally smooth filters**
4-
5-
Project Overview
6-
====================
7-
This project provides a Python function for generating multi-channel audio signals with predefined spatial coherence.
8-
9-
Abstract
3+
**Generating coherence-constrained multisensor signals using balanced mixing and spectrally smooth filters**
104
====================
115

12-
The spatial properties of a noise field can be described by a spatial coherence function. Synthetic multichannel noise signals exhibiting a specific spatial coherence can be generated by properly mixing a set of uncorrelated, possibly nonstationary, signals. The mixing matrix can be obtained by decomposing the spatial coherence matrix. As proposed in a widely used method, the factorization can be performed using a Cholesky or an eigenvalue decomposition. The limitations of these two methods are discussed and addressed in [[1]](#1). In particular, specific properties of the mixing matrix are analyzed, namely the spectral smoothness and the mix balance. The first quantifies the mixing matrix-filters variation across frequency, and the second quantifies how much each input contributes to each output. Three methods based on the unitary Procrustes solution are proposed to enhance the spectral smoothness, the mix balance, and both properties jointly. A performance evaluation confirms the improvements of the mixing matrix in terms of objective measures. Further, the evaluation results show that the error between the target and the generated coherence is lowered by increasing the spectral smoothness of the mixing matrix.
6+
## Project Overview
7+
This project provides a Python function for generating multi-channel audio signals with predefined spatial coherence.
138

14-
Method
15-
====================
9+
## Abstract
10+
The spatial properties of a noise field can be described by a spatial coherence function. Synthetic multichannel noise signals exhibiting a specific spatial coherence can be generated by properly mixing a set of uncorrelated, possibly nonstationary, signals. The mixing matrix can be obtained by decomposing the spatial coherence matrix. As proposed in a widely used method [[1]](#1), the decomposing can be performed using a Cholesky or an eigenvalue decomposition. The limitations of these two decompositions are discussed and addressed in [[2]](#2). First, specific properties of the mixing matrix are analyzed, namely the spectral smoothness and the mix balance. The first quantifies the mixing matrix-filters variation across frequency, and the second quantifies how much each input contributes to each output. Secondly, three methods based on the unitary Procrustes solution are proposed to enhance the spectral smoothness, the mix balance, and both properties jointly. A performance evaluation confirms the improvements of the mixing matrix in terms of objective measures. Further, the evaluation results show that the error between the target and the generated coherence is lowered by increasing the spectral smoothness of the mixing matrix.
1611

17-
This method is able to generate multi-channel audio signals that exhibit a predefined spatial coherence. It also enhances specific properties of the mixing matrix obtained with the baseline approach (Cholesky or eigenvalue decompositions). These properties are:<br/>
12+
## Method
13+
This method can generate multi-channel audio signals that exhibit a predefined spatial coherence. It also enhances specific properties of the mixing matrix obtained with the baseline approach (Cholesky or eigenvalue decompositions). These properties are:<br/>
1814

1915
- **Spectral Variation**: variation of the mixing matrix's filter response in the frequency domain. The mixing matrix is considered smooth if it slowly varies over frequency. For this reason, we denote a low Spectral Variation with 'Spectral Smoothness'. This variation can be quantified by the squared Frobenius norm of the difference between two frequency-bands adjacent mixing matrices.
2016
- **Coherence Error**: accuracy of the generated spatial coherence at frequency bands that are not resolved by the chosen DFT length. A mixing matrix yields a low coherence error when the squared Frobenius norm of the difference between the target coherence matrix and the generated coherence matrix is low.
2117
- **Mix Balance**: balance of the mixing, i.e., the number of input signals that contribute to each output signal. A balanced mixing matrix contains similar contributions from each input signal to each output signal. The balance can be quantified by the l1-norm of the mixing matrix.
2218

2319
The coherence error is inherently decreased by increasing the spectral smoothness. In addition, a smooth mixing matrix yields shorter impulse responses compared to non-smooth counterparts. The benefits of improving the smoothness and the balance are also perceptually evident. A smooth mix leads to less distortions in the output signals (especially during transients). A balanced mix is such that the input signals are filtered and summed similarly among all the channels, leading to an increased perceptual plausibility.
2420

25-
Settings
26-
====================
21+
## Settings
2722
Different parameters can be chosen for the signal generation (e.g., sampling frequency, DFT length, spatial coherence model). The microphone positions are arranged in a matrix (`M` x 3), i.e., *number of channels* x coordinates *xyz*. The generator works for any arbitrary 3-D microphone constellation.
2823

2924
Supported spatial coherence models:<br/>
3025
1. 3-D spherically isotropic diffuse sound field: `spherical`
3126
2. 2-D cylindrically isotropic diffuse sound field: `cylindrical`
3227
3. Corcos model (turbulent aerodynamic noise, e.g., atmospheric-wind noise): `corcos`
3328

34-
The first and second model depends solely on the microphone positions. The third model has two additional parameters: `speed` and `direction` of the turbulent airflow. When selecting this model, it is suggested to use an inter-microphone distance of less than 2 cm to appreciate differences with respect to a noise field with uncorrelated signals.
29+
The first two models depend solely on the microphone positions. The third model has two additional parameters: `speed` and `direction` of the turbulent airflow. When selecting this model, it is suggested to use an inter-microphone distance of less than 2 cm to appreciate differences with respect to a noise field with uncorrelated signals.
3530

3631
Supported factorization methods to decompose the target coherence matrix and obtain the mixing matrix:
3732
1. Cholesky decomposition: `chd`
@@ -47,46 +42,42 @@ Three methods are available to enhance the properties of the mixing matrix:
4742

4843
The `smooth` method enhances the smoothness (i.e., decreases the spectral variation) and lowers the coherence error while leaving almost unaltered the mix balance. The `balanced` method maximizes the balance but significantly increases the spectral variation and the coherence error. The `balanced+smooth` method enhances both properties with a reasonable trade-off. The `standard` method leaves the Cholesky or the eigenvalue decomposition unaltered.
4944

50-
Installation
51-
====================
45+
## Installation
5246
```ruby
53-
pip install anf-generator
47+
pip install anf-generator
5448
```
5549

56-
Example Code
57-
====================
50+
## Example Code
5851
```ruby
59-
import numpy as np
60-
import anf_generator as anf
61-
62-
# Define signals
63-
duration = 10 # Duration in seconds
64-
num_channels = 4 # Number of microphones
65-
66-
# Define target spatial coherence
67-
params = anf.CoherenceMatrix.Parameters(
68-
mic_positions=np.array([[0.04 * i, 0, 0] for i in range(num_channels)]),
69-
sc_type="spherical",
70-
sample_frequency=16000,
71-
nfft=1024,
72-
)
73-
74-
# Generate "num_channels" mutually independent input signals of length "duration"
75-
input_signals = np.random.randn(num_channels, duration * params.sample_frequency)
76-
77-
# Generate output signals with the desired spatial coherence
78-
output_signals, coherence_target, mixing_matrix = anf.generate_signals(
79-
input_signals, params, decomposition='evd', processing='balance+smooth')
52+
import numpy as np
53+
import anf_generator as anf
54+
55+
# Define signals
56+
duration = 10 # Duration in seconds
57+
num_channels = 4 # Number of microphones
58+
59+
# Define target spatial coherence
60+
params = anf.CoherenceMatrix.Parameters(
61+
mic_positions=np.array([[0.04 * i, 0, 0] for i in range(num_channels)]),
62+
sc_type="spherical",
63+
sample_frequency=16000,
64+
nfft=1024,
65+
)
66+
67+
# Generate "num_channels" mutually independent input signals of length "duration"
68+
input_signals = np.random.randn(num_channels, duration * params.sample_frequency)
69+
70+
# Generate output signals with the desired spatial coherence
71+
output_signals, coherence_target, mixing_matrix = anf.generate_signals(
72+
input_signals, params, decomposition='evd', processing='balance+smooth')
8073
```
8174

8275
Two more test scripts are provided: `tests/example.py` and `tests/example_babble.py`.
8376

84-
Audio Examples
85-
====================
77+
## Audio Examples
8678
Click [here](https://www.audiolabs-erlangen.de/resources/2020-JASA-CCR) to listen to examples generated using this method.
8779

88-
References
89-
====================
90-
<a id="1">[1]</a> D. Mirabilii, S. J. Schlecht, E.A.P. Habets, *'Generating coherence-constrained multisensor signals using balanced mixing and spectrally smooth filters'*, The Journal of the Acoustical Society of America, Vol. 149, 1425, 2021.
80+
## References
81+
<a id="1">[1]</a> E.A.P. Habets, I. Cohen and S. Gannot, *'Generating nonstationary multisensor signals under a spatial coherence constraint,'* The Journal of the Acoustical Society of America, Vol. 124, Issue 5, pp. 2911-2917, Nov. 2008. [Code](https://github.com/ehabets/ANF-Generator/releases/tag/v2008)
9182

92-
<a id="2">[2]</a> E.A.P. Habets, I. Cohen and S. Gannot, *'Generating nonstationary multisensor signals under a spatial coherence constraint,'* Journal of the Acoustical Society of America, Vol. 124, Issue 5, pp. 2911-2917, Nov. 2008. [Code](https://github.com/ehabets/ANF-Generator)
83+
<a id="2">[2]</a> D. Mirabilii, S. J. Schlecht, E.A.P. Habets, *'Generating coherence-constrained multisensor signals using balanced mixing and spectrally smooth filters'*, The Journal of the Acoustical Society of America, Vol. 149, 1425, 2021.

0 commit comments

Comments
 (0)