%% =========================================================================== % Copyright (C): % 1998-2000 by Telia Research AB, Lulea, Sweden; % 2000-2003 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % % Description : Main simulation program, a first example % % File : Main.m % Project : FTW's xDSLsimu % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se) % : Bo Engstrom (bosse@upzide.com) % % CVS: $Id: Main.m,v 3.3 2003/11/10 16:16:06 tono Exp $ %% =========================================================================== %% =========================================================================== % Change History % 1998-11-12 (ToNo) Created % 1998-11-13 (ToNo) Modified to the split of experiment setup % 1998-12-08 (DaB) Updated % 1998-12-21 (ToNo) Updated to get in sync with uiMain % 1998-01-07 (ToNo) Removed modem under test % 1998-01-14 (ToNo) Fixed spelling of FTTEx (Thanks Gye Tae Kihl) % 1998-01-14 (ToNo) Updated to get in sync with uiMain % 1999-02-05 (DaB) Changed to fit new param structure % 1999-02-25 (ToNo) Generlized list (tfplist) handling % 1999-03-25 (ToNo) Restructured the source (moved into subdir xdslcomm) % 2000-04-05 (UvAn) New return value from itu_tfplanHAM % 2001-06-15 (Bosse) Octave port % 2003-11-03 (ToNo) Lists now use cell arrays for both Octave and Matlab %% =========================================================================== global ex; global res; % Test if we have problem reading numbers in international OS versions if 3 == 3.14, error(['Matlab thinks 3 is equal to 3.14, ' ... 'please use an US (or posix C) version of the system. ' ... 'Or add LC_NUMERIC=us into $MATLAB/bin/.matlab5rc.sh' ]); end scenario='FSAN scenario FTTEx #1'; gui.vdslDuplex = 'VDSL-FDD'; % Duplex method for VDSL % Set up default experiment structures ex.param = setupParam; % Parameters [ex.tfplist, ex.param.HAMBandName] = ... itu_tfplanHAM([]); % Need a HAM band definition ex.tfplist = fsan_modelsMISC(ex.tfplist); % Get plans for alien noise ex.lclist = setupLClist; % Line code definition (theoretical) ex.lclist = etsi_lcdefsADSL(ex.lclist); % Line code definitions (ADSL) ex.clist = etsi_cablesVDSL([]); % Get ETSI (and ANSI) cables; ex.tfplist = etsi_tfplansVDSL(ex.tfplist); % Get plan VDSL-FDD gui.ttlist = fsan_loopsVDSL([]); % Some FSAN Topologies ex.tt = getList(gui.ttlist,scenario); % Get our example scenario % Test both ADSL and VDSL ex.param.modemlist=['VDSL';'ADSL']; xDSL=getList(ex.param.xDSLlist,'VDSL'); xDSL.used=gui.vdslDuplex; ex.param.xDSLlist=setList(ex.param.xDSLlist,xDSL.name,xDSL); xDSL.name='ADSL'; xDSL.used='ADSL'; ex.param.xDSLlist=insertList(ex.param.xDSLlist,xDSL); % Show traffic and topology structure figure(1); plotTTstructure(ex.tt); % Show PSD masks for VDSL modem tfplan = getList(ex.tfplist,gui.vdslDuplex); figure(2);graw('reset;'); gui.fax.min=1e3; gui.fax.max=12e6; plotTFplan(tfplan,'Lin',gui.fax); %drawnow; % Show it now % Evaluate this experiment result = evalExperiment; % Show the result from the experiment format compact [bitrate_LT, bitrate_NT]=calcXDSLresult(ex,result); disp('LT Rates') disp(bitrate_LT) disp('NT Rates') disp(bitrate_NT) disp('Ratio') disp(bitrate_NT./bitrate_LT) % Plot the result from experiment for current=1:length(result), figure; % Plot the LT side subplot(211) x=result{current}; tmp_str=sprintf('Simulation Result, Modem %d (%s-%s)\n',... current,... ex.tt.topology{x.Modem.LT_Node}{3},... ex.tt.topology{x.Modem.NT_Node}{3}); plotResult(ex,result,current,'LT',[],[],tmp_str); % Plot the NT side subplot(212) tmp_str=sprintf('%s-%s\n',... ex.tt.topology{x.Modem.LT_Node}{3},... ex.tt.topology{x.Modem.NT_Node}{3}); plotResult(ex,result,current,'NT',[],[],tmp_str); end % or do uiResults(ex,result) to get the gui interface for the results