generate_at_mic_musdb18
Script creates the dataset for the ICASSP 2024 Grand Challenge.
It takes the music from the MUSDB18 dataset and applies the HRTF signals to simulate the music at the microphone position. The output is saved in the same format as the MUSDB18 dataset.
- The script takes as input:
The metadata of the scenes.
The metadata of the music.
The metadata of the head positions.
The HRTF signals.
The music signals.
- The script outputs:
The metadata of the music at the hearing aids microphone.
The music signals at the hearing aids microphone.
- recipes.cad_icassp_2024.generate_dataset.generate_at_mic_musdb18.apply_hrtf(signal: ndarray, hrtf_left: ndarray, hrtf_right) ndarray [source]
Applies the Left and Right HRTF to a signal.
- Parameters:
signal (ndarray) – Signal.
hrtf_left (ndarray) – Left HRTF.
hrtf_right (ndarray) – Right HRTF.
- Returns:
Signal with applied HRTF.
- Return type:
ndarray
- recipes.cad_icassp_2024.generate_dataset.generate_at_mic_musdb18.find_precreated_samples(source_dir: str | Path) list[str] [source]
Finds music tracks created in a previous run. This avoids reprocessing them.
- Parameters:
source_dir (str| Path) – Source directory.
- Returns:
List of precreated samples.
- Return type:
list[str]
- recipes.cad_icassp_2024.generate_dataset.generate_at_mic_musdb18.load_hrtf_signals(hrtf_path: str, hp: dict) tuple[ndarray, ndarray] [source]
Loads the HRTF signals for a given head position.
- Parameters:
hrtf_path (str) – Path to the HRTF signals.
hp (dict) – Head position.
- Returns:
Left and right HRTF signals.
- Return type:
tuple(ndarray, ndarray)
- recipes.cad_icassp_2024.generate_dataset.generate_at_mic_musdb18.normalise_lufs_level(signal: ndarray, reference_signal: ndarray, sample_rate: float) ndarray [source]
Normalises the signal to the LUFS level of the reference signal.
- Parameters:
signal (ndarray) – Signal to normalise.
reference_signal (ndarray) – Reference signal.
sample_rate (float) – Sample rate of the signal.
- Returns:
Normalised signal.
- Return type:
ndarray
- recipes.cad_icassp_2024.generate_dataset.generate_at_mic_musdb18.run(cfg: DictConfig) None [source]
Main function of the script.