Skip to main content

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 using pip:

pip install scene-rir

Install via Conda

To install this package using conda, make sure you have either Miniconda or Anaconda installed.

Then, run the following command:

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,
}
signal = rir.SweptSineSignal(
    params,
    sgllvl=-6,
    sglszeidx=2,
    smprteidx=5,
    ss_rtetyp="log",
)
_, 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",
}
irs_signal = rir.ImpulseResponseSignal(
    params,
    sgllvl=0,
)
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

irs_signal = rir.ImpulseResponseSignal(
    rec_path="input/rec-signal.wav",
    ref_path="output/ref-signal.wav",
    path=output/irs-signal.wav",
    sgllvl=0,
)
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 General Public License v3.0 or later

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 (at your option) 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.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

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

Metadata

Release files for scene-rir 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scene-rir 1.3.0
File Size Uploaded
scene_rir-1.3.0.tar.gz 3.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for scene-rir 1.3.0
File Interpreter ABI Platform
scene_rir-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.5 MB

Release files / scene_rir-1.3.0.tar.gz

Download URL scene_rir-1.3.0.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
1498fbcbac80f1c7b911def48ff63c1ef8b23c9c878b14ffba8a6b5e197777e4
BLAKE2b-256 checksum
How to use checksums
e60d52ae2b98813a7f42d72073b0b77ba22602f4a1a1b2dd58cba9ef2a01c251
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / scene_rir-1.3.0-py3-none-any.whl

Download URL scene_rir-1.3.0-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0658cba4e4ddccc70e328300dc97c47fcf8c4c2a1492ca2f56b67b0f831f8f4
BLAKE2b-256 checksum
How to use checksums
3bd9a0b828b361326404990a6b47dc64a06a5163f1e5623ae6bf99dd786acd08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5
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