%% =========================================================================== % Copyright (C): % 2002-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Description : Table output for ETSI ADSL performance simulations % % Project : FTW's xDSLsimu % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % Petr Kadlec (kadlec@ftw.at) % Reference: % ETSI TM6 021t31r1, Torino, Italy, 4th-8th Feb., 2002 % % CVS: $Id: TableOutputIL.m 752 2009-01-02 13:03:52Z tono $ %% =========================================================================== %% =========================================================================== % Change History % 2002-03-12 (ToNo) Created % 2002-08-08 (PeKa) Octave port % 2003-11-03 (ToNo) Lists now use cell arrays for both Octave and Matlab %% =========================================================================== global ex; % load simulation results if 1, dvec = datevec(now); % Get todays result isodate = sprintf('%4d%02d%02d',dvec(1),dvec(2),dvec(3)); savefile = sprintf('matlabADSL%s_perf',isodate); load(savefile) else load('ExampleResults/ADSLperfData') end; %% =========================================================================== % Initialize dupl = {'EC','FDD'}; ower = {'ISDN','POTS'}; noise = 'ABCD'; usds = {'DS','US'}; updwn = {'DOWN','UP'}; offsetlen=[0 0 1500 2200 1750 1750 4200 1100]; extramargin = 0.2; %% =========================================================================== % Get default structures for ETSI simulations ex.param = setupParam; % Get basic parameters [ex.tfplist, ex.param.HAMBandName] = ... etsi_tfplanHAM([]); % Need a HAM band definition ex.tfplist = fsan_modelsMISC(ex.tfplist); % Get plans for alien noise ex.tfplist = etsi_noisesADSL(ex.tfplist); % Get the ETSI ADSL noise models ex.clist = etsi_cablesADSL([]); % Get ETSI (and ANSI) cables; ex.tfplist = etsi_tfplansADSL(ex.tfplist); % Get ETSI ADSL PSD tf plans %% ======================================================================== % Decide what frequency axis to use (after setting up ex.tfplist ex.param.frequency.fastcalc = 1; % Use the fast frequency plan ex.param.frequency.max = 1.2e6; % Max frequency we want to use if ex.param.frequency.fastrecalc, tmp=[]; else tmp=df:df:256*df; end; ex.param.frequency.f = union(getMinFreqaxis(ex.param.frequency.max),tmp); ex.param.frequency.set =1; f=ex.param.frequency.f; %% =========================================================================== % Do all (2*2*4=16) tables for d=1:2, for o=1:2, for n=1:4, % ================================================================ % Get min for both downstream and upstream u=1; % dir='DS'; %config = sprintf('%s ADSL over %s %sSTREAM',... % dupl{d},ower{o},updwn{u}); varDS = sprintf('ETSI_ADSL_%s_%s_%s_%s',... ower{o},dupl{d},usds{u},noise(n)); eval(sprintf('valDS=%s;',varDS)); rDS = valDS'; u=2; % dir='US'; %config = sprintf('%s ADSL over %s %sSTREAM',... % dupl{d},ower{o},updwn{u}); varUS = sprintf('ETSI_ADSL_%s_%s_%s_%s',... ower{o},dupl{d},usds{u},noise(n)); eval(sprintf('valUS=%s;',varUS)); rUS = valUS'; % Get the minimum distance for each loop mindist = min(rUS(1,:),rDS(1,:)); % ================================================================ % Do downstream u=1; % dir='DS'; ft=300e3; bitrates=[128 512 768 1024 1544 2048 3072 4096 5120 6144]/1e3; config = sprintf('%s ADSL over %s %sSTREAM',... dupl{d},ower{o},updwn{u}); fprintf(1,'\n=================\n%s\tNoise %s\n\n',config,noise(n)); for sp=1:size(rDS,1) fprintf('%5.f %4d ',bitrates(sp)*1e3,ft/1e3); for lix=1:(size(rDS,2)) if rDS(sp,lix)>25+offsetlen(lix), if rDS(sp,lix) > mindist(lix) % Check min distance reach= mindist(lix); mch='*'; else reach= rDS(sp,lix); mch=' '; end; ilval(lix)=ADSLIL(lix,ft,reach); % Get and adjust IL ilval(lix)=floor(2*(ilval(lix)-extramargin))/2; ilmin(lix) = ADSLIL(lix,ft,offsetlen(lix)); if ilval(lix) > ilmin(lix) % Check min IL ileq=sprintf('ADSLIL(%d,%f,x)-%f',lix,ft,ilval(lix)); if onMatlab illen(lix)=fzero(inline(ileq),2000); else appendthousand=0; illen(lix)=fzero(ileq,appendthousand+2000); while (isnan(illen(lix))) appendthousand=appendthousand+1000; illen(lix)=fzero(ileq,appendthousand+2000); end end fprintf(' %2.2f%s ',ilval(lix),mch); else ilval(lix)=0; fprintf(' - '); end; else ilval(lix)=0; fprintf(' - '); end; end; fprintf('\n'); fprintf(' '); for lix=1:(size(rDS,2)) if ilval(lix) > ilmin(lix) fprintf('(%5.0f ) ',illen(lix)); else fprintf(' (-) '); end; end; fprintf('\n'); end; % ================================================================ % Do upstream u=2; if o==1, ft=150e3; else ft=75e3; end; bitrates=[64 128 256 384 512 640]/1e3; % US bitrates config = sprintf('%s ADSL over %s %sSTREAM',... dupl{d},ower{o},updwn{u}); fprintf(1,'\n=================\n%s\tNoise %s\n\n',config,noise(n)); for sp=1:size(rUS,1) fprintf('%5.f %4d ',bitrates(sp)*1e3,ft/1e3); for lix=1:(size(rUS,2)) if rUS(sp,lix)>25+offsetlen(lix), if rUS(sp,lix) > mindist(lix) % Check min distance reach= mindist(lix); mch='*'; else reach= rUS(sp,lix); mch=' '; end; ilval(lix)=ADSLIL(lix,ft,reach); % Get and adjust IL ilval(lix)=floor(2*(ilval(lix)-extramargin))/2; ilmin(lix) = ADSLIL(lix,ft,offsetlen(lix)); if ilval(lix) > ilmin(lix) % Check min IL ileq=sprintf('ADSLIL(%d,%f,x)-%f',lix,ft,ilval(lix)); if onMatlab illen(lix)=fzero(inline(ileq),2000); else appendthousand=0; illen(lix)=fzero(ileq,appendthousand+2000); while (isnan(illen(lix))) appendthousand=appendthousand+1000; illen(lix)=fzero(ileq,appendthousand+2000); end end; fprintf(' %2.2f%s ',ilval(lix),mch); else ilval(lix)=0; fprintf(' - '); end; else ilval(lix)=0; fprintf(' - '); end; end; fprintf('\n'); fprintf(' '); for lix=1:(size(rUS,2)) if ilval(lix) > ilmin(lix) fprintf('(%5.0f ) ',illen(lix)); else fprintf(' (-) '); end; end; fprintf('\n'); end; % ================================================================ end; end; end;