Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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µÄ³ÌÐò¿ª·¢£¬µÚÒ»²½ÊÇÕë¶ÔJAVA´î½¨ÆäÓ¦Óÿª·¢Æ½Ì¨¡£¹ØÓÚJDKµÄÏÂÔØÓë°²×°Ôڴ˲»¹ý¶à½éÉÜ£¬ÍøÉÏÏà¹ØÁ´½Ó½Ï¶à¡£Æ½Ì¨µÄ´î½¨Ò»¸ö»ù´¡²½ÖèÇҹؼü²½Öè¾ÍÊÇ£ºjava»·¾³±äÁ¿µÄÅäÖá£ÍøÉϹØÓÚJAVAµÄ»·¾³±äÁ¿ÉèÖ÷½·¨ºÜ¶à£¬Æð³õ½Ó´¥JAVA¿Ï¶¨ÓÐÐí¶à²»Ã÷°×µÄµØ·½£¬ÎÒÃÇÐèÒª°Ñ²½Ö辡Á¿µÄ¼ò»¯£¬±¾È˾õµÃ±È½ÏÓÐЧµÄ·½·¨ÈçÏ ......

Java Òì³£´¦Àí

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
public class ExceptionDefaultHandler
{
private final static String _relativeExceptionLogPath = "log";
private final static String _defaultExceptionLogFileName = "exception.log";
......

Java ×Ö·û´®µÄ ´¦Àí

 public class StringUtil
{
public static String convertToStringWithTrim(Object object)
{
if(null == object)
{
return null;
}

String returnStr = (String)object;

return Trim(returnStr);
}
public static String Trim(String str)
{
if(IsEmpty(str))
{
r ......

java ¶ÔÓÚÎļþµÄ²Ù×÷

 /**
* °ÑÖ¸¶¨µÄÄÚÈÝдµ½Ö¸¶¨Â·¾¶µÄÎı¾ÎļþÉÏ
*
* @param pathÖ¸¶¨Â·¾¶
* @param context ҪдµÄÄÚÈÝ
*/
public static void writeFile(String path, String context) {
// ´Ó¿ØÖÆ̨ÊäÈëÄÚÈÝдÈëÎļþ
try {
FileWriter fw = new FileWriter(path, true);
PrintWriter pw = new Print ......

Java/JspÅäÖÃ

JAVAÅäÖãº
1£º JAVA_HOME £º  C:\Program Files\Java\jdk1.6.0_12
2£ºCLASSPATH £º    .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
3£ºPATH £º              %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin
TomcatÅäÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ