Java source code for calculating E
The Mean Opinion
Score (MOS) test is a well acccepted standard which is defined in the ITU-T
Rec.P.800.
The value of MOS
test is generated by letting large number of listeners to evaluate the quality
of the test sentences.
The test scores
are averaged to a mean score which range from 1 to 5, 1 being the worst and 5 being
the best.
The E-model which is
defined by ITU-T Rec.G.107 is a computational model converting all parameters
that affect a voice call into a single rating value R.
A VB source code was provided in G.107 for calculating R value. But considering not everybody knows VB, I would like to share some java code I used before.
public class VoIPCalculator {
/**
* This function returns R value calculated by using the passed in parameters
* See detail of each parameter in ITU-T G.107
* @param T
* @param Ppl
* @param SLR
* @param RLR
* @param Ds
* @param STMR
* @param Dr
* @param TELR
* @param WEPL
* @param Ie
* @param BPL
* @param BurstR
* @param A
* @param Nc
* @param Ps
* @param Pr
* @param qdu
* @param Nfor
* @return
*/
private static double calRValue(double T, double Ppl, double SLR,
double RLR, double Ds, double STMR, double Dr, double TELR,
double WEPL, double Ie, double BPL, double BurstR, double A,
double Nc, double Ps, double Pr, double qdu, double Nfor) {
double LSTR = STMR + Dr,
Tr = 2*T,
Ta = T;
double Nfo = Nfor + RLR;
double OLR = SLR+RLR;
double Pre = Pr + 10*Math.log10(1+Math.pow(10,
((double)(10-LSTR))/(double)10));
double Nor = RLR - 121 +Pre
+ 0.008*Math.pow((Pre-35),2);
double Nos = Ps - SLR -Ds
- 100 +0.004*Math.pow((Ps-OLR -Ds - 14),2);
double No = 10*Math.log10((Math.pow(10, (double)Nc/(double)10))
+Math.pow(10, (double)Nos/(double)10)
+Math.pow(10, (double)Nor/(double)10)
+Math.pow(10, (double)Nfo/(double)10));
double Ro = 15 - 1.5*(SLR+No);
double Q = 37 - 15*(
相关文档:
JAVA的程序开发,第一步是针对JAVA搭建其应用开发平台。关于JDK的下载与安装在此不过多介绍,网上相关链接较多。平台的搭建一个基础步骤且关键步骤就是:java环境变量的配置。网上关于JAVA的环境变量设置方法很多,起初接触JAVA肯定有许多不明白的地方,我们需要把步骤尽量的简化,本人觉得比较有效的方法如下 ......
package server;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Recta ......
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;
public class DocumentUtil
{
public static Document loadXMLByAbsolutePath(String absoluteFilePath, String logFileName)
{
SAXReader saxReader = new SAXReader();
Document document = null;
try ......
import java.util.Date;
public class TimeSpan
{
public final static TimeSpan ZERO = new TimeSpan(0);
private long _totalMilliSeconds = 0;
public TimeSpan(long totalMilliSeconds)
{
_totalMilliSeconds = totalMilliSeconds;
}
public TimeSpan(Date afterDate, Date beforeDat ......
我在玩一个网页游戏的时候总是按一个键。觉着累。所以就写了一个程序。
Robot r = new Robot();
// 按键
r.keyPress(51);
// 释放
r.keyRelease(51);
用Robot 这个实现自动化的类就可做到。实现这个游戏一直按下这个键子。
也可以做按键精灵类似的软件。但是这个类只能应用当前窗口。怎么能把这个程序固定在某 ......