Name | scene-rir JSON |
Version |
1.2.0
JSON |
| download |
home_page | None |
Summary | Room Impulse Response extraction package. |
upload_time | 2025-08-03 11:25:15 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
room impulse response
rir
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# SCENE-RIR
The purpose of this package is to extract the **Room Impulse Response (RIR)** from the
recorded response signal of an appropriate excitation signal. It employs the **swept-sine
measurement method** [1]. Both **linear sweeps**—corresponding to a white spectrum
noise—and **exponential sweeps**—corresponding to a pink spectrum noise—are implemented.
The exponential swept-sine generation is based on **Angelo Farina's methodology** [2].
It is part of the **Audio Simulation Module**, developed for the Horizon Europe project *SCENE* (2023-2025):
*"Searchable multi-dimensional data lakes, supporting Cognitive film production & distribution, for the promotion of the EuropeaN Cultural HeritagE."*
## 📦 Installation
### Install via PyPI
You can install this package from [PyPI](https://pypi.org) using `pip`:
```
pip install scene-rir
```
### Install via Conda
To install this package using [conda](https://docs.conda.io), make sure you have either [Miniconda](https://docs.conda.io/en/latest/miniconda.html) or [Anaconda](https://www.anaconda.com/products/distribution) installed.
Then, run the following command:
```bash
conda install csevast::scene-rir
```
## ✅ Installation verification
To check if the package was installed successfully, try:
```
python -c "import scene_rir.rir; help(scene_rir.rir)
```
If the **scene-rir** is installed, this command will print all of its help documentation
string.
## 💻 Examples of usage
Create and save the default exponential swept-sine excitation signal.
```
from scene_rir import rir
signal = rir.SweptSineSignal()
signal.save("output/ss-signal-44100_kHz-2972_ms.wav")
```
Usage example of creating and using a swept-sine signal in a Python script.
```
from matplotlib import pyplot as plt
from scene_rir import rir
params = {
"antslcdur": 0.1,
"frqstp": 10000,
"frqstt": 100,
"pstslcdur": 0.1,
"sgllvl": -6,
"sglszeidx": 2,
"smprteidx": 5,
"ss_rtetyp": "log",
}
signal = rir.SweptSineSignal(params)
_, sglvec = signal.signal_vector()
tmevec = signal.time_vector()
sgldur = signal.sgldur
_, ax = plt.subplots()
ax.plot(tmevec, sglvec)
ax.set_xlim(0, sgldur)
ax.set_ylim(-1, 1)
plt.show()
```
Exctract the room impulse response from a recorded response signal to a
previously produced swept-sine excitation signal.
```
from scene_rir import rir
params = {
"rec_path": "input/rec-signal.wav",
"ref_path": "output/ref-signal.wav",
"sgllvl": 0,
}
irs_signal = rir.ImpulseResponseSignal(params)
irs_signal.save("output/irs-signal.wav")
```
Usage example of extracting the impulse response in a Python script.
```
import numpy as np
from matplotlib import pyplot as plt
from scene_rir import rir
par = {
"rec_path": "input/rec-signal.wav",
"ref_path": "output/ref-signal.wav",
"path": "output/irs-signal.wav",
"sgllvl": 0,
}
irs_signal = rir.ImpulseResponseSignal(par)
smprte, sglvec = irs_signal.signal_vector()
_, ax = plt.subplots()
sgldur = sglvec.size / smprte
tmevec = np.linspace(0, sgldur, sglvec.size)
ax.plot(tmevec, sglvec)
ax.set_xlim(0, sgldur)
plt.show()
```
Example of usage from command line (Windows OS):
```
> python -m scene_rir
Usage: python -m scene_rir [command] [parameter1] [parameter2]
or
python3 -m scene_rir [command] [parameter1] [parameter2]
Available commands:
save Save the default swept-sine signal.
> python -m scene_rir --help
Usage: python -m scene_rir [command] [parameter1] [parameter2]
or
python3 -m scene_rir [command] [parameter1] [parameter2]
Available commands:
save Save the default swept-sine signal.
> python -m scene_rir save my_folder/my_signal.wav
```
## ⚖️ License: GNU GPL v3.0
Copyright (C) 2025 Christos Sevastiadis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
## 📖 References
- [1]: International Organization for Standardization (2006). Acoustics — Application of new measurement methods in building and room acoustics (ISO Standard No. 18233). Retrieved from https://www.iso.org/standard/40408.html.
- [2]: Farina, A. (2000, February). Simultaneous measurement of impulse response and distortion with a swept-sine technique. In Audio Engineering Society Convention 108. Audio Engineering Society.
Raw data
{
"_id": null,
"home_page": null,
"name": "scene-rir",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "room impulse response, rir",
"author": null,
"author_email": "Christos Sevastiadis <csevast@auth.gr>",
"download_url": "https://files.pythonhosted.org/packages/32/35/1ee83a9592fc6dafd1eb0d289729e6d75974d98a5246cbcaeffc8d676f6f/scene_rir-1.2.0.tar.gz",
"platform": null,
"description": "# SCENE-RIR\n\nThe purpose of this package is to extract the **Room Impulse Response (RIR)** from the \nrecorded response signal of an appropriate excitation signal. It employs the **swept-sine \nmeasurement method** [1]. Both **linear sweeps**\u2014corresponding to a white spectrum\nnoise\u2014and **exponential sweeps**\u2014corresponding to a pink spectrum noise\u2014are implemented.\n The exponential swept-sine generation is based on **Angelo Farina's methodology** [2].\n\nIt is part of the **Audio Simulation Module**, developed for the Horizon Europe project *SCENE* (2023-2025):\n*\"Searchable multi-dimensional data lakes, supporting Cognitive film production & distribution, for the promotion of the EuropeaN Cultural HeritagE.\"*\n\n## \ud83d\udce6 Installation\n\n### Install via PyPI\n\nYou can install this package from [PyPI](https://pypi.org) using `pip`:\n\n```\npip install scene-rir\n```\n\n### Install via Conda\n\nTo install this package using [conda](https://docs.conda.io), make sure you have either [Miniconda](https://docs.conda.io/en/latest/miniconda.html) or [Anaconda](https://www.anaconda.com/products/distribution) installed.\n\nThen, run the following command:\n\n```bash\nconda install csevast::scene-rir\n```\n\n## \u2705 Installation verification\nTo check if the package was installed successfully, try:\n```\npython -c \"import scene_rir.rir; help(scene_rir.rir)\n```\nIf the **scene-rir** is installed, this command will print all of its help documentation\nstring.\n\n## \ud83d\udcbb Examples of usage\nCreate and save the default exponential swept-sine excitation signal.\n``` \nfrom scene_rir import rir\n\nsignal = rir.SweptSineSignal()\nsignal.save(\"output/ss-signal-44100_kHz-2972_ms.wav\")\n```\n\nUsage example of creating and using a swept-sine signal in a Python script.\n```\nfrom matplotlib import pyplot as plt\nfrom scene_rir import rir\n\nparams = {\n \"antslcdur\": 0.1,\n \"frqstp\": 10000,\n \"frqstt\": 100,\n \"pstslcdur\": 0.1,\n \"sgllvl\": -6,\n \"sglszeidx\": 2,\n \"smprteidx\": 5,\n \"ss_rtetyp\": \"log\",\n}\nsignal = rir.SweptSineSignal(params)\n_, sglvec = signal.signal_vector()\ntmevec = signal.time_vector()\nsgldur = signal.sgldur\n\n_, ax = plt.subplots()\nax.plot(tmevec, sglvec)\nax.set_xlim(0, sgldur)\nax.set_ylim(-1, 1)\n\nplt.show()\n```\n\nExctract the room impulse response from a recorded response signal to a\npreviously produced swept-sine excitation signal.\n\n```\nfrom scene_rir import rir\n\n\nparams = {\n \"rec_path\": \"input/rec-signal.wav\",\n \"ref_path\": \"output/ref-signal.wav\",\n \"sgllvl\": 0,\n}\nirs_signal = rir.ImpulseResponseSignal(params)\nirs_signal.save(\"output/irs-signal.wav\")\n```\n\nUsage example of extracting the impulse response in a Python script.\n```\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom scene_rir import rir\n\npar = {\n \"rec_path\": \"input/rec-signal.wav\",\n \"ref_path\": \"output/ref-signal.wav\",\n \"path\": \"output/irs-signal.wav\",\n \"sgllvl\": 0,\n}\nirs_signal = rir.ImpulseResponseSignal(par)\nsmprte, sglvec = irs_signal.signal_vector()\n\n_, ax = plt.subplots()\n\nsgldur = sglvec.size / smprte\ntmevec = np.linspace(0, sgldur, sglvec.size)\nax.plot(tmevec, sglvec)\nax.set_xlim(0, sgldur)\n\nplt.show()\n```\n\nExample of usage from command line (Windows OS):\n```\n> python -m scene_rir\nUsage: python -m scene_rir [command] [parameter1] [parameter2]\nor\npython3 -m scene_rir [command] [parameter1] [parameter2]\nAvailable commands:\nsave Save the default swept-sine signal.\n> python -m scene_rir --help\nUsage: python -m scene_rir [command] [parameter1] [parameter2]\nor\npython3 -m scene_rir [command] [parameter1] [parameter2]\nAvailable commands:\nsave Save the default swept-sine signal.\n\n> python -m scene_rir save my_folder/my_signal.wav\n```\n\n## \u2696\ufe0f License: GNU GPL v3.0\n\nCopyright (C) 2025 Christos Sevastiadis\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\n## \ud83d\udcd6 References\n\n- [1]: International Organization for Standardization (2006). Acoustics \u2014 Application of new measurement methods in building and room acoustics (ISO Standard No. 18233). Retrieved from https://www.iso.org/standard/40408.html.\n- [2]: Farina, A. (2000, February). Simultaneous measurement of impulse response and distortion with a swept-sine technique. In Audio Engineering Society Convention 108. Audio Engineering Society.\n",
"bugtrack_url": null,
"license": null,
"summary": "Room Impulse Response extraction package.",
"version": "1.2.0",
"project_urls": {
"Home": "https://sr.ht/~csevast/scene-rir/",
"Source": "https://git.sr.ht/~csevast/scene_rir"
},
"split_keywords": [
"room impulse response",
" rir"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1ffe9626d443a0f5fa27185468b78d47b85bf0ff1d5434a50e94ef885379e530",
"md5": "56a9b871394dd58829028d83eeece426",
"sha256": "1a990f5cc782f00612a7ab8009ca7db55dec8923ddb5191ecb881d1ff2445bd8"
},
"downloads": -1,
"filename": "scene_rir-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "56a9b871394dd58829028d83eeece426",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 23688,
"upload_time": "2025-08-03T11:25:13",
"upload_time_iso_8601": "2025-08-03T11:25:13.449704Z",
"url": "https://files.pythonhosted.org/packages/1f/fe/9626d443a0f5fa27185468b78d47b85bf0ff1d5434a50e94ef885379e530/scene_rir-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "32351ee83a9592fc6dafd1eb0d289729e6d75974d98a5246cbcaeffc8d676f6f",
"md5": "f6237e174282cb690c0f293dc75407f7",
"sha256": "737a34381d25a584c88db9aecf254387d64097eccc8093fec86419f48cce9e6f"
},
"downloads": -1,
"filename": "scene_rir-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "f6237e174282cb690c0f293dc75407f7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3490376,
"upload_time": "2025-08-03T11:25:15",
"upload_time_iso_8601": "2025-08-03T11:25:15.389991Z",
"url": "https://files.pythonhosted.org/packages/32/35/1ee83a9592fc6dafd1eb0d289729e6d75974d98a5246cbcaeffc8d676f6f/scene_rir-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-03 11:25:15",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "scene-rir"
}