%% =========================================================================== % Copyright (C) 2000 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Description : Calculates the resulting margin of SDSL services in a user % defined scenario or for a predefined testloop. % Repeats the results in: ETSI STC TM6 Wien 003t18a0 Sep. 2000 % % Project : B1, FTW % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % : Gernot Schmid (gernot.schmid@arcs.ac.at) % % CVS: $Id: ExSDSLmargin.m,v 1.2 2001/08/20 10:25:54 tono Exp $ %% =========================================================================== %% =========================================================================== % Change History % 2000-05-09 (ToNo) Created as TNtest.m % 2000-07-20 (GS) Modified for comparison with Ragnar's results % 2000-10-25 (GS) Made it also applicable to user defined scenarios % 2000-11-08 (ToNo) Expanded the example of setting up a testloop % 2001-07-05 (ToNo) Now we support two-sided colored background noise %% =========================================================================== global ex; global res; %======================= Parameter Set up Section ============================ plotit=1; % If set, graphical output of scenarion and results is enabled plot_detail=0; % If set, additionally detailed loop information will be shown ex.param = setupParam; % Basic default simu. param. ex.tfplist = itu_tfplanHAM([]); % Need a HAM band definition ex.tfplist = fsan_tfplansMISC(ex.tfplist); % Get plans for alien noise ex.tfplist = fsan_noise(ex.tfplist); ex.tfplist = etsi_tfplansSDSL(ex.tfplist); ex.lclist = setupLClist; % Line code definition (Theo.) ex.lclist = fsan_lcdefs(ex.lclist); % Line code definitions (ADSL) ex.lclist = etsi_lcdefsSDSL(ex.lclist); % Line code definitions (SDSL) ex.clist = etsi_cables([]); % Get ETSI (and ANSI) cables; % Determines how the generic name ADSL is mapped to a specific linecode ex.param.xDSLlist=[]; % Set up testloop if 1, % Test a standard loop ex.param.FSANNoiseModel='Model SDSL Noise A';% Use a predefined noise model selfdisturbers = 89; % 89 for noise A and D, while only 15 for B and C symmetry = 'sym'; % Use sym or asym SDSL bitrate = 1024; % Select a bitrate loop = 4; % Select a loop % xDSL.name='SDSL'; xDSL.used=sprintf('SDSL-%s-%d',symmetry,bitrate); ex.param.xDSLlist=insertList(ex.param.xDSLlist,xDSL); xDSL.name=xDSL.used; % To fool checkEx ex.param.xDSLlist=insertList(ex.param.xDSLlist,xDSL); lens=etsi_loopsSDSLdeflen(ex.param.FSANNoiseModel,bitrate*1e3,xDSL.used); gui.ttlist = etsi_loopsSDSL([],lens(loop)); % Definition of ETSI-Testloops scenario=sprintf('SDSL-Loop%d',loop); ex.param.modemlist=str2mat(xDSL.used); else % Test a user defined SDSL loop (defined in UserLoopsSDSL.m) ex.param.FSANNoiseModel='Calculate'; % Calculate a noise model scenario='SDSL-Scenario 1'; % Scenario to be investigated % gui.ttlist = []; gui.ttlist = UserLoopsSDSL(gui.ttlist); % Def. some example loops % Modem(s) to be investigated ex.param.modemlist=str2mat('SDSL-asym-2048','SDSL-sym-1024'); xDSL.name='ADSL'; xDSL.used='ADSL'; % ADSL over POTS ex.param.xDSLlist(1)=insertList(ex.param.xDSLlist,xDSL); end; %===================== End of Set up Parameter section ===================== ex.tt = getList(gui.ttlist,scenario); % Get the scenario ex.tt = setTT(ex.tt,ex.param.xDSLlist); % Insert specific modem types % Get the max length of the loop nodes=size(ex.tt.topology,1); totlen=0; for b=2:nodes, totlen=totlen+ex.tt.topology{b,1}; end; % Create needed linecodes and tfplans for all SDSL services in the scenario ETSI_SDSL_traffic2lctf; if plotit % Show traffic and topology structure figure; plotTTstructure(ex.tt); drawnow; % Show it no end; fprintf('\n==============================================\n'); fprintf('Margin Calculation for selected SDSL-Serivces:\n'); fprintf('Scenario: %s (max length = %.0fm)\n',scenario,totlen); fprintf('Noise: %s\n\n',ex.param.FSANNoiseModel); format compact; % Evaluate this experiment at a specific bitrate result = evalExperiment; % Evaluate the margin [bitrate_LT, bitrate_NT, margin_LT, margin_NT] = calcFSANresult(ex,result); minmargin=min(margin_LT,margin_NT); % Present resulting margins on the screen dm=getDM(ex.tt.traffic,ex.param.modemlist); for current =1:length(result) tmp=ex.tt.traffic(dm(current),:); servicename=tmp{3}; node=tmp{2}-1; fprintf('Service: %14s (from CO to NT%d)\n', servicename,node); fprintf('Bitrate: \t\tLT:%g kBitps \tNT:%g kBitps\n',... bitrate_LT(current)*1e3,bitrate_NT(current)*1e3); fprintf('Resulting margin: \tLT:%2.2fdB \tNT:%2.2fdB\n\n',... margin_LT(current),margin_NT(current)); end % Plot some loop details if wanted if plot_detail, % Get the cable information and plot it segs=size(ex.tt.topology); f= ex.param.frequency.f; Att=getAtt(ex,1,segs(1),ex.tt.topology,f,ex.param.Zterm); figure; plot(f,Att,'m'); titlestr=sprintf('SDSL loop attenuation'); title(titlestr); legendstrs=sprintf('%s',scenario); legend(legendstrs); xlabel('Frequency'); ylabel('dB'); grid on; % Plot signals and noises at LT and NT for current =1:length(result) f=ex.param.frequency.f; NT_Rx=result(current).NT.Rx_signal; LT_Rx=result(current).LT.Rx_signal; NT_Tx=result(current).NT.Tx_signal; LT_Tx=result(current).LT.Tx_signal; NT_TotNoise=result(current).NT.Tot_noise.down; LT_TotNoise=result(current).LT.Tot_noise.up; SNR_NT = (NT_Rx)./(NT_TotNoise); SNR_LT = (LT_Rx)./(LT_TotNoise); modem=result(current).Modem.Name; LTnode=result(current).Modem.LT_Node; NTnode=result(current).Modem.NT_Node; figure; plot(f,10*log10(abs(NT_Tx)),... f,10*log10(abs(LT_Rx)),... f,10*log10(abs(LT_TotNoise))); legend('Tx PSD (NT)','Rx PSD (LT)','Total noise'); axis([0,2e6,-140,-30]) grid on; title(['Signals and noises for LT for ' modem ' ' int2str(LTnode) ' - ' int2str(NTnode)]); figure; plot(f,10*log10(abs(SNR_LT)),f,10*log10(abs(SNR_NT))) axis([0,2e6,-60,60]) grid on; title(['SNR for LT and NT for ' modem ' ' int2str(LTnode) ' - ' int2str(NTnode)]); legend('LT','NT'); end % for end % if plot_detail % Show the simulation results graphically if plotit, faxis.min=1e3; faxis.max=1.5e6; lowest=min([eval(ex.param.bgNoise.LT) eval(ex.param.bgNoise.NT)]); axvec=[faxis.min faxis.max lowest-20 0]; ftype='Linear'; % prepare for plotting % Plot the result from experiment for current=1:length(result), figure; tmp_str=sprintf('SDSL Simulation Result, Modem %d (%s-%s)',... current, ... ex.tt.topology{result(current).Modem.LT_Node,3}, ... ex.tt.topology{result(current).Modem.NT_Node,3}); set(gcf,'NumberTitle','off','Name',tmp_str); % Plot the LT side subplot(211) plotResult(ex,result,current,'LT',ftype,faxis); % Plot the NT side subplot(212) plotResult(ex,result,current,'NT',ftype,faxis); end end