Skip to content

Vibrotactile Multi-Method Assessment Fusion (VibroMAF)

Reference

Vibrotactile Multi-Method Assessment Fusion.

VibroMAF

Vibrotactile Multi-Method Assessment Fusion.

Source code in vibromaf/metrics/vibromaf.py
class VibroMAF:
    """Vibrotactile Multi-Method Assessment Fusion."""

    def __init__(self, model_path: Path, spqi: SPQI, st_sim: STSIM) -> None:
        self.__model = model.load_model(model_path)
        self.__spqi = spqi
        self.__st_sim = st_sim

    def calculate(self, distorted: np.array, reference: np.array) -> float:
        signal_to_noise_ratio = nsnr(distorted, reference)
        st_sim = self.__st_sim.calculate(distorted, reference)
        spqi = self.__spqi.calculate(distorted, reference)
        return float(self.__model.predict([[signal_to_noise_ratio, st_sim, spqi]]))

vibro_maf(distorted, reference, model_path)

Wrapper function to calculate the SPQI score.

Source code in vibromaf/metrics/vibromaf.py
def vibro_maf(distorted: np.array, reference: np.array, model_path: Path) -> float:
    """Wrapper function to calculate the SPQI score."""
    metric = VibroMAF(model_path, SPQI(0.3, -2.0), STSIM(2 / 3))
    return metric.calculate(distorted, reference)