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_sector(d_phi, d_theta, t_test, h_axe)
%
% PURPOSE : Plot a sector for One-View Visualization (OVV) diagram displaying mobile
%           phone speech quality measurements, according to ITU-T P505 standard
%
% FUNCTION CALL : f_ovv1x_sector(d_phi, d_theta, t_test, h_axe)
%
% FUNCTION ARGUMENTS :
%
% d_phi     : (degree) angle origin of sector
% d_theta   : (degree) angle width of sector
% t_test    : structure with test name and value
% h_axe     : (optional), handle to the current axe
% 

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

function f_ovv1x_sector(d_phi, d_theta, t_test, h_axe)

if nargin < 4
    h_axe = gca;
end

[d_flag_verdict, d_rho, s_test_name, s_legeng_tag, v_legend_tips] = f_ovv1x_analysis(t_test);

if (d_flag_verdict)
    s_sector_color = 'g.';
else
    s_sector_color = 'r.';
end

s_limit_color = 'k';

d_rho_resol = 0.01;
d_angle_resol = 0.1;
d_start_angle = 4;
d_stop_angle = 4;
d_start_rho = 3;
d_stop_rho = 1;
d_line_width = 1;
d_legeng_lag_y = 0.05;
d_legeng_lag_x = 0.025;

v_rho = d_rho*(0:d_rho_resol:1).';
v_rho_biss = sqrt(2)*(0:d_rho_resol:1).'; % ref. Unit Circle
v_phi = (pi/180)*d_phi*ones(length(v_rho), 1);
v_theta = d_theta*pi/180*ones(length(v_rho), 1);
v_angle = (pi/180)*(d_phi:d_angle_resol:(d_phi + d_theta)).';
v_arc = d_rho*ones(length(v_angle), 1);
v_ang_biss = (pi/180)*(d_phi + d_theta/2)*ones(length(v_rho_biss), 1);

v_plan_ang = v_angle(d_start_angle:end-d_stop_angle) *...
                    (ones(length(v_rho(d_start_rho:end-d_stop_rho)), 1).');
v_plan_ray = (v_rho(d_start_rho:end-d_stop_rho) *...
                    (ones(length(v_angle(d_start_angle:end-d_stop_angle)), 1).')).';

polar(h_axe, v_plan_ang, v_plan_ray, s_sector_color)

polar(h_axe, v_phi, v_rho, s_limit_color);
polar(h_axe, (v_phi + v_theta), v_rho, s_limit_color);
polar(h_axe, v_angle, v_arc, s_limit_color);

set(h_axe, 'LineWidth', d_line_width);
set(h_axe, 'LineWidth', d_line_width);
set(h_axe, 'LineWidth', d_line_width);

polar(h_axe, v_ang_biss, v_rho_biss, 'k--');

if (cos(v_ang_biss(end)) > 1/sqrt(2))
    d_rho_text = 0.9 + 1/sqrt(2);
else
    if (cos(v_ang_biss(end)) < -1/sqrt(2))
        d_rho_text = 1.1 + 1/sqrt(2);
    else
        d_rho_text = 1 + 1/sqrt(2);
    end
end

h_text_scale = text(d_rho_text*cos(v_ang_biss(end)),...
               d_rho_text*sin(v_ang_biss(end)), s_test_name);
 
 set(h_text_scale, 'Fontsize', 8);
 
v_legend_pos = (sqrt((v_legend_tips - d_legeng_lag_x).^2 + d_legeng_lag_y^2));
v_legeng_ang = atan(d_legeng_lag_y./v_legend_tips);

h_text_scale = text(v_legend_pos.*cos(v_ang_biss(end) - v_legeng_ang),...
                    v_legend_pos.*sin(v_ang_biss(end) - v_legeng_ang),...
                    s_legeng_tag);
                 
set(h_text_scale, 'Fontsize', 7);

return;









Contact us at files@mathworks.com