evaluate

Evaluate the enhanced signals using the HAAQI metric.

recipes.cad2.task2.baseline.evaluate.adjust_level(signal: ndarray, gains_scene: dict) ndarray[source]

Adjust the level of the signal to compensate the effect of amplifying the sources

recipes.cad2.task2.baseline.evaluate.apply_gains(stems: dict, sample_rate: float, gains: dict) dict[source]

Apply gain to the signal by using LUFS.

Parameters:
  • stems (dict) – Dictionary of stems.

  • sample_rate (float) – Sample rate of the signal.

  • gains (dict) – Dictionary of gains.

Returns:

Dictionary of stems with applied gains.

Return type:

dict

recipes.cad2.task2.baseline.evaluate.load_reference_stems(music_dir: str | Path, stems: dict) dict[Any, ndarray][source]

Load the reference stems for a given scene.

Parameters:
  • music_dir (str | Path) – Path to the music directory.

  • stems (dict) – Dictionary of stems

Returns:

Dictionary of reference stems.

Return type:

dict

recipes.cad2.task2.baseline.evaluate.make_scene_listener_list(scenes_listeners: dict, small_test: bool = False) list[source]

Make the list of scene-listener pairing to process

Parameters:
  • scenes_listeners (dict) – Dictionary of scenes and listeners.

  • small_test (bool) – Whether to use a small test set.

Returns:

List of scene-listener pairings.

Return type:

list

recipes.cad2.task2.baseline.evaluate.remix_stems(stems: dict) ndarray[source]

Remix the stems into a stereo signal.

The remixing is done by summing the stems.

Parameters:

stems (dict) – Dictionary of stems.

Returns:

Stereo signal.

Return type:

ndarray

recipes.cad2.task2.baseline.evaluate.run_calculate_aq(config: DictConfig) None[source]

Evaluate the enhanced signals using the HAAQI metric.

recipes.cad2.task2.baseline.evaluate.set_song_seed(song: str) None[source]

Set a seed that is unique for the given song