irdl: Impulse Response Downloader#
Python package to download, unpack and process impulse response datasets in a unified way.
Usage (Python API)#
The package can be included in a Python script as simple as:
from irdl import get_fabian
data = get_fabian(kind='measured', hato=10)
print(data)
{'impulse_response': time domain energy Signal:
(11950, 2) channels with 256 samples @ 44100.0 Hz sampling rate and none FFT normalization,
'receiver_coordinates': 2D Coordinates object with 2 points of cshape (2, 1)
Does not contain sampling weights,
'source_coordinates': 1D Coordinates object with 11950 points of cshape (11950,)
Does not contain sampling weights}
Usage (CLI)#
Once installed, the package provides a convenient command line script which can be invoked with irdl.
$ irdl --help
Output:#
Usage: irdl [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy │
│ it or customize the installation. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ fabian Download and extract the FABIAN HRTF Database v4 from DepositOnce. │
│ miracle Download and extract the MIRACLE database from DepositOnce. │
│ sriracha Download and extract the SRIRACHA database from DepositOnce. │
╰──────────────────────────────────────────────────────────────────────────────╯
The supported datasets are available as subcommands, i.e.
$ irdl miracle --help
Output:#
Usage: irdl miracle [OPTIONS]
Download and extract the MIRACLE database from DepositOnce.
DOI: `10.14279/depositonce-20837
[1;2;33m<https://doi.org/10.14279/depositonce-20837>`_
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --scenario TEXT Name of the scenario to download. Either 'A1', │
│ 'A2', 'D1' or 'R2'. │
│ [default: A1] │
│ --dataset-split TEXT Artificial dataset split. Analogous to │
│ dataset_split in :func:get_sriracha. One of │
│ 'C1', 'C2', 'C3', 'C4', or None (default). │
│ --path TEXT Path to the directory where the data should be │
│ stored. Will be overwritten, if the environment │
│ variable IRDL_DATA_DIR is set. Default is the │
│ user cache directory. │
│ [default: /home/runner/.cache/irdl] │
│ --output-format TEXT Output format of the returned data. Either │
│ 'pyfar' (default), 'hdf5', or 'numpy'. │
│ [default: pyfar] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯