function [tfplan,lcdef] = itu_tflcVDSL2_AnnexB(maskdef,peak) %% =========================================================================== %itu_tfplansVDSL2_AnnexB(tfplist) - Sets up a tfplan and a lcdef for % standard ITU VDSL2 masks AnnexB % % Parameter: maskdef Struct containing requested plan % maskdef.name short or long plan name % maskdef.profile one of 8a; 8b; 8c; 8d; 12a; 12b; 17a; 30a % maskdef.designator max carrier for AnnexM US [0 32:4:64] % peak Determines if peak=1 or average mask=0 (def.) % Returns: tfplan Structure describing the time and freq plan % lcdef Structure describing the line code structure % % Example(s): % maskdef.name = '997-M2x-A'; maskdef.profile = '12a'; % maskdef.name = 'B8-5'; maskdef.profile = '12a'; maskdef.designator=0; peak = 0; % [tfplan,lcdef] = itu_tfplcVDSL2_AnnexB(maskdef); % ex.tfplist = insertList(ex.tfplist,tfplan); % ex.lclist = insertList(ex.lclist,lcdef); % % References: % ETSI 081t15r1 VDSL2 AnnexB proposal % ITU G.993.2 (02/2006 prepublish) % ITU Draft Amendment 1 AAP R2 to G.993.2 (2007-04-NapaValley) %% =========================================================================== %% =========================================================================== % Copyright (C): % 2008-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : FTW's xDSLsimu % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % % CVS: $Id: $ %% =========================================================================== % Change History % 2008-03-19 (ToNo) Created for AnnexB % 2008-04-16 (ToNo) Added support for lcdef and used tones % and active frequencies % 2008-04-21 (ToNo) Added support maskdef.designator % 2008-09-23 (ToNo) Fixed a bug in UPBO.band definition, and efficiencyLoss % 2008-10-01 (ToNo) Fixed VDSL2 interpolation % 2008-10-01 (ToNo) Adjusted threshold for peak vs average/template % 2008-12-03 (ToNo) Correct df, srate etc for profile 30a % % Todo: Check with ETSI how to set up a template for % 997-M1x-M-8 (B7-4) as the highest upstream is 8832 kHz but the % mask goes at transmission level (-55) up to 12000 kHz. %% =========================================================================== if nargin<3, peak = 0; % default is template (average) mask end; maskname = maskdef.name; % short or long name profile = maskdef.profile; % one of 8a; 8b; 8c; 8d; 12a; 12b; 17a; 30a if isfield(maskdef,'designator') mtype = maskdef.designator; % typically a carrier [0 32:4:64 128] else mtype = 64; % let 64 (276kHz) be the default M stop carrier end; % With a2p = 0 this is a template, with a2p = 3.5 this is a peak mask if peak a2p = 3.5; % diff between peak and average mask p2a = 0; else a2p = 0; % diff between peak and average mask p2a = -3.5; end; %% =========================================================================== % Use a template, as order is important! def_tfplan = templateTFP; % And some more VDSL stuff def_tfplan.PSD.active.upstream = [25e3 30e6]; def_tfplan.PSD.active.downstream = [138e3 30e6]; % Select upstream power back-off method def_tfplan.PSD.UPBO.method = 'RefRef'; def_tfplan.PSD.UPBO.param.refa = [-47.3 -54 -54 -54]; % To be changed def_tfplan.PSD.UPBO.param.refb = [-27.27 -18.1 -18 -18]; def_tfplan.PSD.HAM.active = 0; def_tfplan.timeDivision.up = 1; def_tfplan.timeDivision.down = 1; def_tfplan.timeDivision.sync = 1; def_tfplan.fixBitrate.name = 'RBL'; % Rounded Bit-Loading (RBL) def_tfplan.fixBitrate.active = 0; def_tfplan.fixBitrate.param.target_us = 100e6; def_tfplan.fixBitrate.param.target_ds = 100e6; def_tfplan.lcname = 'ETSI-VDSL-theo'; %% =========================================================================== % Table 6-1/G.993.2 - VDSL2 profiles from % Draft amendment 1 to Recommendation G.993.2 (G.993.2 Amendment 1 AAP R2) % 2007-04-NapaValley VDSL2profiles = itu_VDSL2profiles(); profilenames = VDSL2profiles{1,:}; MaxDSTotPower = cell2mat(VDSL2profiles{2,:}); MaxUSTotPower = cell2mat(VDSL2profiles{3,:}); CarrierSpacing = cell2mat(VDSL2profiles{4,:}); US0_support = cell2mat(VDSL2profiles{5,:}); MinBiDirDataRate = cell2mat(VDSL2profiles{6,:}); AggregateILdelay = cell2mat(VDSL2profiles{7,:}); MaxILdepth = cell2mat(VDSL2profiles{8,:}); DSILparam1overS = cell2mat(VDSL2profiles{9,:}); USILparam1overS = cell2mat(VDSL2profiles{10,:}); itu_VDSL2tables_AnnexB(); %% =========================================================================== % Table 6-1/G.993.2 - VDSL2 profiles from % find the profile index profilenames = VDSL2profiles{1,:}; for prix = 1:length(profilenames) stri = findstr(profilenames{prix},profile); if (stri == 1) break; end; end; if (length(stri) == 0) error('unkown profile'); end; plan = 0; % find the plan-index and class (997 or 998) for plix = 1:length(TableB2) stri = sum(strcmp(maskname,TableB2{plix})); if (stri == 1) break; end; end; if stri == 1 plan = 997; planix = plix; planinfo = TableB2{plix}; end; for plix = 1:length(TableB3) stri = sum(strcmp(maskname,TableB3{plix})); if (stri == 1) break; end; end; if stri == 1 plan = 998; planix = plix; planinfo = TableB3{plix}; end; if plan==0 error('Not a valid AnnexB plan'); end; tmp_tfplan = def_tfplan; %% =========================================================================== % VDSL2 (G.993.2) Annex B - European Frequency Plan % Get a handle on the right table according to frequency plan if plan == 997 TableUS = TableB4; TableDS = TableB5; else TableUS = TableB6; TableDS = TableB7; end; % fix kHz -> Hz TableUS(:,1) = TableUS(:,1)*1e3; TableDS(:,1) = TableDS(:,1)*1e3; % Get rid of interpolation commands and extract right columns [f PSD] tableUS= TableUS(TableUS(:,planix+1)<0,[1 planix+1]); tableDS= TableDS(TableDS(:,planix+1)<0,[1 planix+1]); % Make a template out of the peak mask Thold = -65; % This is somewhat arbitrary but now covers -62 and above fix = find(tableUS(:,2)>Thold); tableUS(fix,2) = tableUS(fix,2) + p2a; fix = find(tableDS(:,2)>Thold); tableDS(fix,2) = tableDS(fix,2) + p2a; % Need to define tmp_tfplan.PSD.Xstream later when Fplan is set up correctly tmp_tfplan.PSD.maxactivef = planinfo{4}*1e3; % Name it (using long name) US0type = planinfo{3}; switch US0type(1) case 'M', desig = ['-N',num2str(mtype)]; otherwise desig = ''; end; tmp_tfplan.name=sprintf('ITU-VDSL-G.993.2-AnnexB-%s-%s%s',... profile,planinfo{2},desig); tmp_tfplan.shortname = planinfo{1}; % Set the lcname in tfplan tmp_tfplan.lcname=tmp_tfplan.name; % -------------------------------------------------- % Set up the lcdef structure % Some VDSL DMT params tmp_lc=lcDefVDSLDMT; % We start from 'VDSL-DMT' and then modify.... % Some updated values tmp_lc.param.SNRMax = 58; % Maximum SNR available (dB) tmp_lc.param.codingGain = 3.8; % To give 12dB Shannon gap tmp_lc.param.SNRloss = 2; tmp_lc.param.xtalk_margin = 6; % We use a cross-talk margin of 6dB tmp_lc.param.signal_margin = 0; % (and therefore no signal margin) tmp_lc.param.efficiencyLoss = 0; % We now use data symbol rate calc. % thus efficiencyLoss should % defaults to 0 tmp_lc.param.modemNoise.LT = '-135'; % Modem noise at LT (dBm/Hz) tmp_lc.param.modemNoise.NT = '-135'; % Modem noise at NT (dBm/Hz) tmp_lc.param.PxDown = MaxDSTotPower(prix); tmp_lc.param.PxUp = MaxUSTotPower(prix); tmp_lc.param.dmt.df = CarrierSpacing(prix); tmp_lc.param.us0support = US0_support(prix); % The following is currently not used in this simulator: tmp_lc.param.minbirate = MinBiDirDataRate(prix); tmp_lc.param.dmt.il.totILdelay = AggregateILdelay(prix); tmp_lc.param.dmt.il.maxILdepth = MaxILdepth(prix); tmp_lc.param.dmt.il.DS1oS = DSILparam1overS(prix); tmp_lc.param.dmt.il.US1oS = USILparam1overS(prix); df = tmp_lc.param.dmt.df; % Extract the frequency plans (and upper tones) out of the VDSL2profiles if plan == 997 switch planix case {1,2,3,4,5,6,9,10}, row = 17; Fplan = Fplan_997X; dir='ududududu'; case {7,8}, row = 19; Fplan = Fplan_HP;dir='ndududu'; % HPE otherwise error('No such plan index'); end; else % plan 998 switch planix case {1,2,3,4,5,6,7,8,9,13,14}, row = 13; Fplan = Fplan_998X; dir='ududududu'; case {10,11,12,15,16}, row = 15; Fplan = Fplan_998AX; dir='udududu';% ADE otherwise error('No such plan index'); end; end; if VDSL2profiles{row}{prix} == -1, error(sprintf('For plan %s, profile %s is not allowed.',maskname,profile)); end; DSupper = (VDSL2profiles{row}{prix}+0.5)*df; USupper = (VDSL2profiles{row+1}{prix}+0.5)*df; % Fix the frequencies for US0 if needed switch US0type(1) case 'B', Fplan(1:2) = [120,276]; case 'M', Fplan(2) = [276]; if mtype == 0 dir(1) = 'n'; elseif mtype < 64 % if type 32-63, then there will be a space between US and DS Fplan = [Fplan(1) mtype*df/1e3 Fplan(2:end)]; dir = [dir(1) 'n' dir(2:end)]; end; % case with mtype 64 is done automatically case 'N', dir(1) = 'n'; end; % Fix maximum frequency (based on profile) Fplan = Fplan*1e3; maxf = min(tmp_tfplan.PSD.maxactivef, max(DSupper,USupper)); fix = find(Fplan>=maxf); % Fix maxf to align with Fplan edges (if it is less than df away) if(abs(Fplan(fix(1)-1)-maxf)