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*(
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
JAVAµÄ³ÌÐò¿ª·¢£¬µÚÒ»²½ÊÇÕë¶ÔJAVA´î½¨ÆäÓ¦Óÿª·¢Æ½Ì¨¡£¹ØÓÚJDKµÄÏÂÔØÓë°²×°Ôڴ˲»¹ý¶à½éÉÜ£¬ÍøÉÏÏà¹ØÁ´½Ó½Ï¶à¡£Æ½Ì¨µÄ´î½¨Ò»¸ö»ù´¡²½ÖèÇҹؼü²½Öè¾ÍÊÇ£ºjava»·¾³±äÁ¿µÄÅäÖá£ÍøÉϹØÓÚJAVAµÄ»·¾³±äÁ¿ÉèÖ÷½·¨ºÜ¶à£¬Æð³õ½Ó´¥JAVA¿Ï¶¨ÓÐÐí¶à²»Ã÷°×µÄµØ·½£¬ÎÒÃÇÐèÒª°Ñ²½Ö辡Á¿µÄ¼ò»¯£¬±¾È˾õµÃ±È½ÏÓÐЧµÄ·½·¨ÈçÏ ......
java»º´æ¼¼ÊõÒ»£¨×ª£©
¿´Ò»Á£É³ÖеÄÊÀ½ç£¬ Ò»¶äÒ°»¨ÖеÄÌìÌᣠ°ÑÎÞÏÞÎÕÓÚÕÆÖУ¬ °ÑÓÀºãÎÕÓÚ˲¼ä¡£——ÍþÁ®• ²¼À³¿Ë
¿ªÊ¼ÌÖÂÛ»º´æ֮ǰ,ÈÃÎÒÃÇÏÈÀ´ÌÖÂÛÌÖÂÛÁíÍâÒ»¸öÎÊÌâ:ÀíÂÛºÍʵ¼ù.´Óahuaxuan½Ó´¥µÄ³ÌÐòÔ±À´¿´,ÓеijÌÐòԱƫʵ¼ù,ÓеijÌÐòԱƫÀíÂÛ,µ«ÊÇÕⶼÊDz»ºÃµÄÐÐΪ,ÀíÂÛºÍʵ¼ùͬÑùÖØÒª,ÎÒÃÇÔÚ×öºÜ¶àº ......
2009-04-14 16:39
½üˮ¥̨ÏȵÃÔ£¬ÏòÑô»¨Ä¾Ò×Ϊ´º--------ËÕ÷ë
»º´æµÄ×÷ÓÃÔÚµÚÒ»ÂÛhttp://hi.baidu.com/%CB%BC%C3%F4%D3%EA/blog/item/908d0cdecbc8a71b495403cc.htmlÖÐÒÑÓв¿·Ö²ûÊö,ÏÂÃæahuaxuanºÍ´ó¼ÒÒ»ÆðÀ´Ñ§Ï°Ò»Ï»º´æµÃÁíÍâÒ»¸öÖØÒªµÄ¹æÔò,½üºÍ¿ì.
ÔÚÎÒÃÇ´ò¿ªä¯ÀÀÆ÷,¾ö¶¨ä¯ÀÀij¸öÍøҳ֮ǰ(Ö¸ÈËÑÛ¿´µ½ÆÁÄ»ÉϵÄÄÚÈ ......
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 ......