import java.awt.GridBagLayout;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JButton;
import java.awt.GridBagConstraints;
import javax.swing.JTextField;
import java.awt.Rectangle;
import java.awt.Dimension;
import javax.swing.JList;
import javax.swing.ListModel;
import javax.swing.event.ListDataListener;
import java.lang.Object;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JTextPane;
import java.awt.Point;
import java.awt.Font;
import javax.swing.JLabel;
public class Evaluation extends JPanel {
private static final long serialVersionUID = 1L;
private JButton jButton = null;
private JTextField jTextField = null;
private JList jList1 = null;
private JButton jButton1 = null;
private JButton jButton2 = null;
private JLabel jLabel = null;
private JLabel jLabel1 = null;
private JLabel jLabel2 = null;
private JLabel jLabel3 = null;
private JLabel jLabel4 = null;
private JLabel jLabel5 = null;
private JTextField jTextField1 = null;
private JTextField jTextField2 = null;
private JTextField jTextField3 = null;
private JTextField jTextField4 = null;
private JTextField jTextField5 = null;
private JTextField jTextField6 = null;
private JTextField jTextField7 = null;
private JLabel jLabel6 = null;
private JLabel jLabel7 = null;
private JLabel jLabel8 = null;
private JLabel jLabel9 = null;
private JLabel jLabel10 = null;
private JLabel jLabel11 = null;
private JTextField jTextField8 = null;
private JTextField jTextField9 = null;
private JTextField jTextField10 = null;
private JTextField jTextField11 = null;
private JTextField jTextField12 = null;
private JTextField jTextField13 = null;
private static float a=0.4f;
private static float b1=0.2f;
private static float b2=0.2f;
private static float b3=0.2f;
public float getsize1(){
return b1;
}
public void setsize1(float s1){
b1=s1;
}
public float getsize2(){
return b1;
}
public void setsize2(float s2){
b2=s2;
}
public float getsize3(){
return b2;
}
public void setsize3(float s3){
b3=s3;
}
public float getsize4(){
return a;
}
public void setsize4(float s4){
a=s4;
}
/**
* This is the default constructor
*/
public Evaluation() {
super();
initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
jLabel11 = new JLabel();
jLabel11.setBounds(new Rectangle(331, 639, 59, 30));
jLabel11.setText("Long wait");
jLabel10 = new JLabel();
jLabel10.setBounds(new Rectangle(332, 599, 60, 29));
jLabel10.setText("Noise");
jLabel9 = new JLabel();
jLabel9.setBounds(new Rectangle(328, 559, 63, 28));
jLabel9.setText("Link success");
jLabel8 = new JLabel();
jLabel8.setBounds(new Rectangle(324, 512, 68, 30));
jLabel8.setText("Duplicate");
jLabel7 = new JLabel();
jLabel7.setBounds(new Rectangle(324, 474, 65, 24));
jLabel7.setText("Jitter");
jLabel6 = new JLabel();
jLabel6.setBounds(new Rectangle(323, 431, 65, 23));
jLabel6.setText("Packet Loss");
jLabel5 = new JLabel();
jLabel5.setBounds(new Rectangle(29, 422, 69, 30));
jLabel5.setText("Echo");
jLabel4 = new JLabel();
jLabel4.setBounds(new Rectangle(30, 469, 71, 28));
jLabel4.setText("Delay");
jLabel3 = new JLabel();
jLabel3.setBounds(new Rectangle(38, 646, 67, 33));
jLabel3.setText("Temporal clipping");
jLabel2 = new JLabel();
jLabel2.setBounds(new Rectangle(37, 601, 70, 28));
jLabel2.setText("Distortion");
jLabel1 = new JLabel();
jLabel1.setBounds(new Rectangle(35, 558, 70, 25));
jLabel1.setText("Noise Level");
jLabel = new JLabel();
jLabel.setBounds(new Rectangle(32, 512, 71, 30));
jLabel.setText("Speech Level");
this.setSize(499, 700);
this.setLayout(null);
this.add(getJButton(), null);
this.add(getJTextField(), null);
this.add(getJList1(), null);
this.add(jLabel, null);
this.add(jLabel1, null);
this.add(jLabel2, null);
this.add(jLabel3, null);
this.add(jLabel4, null);
this.add(jLabel5, null);
this.add(getJTextField1(), null);
this.add(getJTextField3(), null);
this.add(getJTextField4(), null);
this.add(getJTextField5(), null);
this.add(getJTextField6(), null);
this.add(getJTextField7(), null);
this.add(getJButton1(), null);
this.add(getJButton2(), null);
this.add(jLabel6, null);
this.add(jLabel7, null);
this.add(jLabel8, null);
this.add(jLabel9, null);
this.add(jLabel10, null);
this.add(jLabel11, null);
this.add(getJTextField8(), null);
this.add(getJTextField9(), null);
this.add(getJTextField10(), null);
this.add(getJTextField11(), null);
this.add(getJTextField12(), null);
this.add(getJTextField13(), null);
}
/**
* This method initializes jButton
*
* @return javax.swing.JButton
*/
private JButton getJButton() {
if (jButton == null) {
jButton = new JButton();
jButton.setBounds(new Rectangle(254, 33, 107, 32));
jButton.setText("Evaluation");
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
Value temp=Voice.myValue;
float echo=temp.getEcho();
float delay=temp.getDelay();
int speech=temp.getSpeech();
int noise=temp.getNoise();
float distortion=temp.getDistortion();
float clipping=temp.getClipping();
float loss=temp.getLoss();
int jitter=temp.getJitter();
float duplicate=temp.getDuplicate();
float link=temp.getLink();
float noise1=temp.getNoise1();
float wait=temp.getWait();
int echo2=temp.getEchoLevel(echo);
int delay2=temp.getDelayLeve1(delay);
int distortion2=temp.getdistortionLevel(distortion);
int clipping2=temp.getclippingLevel(clipping);
int loss2=temp.getlossLevel(loss);
int duplicate2=temp.getduplicateLevel(duplicate);
int link2=temp.getlinkLevel(link);
int noise2=temp.getnoiseLevel(noise1);
int wait2=temp.getwaitLevel(wait);
float c=a/3;
float d1=b1/3;
float d2=b2/3;
float d3=b3/3;
float p = 0,q;
float y=0;
switch(noise2){
case 5:{y=(float) (b1/3-0.04);
p=(float) ((b1-y)/2);
}
case 4:{y=(float) (b1/3-0.02);
p=(float) ((b1-y)/2);}
case 3:{y=(float) (b1/3);
p=(float) ((b1-y)/2);}
case 2:{y=(float) (b1/3+0.02);
p=(float) ((b1-y)/2);
}
case 1:{y=(float) (b1/3+0.04);
p=(float) ((b1-y)/2);
}
}
q=echo2*p+speech*p+delay2*y;
int g=link2+noise2+wait2;
float h=(loss2+duplicate2+jitter)*d3+(distortion2+clipping2+noise)*d2+q+c*g;
h=Math.round(h*100)/100;
jTextField.setText(""+h);
jTextField1.setText(""+echo2);
jTextField3.setText(""+delay2);
jTextField4.setText(""+speech);
jTextField5.setText(""+noise);
jTextField6.setText(""+distortion2);
jTextField7.setText(""+clipping2);
jTextField8.setText(""+loss2);
jTextField9.setText(""+jitter);
jTextField10.setText(""+duplicate2);
jTextField11.setText(""+link2);
jTextField12.setText(""+noise2);
jTextField13.setText(""+wait2);
}
});
}
return jButton;
}
/**
* This method initializes jTextField
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField() {
if (jTextField == null) {
jTextField = new JTextField();
jTextField.setBounds(new Rectangle(63, 25, 104, 45));
}
return jTextField;
}
/**
* This method initializes jList1
*
* @return javax.swing.JList
*/
private JList getJList1() {
if (jList1 == null) {
String[] data = {" 分数为4.0,语音质量为优","", " 分数为3.0,语音质量为良","", "
语音质量评估系统(含源代码)
2星 需积分: 50 49 浏览量
2013-06-25
10:40:29
上传
评论 9
收藏 1.21MB RAR 举报
GarvinLi
- 粉丝: 2837
- 资源: 40
最新资源
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈