graphics_gen.pl
上传用户:wzkunzhan
上传日期:2022-04-23
资源大小:2618k
文件大小:13k
- # File: graphics_ge.pl
- #
- # Modified OpenPhone based Voice Evaluation Tool (MOBVET) Version 0.1
- # --------------------------------------------------------------------
- # Voice Over IP Laboratory (http://www.voip.nce.ufrj.br)
- # Federal University of Rio de Janeiro
- # Copyright (c) 2002-2004 UFRJ (Federal University of Rio de Janeiro).
- # The contents of this file are subject to the Mozilla Public License
- # Version 1.0 (the "License"); you may not use this file except in
- # compliance with the License. You may obtain a copy of the License at
- # http://www.mozilla.org/MPL/
- #! c:perlbinperl.exe -w
- use GD::Graph::lines;
- use Emodel;
- require 'save.pl';
- grafico ("sideA");
- grafico ("sideB");
- sub grafico
- {
- $origem = shift;
- $logmos = $origem . ".mos";
- $logvql = $origem . ".vql";
- $logppl = $origem . ".ppl";
-
- #valores a serem completados
- $codec = "G711";
- $ta = 0;
-
- open( LOGMOS, "<$logmos");
- foreach $line (<LOGMOS>) {
-
- $mos_eoc = $line;
- }
-
-
- @net_delay = ();
- @lost = ();
- @too_late = ();
- @jitter = ();
-
- @ie_emodel = ();
- @id_emodel = ();
- @r_emodel = ();
- @mos_emodel = ();
-
- @ie_emodel_ext = ();
- @id_emodel_ext = ();
- @r_emodel_ext = ();
- @mos_emodel_ext = ();
-
-
- #@I1_ext = ();
- #@I2_ext = ();
- #@Ieav_ext = ();
-
- open( LOGVQL, "<$logvql");
-
- foreach $line (<LOGVQL>)
- {
-
-
-
- #($time, $ie_e, $id_e, $r_e, $mos_e, $ie_ee, $id_ee, $r_ee, $mos_ee, $I1_ee, $I2_ee, $Ieav_ee) = split(" ", $line);
- ($time, $ie_e, $id_e, $r_e, $mos_e, $ie_ee, $id_ee, $r_ee, $mos_ee) = split(" ", $line);
-
-
-
-
- @row_ie_emodel = ($time, $ie_e);
-
-
- for(my $i=0; $i <= $#row_ie_emodel; $i++) {
- push @{$ie_emodel[$i]}, $row_ie_emodel[$i];
- }
-
- @row_id_emodel = ($time, $id_e);
-
- for(my $i=0; $i <= $#row_id_emodel; $i++) {
- push @{$id_emodel[$i]}, $row_id_emodel[$i];
- }
-
- @row_r_emodel = ($time, $r_e);
-
- for(my $i=0; $i <= $#row_r_emodel; $i++) {
- push @{$r_emodel[$i]}, $row_r_emodel[$i];
- }
-
- @row_mos_emodel = ($time, $mos_e);
-
- for(my $i=0; $i <= $#row_mos_emodel; $i++) {
- push @{$mos_emodel[$i]}, $row_mos_emodel[$i];
- }
-
-
-
-
- @row_ie_emodel_ext = ($time, $ie_ee);
-
- for(my $i=0; $i <= $#row_ie_emodel_ext; $i++) {
- push @{$ie_emodel_ext[$i]}, $row_ie_emodel_ext[$i];
- }
-
- @row_id_emodel_ext = ($time, $id_ee);
-
- for(my $i=0; $i <= $#row_id_emodel_ext; $i++) {
- push @{$id_emodel_ext[$i]}, $row_id_emodel_ext[$i];
- }
-
- @row_r_emodel_ext = ($time, $r_ee);
-
- for(my $i=0; $i <= $#row_r_emodel_ext; $i++) {
- push @{$r_emodel_ext[$i]}, $row_r_emodel_ext[$i];
- }
-
- @row_mos_emodel_ext = ($time, $mos_ee);
-
-
-
- for(my $i=0; $i <= $#row_mos_emodel_ext; $i++) {
- push @{$mos_emodel_ext[$i]}, $row_mos_emodel_ext[$i];
- }
-
-
-
- #@row_I1_ext = ($time, $I1_ee);
- #for(my $i=0; $i <= $#row_I1_ext; $i++) {
- # push @{$I1_ext[$i]}, $row_I1_ext[$i];
- #}
- #@row_I2_ext = ($time, $I2_ee);
- #for(my $i=0; $i <= $#row_I2_ext; $i++) {
- # push @{$I2_ext[$i]}, $row_I2_ext[$i];
- #}
- #@row_Ieav_ext = ($time, $Ieav_ee);
- #for(my $i=0; $i <= $#row_Ieav_ext; $i++) {
- # push @{$Ieav_ext[$i]}, $row_Ieav_ext[$i];
- #}
-
-
-
- }
-
- close(LOGVQL);
-
- open( LOGPPL, "<$logppl");
-
- foreach $line (<LOGPPL>)
- {
-
- ($time, $rtt, $psent, $plost, $ptoo_late, $djitter) = split(" ",$line);
- #print "$time n";
-
-
- $ta = $rtt/2; #plota somente atraso na rede.
-
- @row_net_delay = ($time, $ta);
-
- for(my $i=0; $i <= $#row_net_delay; $i++) {
- push @{$net_delay[$i]}, $row_net_delay[$i];
- }
-
-
- @row_lost = ($time, $plost);
-
- for(my $i=0; $i <= $#row_lost; $i++) {
- push @{$lost[$i]}, $row_lost[$i];
- }
-
- @row_too_late = ($time, $ptoo_late);
-
- for(my $i=0; $i <= $#row_too_late; $i++) {
- push @{$too_late[$i]}, $row_too_late[$i];
- }
-
-
- @row_jitter = ($time, $djitter);
-
- for(my $i=0; $i <= $#row_jitter; $i++) {
- push @{$jitter[$i]}, $row_jitter[$i];
- }
-
-
-
- }
-
- close(LOGPPL);
-
-
-
-
- #Graficos
-
-
- $ie_e_graph = new GD::Graph::lines();
- $id_e_graph = new GD::Graph::lines();
- $r_e_graph = new GD::Graph::lines();
- $mos_e_graph = new GD::Graph::lines();
-
- $ie_ee_graph = new GD::Graph::lines();
- $id_ee_graph = new GD::Graph::lines();
- $r_ee_graph = new GD::Graph::lines();
- $mos_ee_graph = new GD::Graph::lines();
-
- $net_delay_graph = new GD::Graph::lines();
- $lost_graph = new GD::Graph::lines();
- $too_late_graph = new GD::Graph::lines();
- $jitter_graph = new GD::Graph::lines();
-
- #$I1_ee_graph = new GD::Graph::lines();
- #$I2_ee_graph = new GD::Graph::lines();
- #$Ieav_ee_graph = new GD::Graph::lines();
-
- $ie_e_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'Ie',
- title => 'Ie - Equipment Impairment',
- x_labels_vertical => 1,
- y_max_value => 100,
- y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
-
- $id_e_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'Milliseconds',
- title => 'Id - Delay Impairment',
- x_labels_vertical => 1,
- y_max_value => 100,
- y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
- $r_e_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'R-factor',
- title => 'R-factor - Emodel ITU-T G.107',
- x_labels_vertical => 1,
- y_max_value => 100,
- y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
-
- $mos_e_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'MOS',
- title => 'Mean Opnion Score',
- x_labels_vertical => 1,
- y_max_value => 5,
- y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
- $ie_ee_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'Ie',
- title => 'Ie - Equipment Impairment',
- x_labels_vertical => 1,
- y_max_value => 100,
- y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
-
- $id_ee_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'Milliseconds',
- title => 'Id - Delay Impairment',
- x_labels_vertical => 1,
- y_max_value => 100,
- y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
- $r_ee_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'R-factor',
- title => 'R-factor',
- x_labels_vertical => 1,
- y_max_value => 100,
- y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
-
- $mos_ee_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'MOS',
- title => 'Mean Opnion Score',
- x_labels_vertical => 1,
- y_max_value => 5,
- y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
-
- $net_delay_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'Milliseconds',
- title => 'Network Delay',
- x_labels_vertical => 1,
- # y_max_value => 5,
- # y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
- $lost_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'Packets',
- title => 'Packets Lost',
- x_labels_vertical => 1,
- # y_max_value => 5,
- # y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
- $too_late_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'Packets',
- title => 'Packets Discarded (Jitter Buffer)',
- x_labels_vertical => 1,
- # y_max_value => 5,
- # y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
- $jitter_graph->set(
- dclrs => [ qw(red) ],
- x_label => 'Seconds in call',
- y_label => 'Milliseconds',
- title => 'Jitter',
- x_labels_vertical => 1,
- # y_max_value => 5,
- # y_min_value => 1,
- # y_tick_number => 6,
- # y_label_skip => 2,
- x_label_skip => 10,
- markers => [1, 5],
- transparent => 0,
- );
-
- #$I1_ee_graph->set(
- # dclrs => [ qw(red) ],
- # x_label => 'Seconds in call',
- # y_label => 'Ie',
- # title => 'I1',
- # x_labels_vertical => 1,
- ## y_max_value => 100,
- # y_min_value => 0,
- ## y_tick_number => 6,
- ## y_label_skip => 2,
- ## x_label_skip => 5,
- # markers => [1, 5],
- # transparent => 0,
- #);
-
- #$I2_ee_graph->set(
- # dclrs => [ qw(red) ],
- # x_label => 'Seconds in call',
- # y_label => 'Ie',
- # title => 'I2',
- # x_labels_vertical => 1,
- ## y_max_value => 100,
- # y_min_value => 0,
- ## y_tick_number => 6,
- ## y_label_skip => 2,
- ## x_label_skip => 5,
- # markers => [1, 5],
- # transparent => 0,
- #);
- #$Ieav_ee_graph->set(
- # dclrs => [ qw(red) ],
- # x_label => 'Seconds in call',
- # y_label => 'Ie',
- # title => 'Ieav',
- # x_labels_vertical => 1,
- ## y_max_value => 100,
- # y_min_value => 0,
- ## y_tick_number => 6,
- ## y_label_skip => 2,
- ## x_label_skip => 5,
- # markers => [1, 5],
- # transparent => 0,
- #);
-
- $ie_e_graph->set_legend( 'Ie' );
- $ie_e_graph->plot(@ie_emodel);
- $name1 = $origem . "IE-Emodel" ;
- $name1save = $name1;
- save_chart($ie_e_graph, $name1save);
-
- $id_e_graph->set_legend( 'Id' );
- $id_e_graph->plot(@id_emodel);
- $name2 = $origem . "ID-Emodel";
- $name2save = $name2;
- save_chart($id_e_graph, $name2save);
-
- $r_e_graph->set_legend( 'R-Factor' );
- $r_e_graph->plot(@r_emodel);
- $name3 = $origem . "R-Emodel";
- $name3save = $name3;
- save_chart($r_e_graph, $name3save);
-
-
- $mos_e_graph->set_legend( 'MOS' );
- $mos_e_graph->plot(@mos_emodel);
- $name4 = $origem . "MOS-E-model";
- $name4save = $name4;
- save_chart($mos_e_graph, $name4save);
-
- $ie_ee_graph->set_legend( 'Ie' );
- $ie_ee_graph->plot(@ie_emodel_ext);
- $name5 = $origem . "IE-Emodel-ext";
- $name5save = $name5;
- save_chart($ie_ee_graph, $name5save);
-
- $id_ee_graph->set_legend( 'Id' );
- $id_ee_graph->plot(@id_emodel_ext);
- $name6 = $origem . "ID-Emodel-ext";
- $name6save = $name6;
- save_chart($id_ee_graph, $name6save);
-
-
- $r_ee_graph->set_legend( 'R-Factor' );
- $r_ee_graph->plot(@r_emodel_ext);
- $name7 = $origem . "R-Emodel-ext";
- $name7save = $name7;
- save_chart($r_ee_graph, $name7save);
-
- $mos_ee_graph->set_legend( 'MOS' );
- $mos_ee_graph->plot(@mos_emodel_ext);
- $name8 = $origem . "MOS-Emodel-ext";
- $name8save = $name8;
- save_chart($mos_ee_graph, $name8save);
-
- $net_delay_graph->set_legend( 'Network Delay' );
- $net_delay_graph->plot(@net_delay);
- $name9 = $origem . "Net-Delay";
- $name9save = $name9;
- save_chart($net_delay_graph, $name9save);
-
- $lost_graph->set_legend( 'Packets Lost' );
- $lost_graph->plot(@lost);
- $name10 = $origem . "Net-loss" ;
- $name10save = $name10;
- save_chart($lost_graph, $name10save);
-
- $too_late_graph->set_legend( 'Packets Discarded' );
- $too_late_graph->plot(@too_late);
- $name11 = $origem . "Buffer-loss";
- $name11save = $name11;
- save_chart($too_late_graph, $name11save);
-
- $jitter_graph->set_legend( 'Jitter' );
- $jitter_graph->plot(@jitter);
- $name12 = $origem . "Jitter";
- $name12save = $name12;
- save_chart($jitter_graph, $name12save);
- #$I1_ee_graph->set_legend( 'I1' );
- #$I1_ee_graph->plot(@I1_ext);
- #$name13 = $origem . "I1";
- #$name13save = $name13;
- #save_chart($I1_ee_graph, $name13save);
- #$I2_ee_graph->set_legend( 'I2' );
- #$I2_ee_graph->plot(@I2_ext);
- #$name14 = $origem . "I2";
- #$name14save = $name14;
- #save_chart($I2_ee_graph, $name14save);
-
- #$Ieav_ee_graph->set_legend( 'Ieav' );
- #$Ieav_ee_graph->plot(@Ieav_ext);
- #$name15 = $origem . "Ieav";
- #$name15save = $name15;
- #save_chart($Ieav_ee_graph, $name15save);
-
- }
-
-