Code covered by the BSD License  

Highlights from
ITU-T P505 - One-View Visualization Diagrams - GUI

image thumbnail
from ITU-T P505 - One-View Visualization Diagrams - GUI by Thierry LE GALL
This GUI implements ITU-P505 specification with automatic diagnostic (pass/fail) vs. ITU-T-P340.

f_ovv1x_diagram(h_axe)
%
% PURPOSE : Plot One-View Visualization (OVV) diagram displaying mobile phone speech quality
%           measurements, according to ITU-T P505 standard
%
% FUNCTION CALL : f_ovv1x_diagram(h_axe) 
%
% FUNCTION ARGUMENTS :
%
% h_axe          : (optional), handle to the current axe
%

%*******************************************************************************************
% COMPANY NAME : Homework
%
% FILE NAME : f_ovv1x_diagram.m
%
% AUTHOR : Thierry Le Gall - Digital Communications, Audio & Acoustic Engineer
%
% DEVELOPMENT HISTORY :
%
% Date           Name(s)       Version  Description
% -------------  ------------- -------  ------------------------------------------------
% Sep. 10, 2009  T. Le Gall    0.1      Creation
% Sep. 14, 2009  T. Le Gall    0.2      Update : User pressed cancel
%
% NOTES :
%
% Custom functions used :
%
% - f_ovv1x_read()
% - f_ovv1x_init()
% - f_ovv1x_sector()
% 
%*****************************************************************************************

function f_ovv1x_diagram(h_axe)

global t_ovv1x_static_var

% ** Supported test cases **

t_ovv1x_static_var.S_USE_CASE_HANDSET = 'HANDSET';
t_ovv1x_static_var.S_USE_CASE_HEADSET = 'HEADSET';
t_ovv1x_static_var.S_USE_CASE_HANDSFREE = 'HANDSFREE';

if (nargin == 0)
    h_axe = figure; % create figure from scratch
end

% ** Get FTA tests results from file **

[s_use_case, d_test_cases, s_sol_version, s_platform, t_fta_results] = f_ovv1x_read;
if isequal(s_use_case, '') % User pressed cancel
    return; 
end

% ** Init acceptance criteria

f_ovv1x_init(s_use_case);

% ** Set OVV diagram area

d_sector_origin = 0; % [degree]
d_sector_width = 360/d_test_cases; % [degree]

v_sectors = (0:d_sector_width:360) + d_sector_origin;

d_angle_resol = 0.1;
v_theta_unit = (pi/180)*(0:d_angle_resol:360).';
v_rho_unit = 1*ones(length(v_theta_unit), 1); 

% ** Grey background disk **

patch('xdata', 1*cos(v_theta_unit),...
      'ydata', 1*sin(v_theta_unit),...
      'facecolor', [0.7529    0.7529    0.7529],...
      'edgecolor', [0.7529    0.7529    0.7529]);

hold on

% ** OVV Sectors **

switch upper(s_use_case)
    
    case {t_ovv1x_static_var.S_USE_CASE_HANDSET,...
          t_ovv1x_static_var.S_USE_CASE_HEADSET,...
          t_ovv1x_static_var.S_USE_CASE_HANDSFREE}

        for i = 1:d_test_cases
            f_ovv1x_sector(v_sectors(i), d_sector_width, t_fta_results.test(i), h_axe);
        end 
        
    otherwise
        error(['Unknown Test Case: ', s_use_case])
       
end

% ** Unit circle + external circle **

polar(h_axe, v_theta_unit, v_rho_unit, 'k--');
polar(h_axe, v_theta_unit, sqrt(2)*v_rho_unit, 'k--');

d_axe_lim = 2.0;
axis([-d_axe_lim, d_axe_lim, -d_axe_lim, d_axe_lim]);
axis('square');
grid('off')
h_title = title([s_sol_version, ' - ', s_platform, ' - ' s_use_case, ' use case']);
set(h_title, 'Fontsize', 10);

hold off

Contact us at files@mathworks.com