function [Rate_LT, Rate_NT, Margin_LT, Margin_NT, TPSD_LT, TPSD_NT]=calcXDSLresult(ex,result) %% =========================================================================== %calcXDSLresult - Calculate all disturbed modem bitrates % % Parameter: ex The experiment parameters % result The experiment result structure % % Returns: Rate_LT Resulting bitrates at LT side (in Mbit) % Rate_NT Resulting bitrates at NT side (in Mbit) % Margin_LT Resulting margin SNR at LT side (in dB) % Margin_NT Resulting margin SNR at NT side (in dB) % PSD_LT.val Resulting (true) Tx PSD at LT side (in dB) % PSD_NT.val Resulting (true) Tx PSD at NT side (in dB) % % % Example(s): % result = evalExperiment; % [bitrate_LT, bitrate_NT, Margin_LT, Margin_NT]=calcXDSLresult(ex,result); % % Algorithmic details: % % Reference: %% =========================================================================== %% =========================================================================== % Copyright (C): % 1998-2000 by Telia Research AB, Lulea, Sweden; % 2000-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % % Project : FTW's xDSLsimu % Author(s) : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se) % : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % : Bo Engstrom (bosse@upzide.com) % : Petr Kadlec (kadlec@ftw.at) % % CVS: $Id: calcXDSLresult.m 752 2009-01-02 13:03:52Z tono $ %% =========================================================================== % Change History % 1998-11-09 (DaB) Created % 1998-12-15 (ToNo) Added header and comments % 1998-12-17 (ToNo) Split out plotting % 1999-01-07 (DaB) Added rate without xtalk-noise % 1999-02-25 (ToNo) Generlized list (tfplist) handling % 1999-03-01 (DaB) Upadated to correct addition bug % 1999-03-03 (DaB) Renamed bg to Alien % 1999-03-11 (DaB) Added background noise to Alien noise % 1999-03-15 (DaB) Renamed Alien back to bg % 1999-08-12 (DaB) new efficiencyLoss structure to allow % different for ADSL % 1999-08-19 (DaB) Updated for new tfplan struct % 1999-08-19 (DaB) New output structure % 1999-09-30 (DaB) Rewritten for new ex struct % 2000-04-06 (UvAn) Rewritten according to new parameters % for calcResultXXX % 2001-06-20 (Bosse) Octave port % 2002-07-02 (Peka) Octave to Matlab port % 2003-11-03 (ToNo) Lists now use cell arrays for both Octave and Matlab % 2008-04-18 (ToNo) Added support for return of actual true Tx PSDs %% =========================================================================== % NEEDS EDITING if nargin<2, error('Not enough input arguments.'); end % Loop over all xDSL cases and collect bit rates n=length(result); dm=getDM(ex.tt.traffic,ex.param.modemlist); tt=setTT(ex.tt,ex.param.xDSLlist); Rate_LT=zeros(1,n); Rate_NT=zeros(1,n); Margin_LT=zeros(1,n); Margin_NT=zeros(1,n); for k=1:n, tmp=tt.traffic{dm(k)}; modem=tmp{3}; tfplan=getList(ex.tfplist,modem); lc=getList(ex.lclist,tfplan.lcname); [LT, NT, LT_margin, NT_margin, LT_PSD, NT_PSD] = ... feval(lc.calcRate,tfplan,result{k},lc,ex.param.frequency.f); Rate_LT(k)=LT; Rate_NT(k)=NT; Margin_LT(k)=LT_margin; Margin_NT(k)=NT_margin; % Note that the power PSD calculation is done "at the reciever" % Thus, to avoid some confusion we swap the LT/NT sides here TPSD_LT(k).val=NT_PSD; TPSD_NT(k).val=LT_PSD; end;