# Mean Opinion Score (MOS)¶

The metric used for estimating voice quality is a Mean Opinion Score (MOS) based on the ITU-T E-model (► ITU-T Recommendation G.107). The inputs are network statistics such as speech codec usage, network delay, jitter, and packet loss. The modified E-model outputs an R-value, which is straightforwardly converted to a MOS value.

The MOS scale is laid out in the following table:

MOS |
Quality |
Impairment |
---|---|---|

5 |
Excellent |
Imperceptible |

4 |
Good |
Perceptible |

3 |
Fair |
Annoying |

2 |
Poor |
Very annoying |

1 |
Bad |
Impossible to communicate |

## Calculation of MOS in Paragon Active Assurance¶

The algorithm for calculating MOS in the VoIP task is given below. It follows the ITU-T E-model.

For SIP, the algorithm is the same, but the average delay (davg) is assumed to be 5 ms in this case.

The function takes the following arguments:

loss = packet loss in %

davg = average delay

dmin = minimum delay

dmax = maximum delay

ie = equipment impairment factor

bpl = packet-loss robustness factor (codec-specific)

```
float Stats::calc_mos(float loss, float davg, float dmin, float dmax, float ie, float bpl)
{
float mos, r, deff;
deff = davg + 2 * (dmax - dmin) + 10;
if (deff < 160)
{
r = 93.2 - deff / 40;
}
else
{
r = 93.2 - (deff - 120) / 12;
}
r -= ie + (95 - ie) * loss / (loss + bpl);
if (r < 0)
{
mos = 1;
}
else
{
mos = 1 + 0.035 * r + 0.000007 * r * (r - 60) * (100 - r);
}
return mos;
}
```