function [tfplan,lcdef] = itu_tflcVDSL2_AnnexA(plan,peak) %% =========================================================================== %itu_tfplcVDSL2_AnnexA(tfplist) - Sets up tfplans for % standard ITU VDSL2 masks AnnexA (America) % % Parameter: plan Struct containing requested plan % plan.profile one of 8a; 8b; 8c; 8d; 12a; 12b; 17a; 30a % plan.designator a carrier: 32:4:64 128 % plan.mode over POTS = 1; ADM = 2; % 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): % plan.profile = '12a'; plan.designator = 32; plan.mode = 2; % [tfplan,lcdef] = itu_tfplcVDSL2_AnnexA(plan); % ex.tfplist = insertList(ex.tfplist,tfplan); % ex.lclist = insertList(ex.lclist,lcdef); % % References: % ITU G.993.2 (02/2006 prepublish) % ITU Draft amendment 1 to Recommendation 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-18 (ToNo) Created % 2008-03-19 (ToNo) AnnexA mostly done tfplan % 2008-03-22 (ToNo) Added some support for lcdef % 2008-08-28 (ToNo) Added more support for lcdef % 2008-10-01 (ToNo) Fixed a bug in UPBO.band definition % 2008-10-01 (ToNo) Fixed VDSL2 interpolation % 2008-12-05 (ToNo) Fixed flipped US/DS % CHECK/ToDo: active frequencies, % check if peak vs average/template is correct, % what if designator is a value "in between" %% =========================================================================== if nargin<3, peak = 0; % default is template (average) mask end; profile = plan.profile; % one of 8a; 8b; 8c; 8d; 12a; 12b; 17a; 30a designator = plan.designator; % typically a carrier 32:4:64 128 mode = plan.mode; % over POTS = 1; AD = 2; df = 4.3125e3; % delta f (carrier BW) for ADSL; % 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 = [30e3 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 = [0 -47.3 -54]; % RefRef noise E def_tfplan.PSD.UPBO.param.refb = [0 -27.27 -18.1]; 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(); 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,:}); % 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; %% =========================================================================== % VDSL2 (G.993.2) Annex A - American Frequency Plans (based on 998) Fplan_998 = [25,138,3750,5200,8500,12000,23000,30000]; tmp_tfplan = def_tfplan; %% -------------------- Downstream "for all" % Table A-7/G.993.2 - VTU-O transmitter Limit PSD mask as a function of profile % Downstream Mask % From the designator find the table values from Table8 namelist = [32,48,64,128]; vix = find(designator==namelist); if length(vix)==0 error(sprintf('Designator value %d not allowed',designator)); end; TableA8 = [... 138.00,80,-72.5,4,-92.5;... 207.00,155,-62,53,-90;... 276.00,227.1,-62,101.2,-90;... 552.00,440,-68,240,-90;... ]; f1 = TableA8(vix,1); % in kHz fint = TableA8(vix,2); % in kHz PSDint = TableA8(vix,3); fa = TableA8(vix,4); % in kHz PSDa = TableA8(vix,5); % From the profile and its column in Table7 extract a [f, PSD] table profileix = [1 1 1 1 1 1 2 3 ]; col = profileix(prix)+1; % Find right column in the table TableA7 = [... 0.001,-97.5,-97.5,-97.5, 4,-97.5,-97.5,-97.5, 4,PSDa,PSDa,PSDa, fa,PSDa,PSDa,PSDa, fint,PSDint,PSDint,PSDint, f1,-44.2+p2a,-44.2+p2a,-44.2+p2a, f1,-36.5+p2a,-36.5+p2a,-36.5+p2a, 1104,-36.5+p2a,-36.5+p2a,-36.5+p2a, 1622,-50+a2p,-50+a2p,-50+a2p, 3750,-53.5+a2p,-53.5+a2p,-53.5+a2p, 3750,-80,-80,-80, 3750+175,-100,-100,-100, 5200-175,-100,-100,-100, 5200,-80,-80,-80, 5200,-55+a2p,-55+a2p,-55+a2p, 8500,-55+a2p,-55+a2p,-55+a2p, 8500,-80,-80,-80, 8500+175,-100,-100,-100, 12000-175,-100,-100,-100, 12000,-100,-80,-80, 12000,-100,-60+a2p,-60+a2p, 17664,-100,-60+a2p,-60+a2p, 21000,-100,-80,-60+a2p, 21450,-100,-100,-60+a2p, 23000,-100,-100,-60+a2p, 23000,-100,-100,-80, 23000+175,-100,-100,-100, 30000,-100,-100,-100, ]; TableA7(:,1) = TableA7(:,1)*1e3; % fix kHz -> Hz % Convert into a calcPSD string tableUS = TableA7(:,[1 col]); tabstr=num2str(reshape([tableUS(:,1),tableUS(:,2)]',1,numel(tableUS))); tmp_tfplan.PSD.downstream =sprintf('calcPSD([%s ],''VDSL2'',ex.param.frequency.f,0,%g)',tabstr,f1); %% -------------------- POTS upstream if mode == 1 % over POTS if designator < 65 % Table A-1/G.993.2 - VTU-R transmitter Limit PSD mask for operation over % POTS as a function of profile namelist = [32:4:64]; vix = find(designator==namelist); TableA2 = [... -34.5,138.00,242.92,-93.2;... -35.0,155.25,274.00,-94.0;... -35.5,172.50,305.16,-94.7;... -35.9,189.75,336.40,-95.4;... -36.3,207.00,367.69,-95.9;... -36.6,224.25,399.04,-96.5;... -36.9,241.50,430.45,-97.0;... -37.2,258.75,461.90,-97.4;... -37.5,276.00,493.41,-97.9;... ]; PSD1 = TableA2(vix,1)+p2a; f0H = TableA2(vix,2); % in kHz f_int = TableA2(vix,3); % in kHz PSD_int = TableA2(vix,4)+p2a; % From the profile and its column in Table1 extract a [f, PSD] table profileix = [1 1 1 1 2 2 2 3 ]; col = profileix(prix)+1; % Find right column in the table TableA1 = [... 0,-97.5,-97.5,-97.5;... 4,-97.5,-97.5,-97.5;... 4,-92.5,-92.5,-92.5;... 25.875,PSD1,PSD1,PSD1;... f0H,PSD1,PSD1,PSD1;... f_int,PSD_int,PSD_int,PSD_int;... 686,-100,-100,-100;... 1104,-100,-100,-100;... 3750-175,-100,-100,-100;... 3750,-80,-80,-80;... 3750,-53+a2p,-53+a2p,-53+a2p;... 5200,-53+a2p,-53+a2p,-53+a2p;... 5200,-80,-80,-80;... 5200+175,-100,-100,-100;... 8500-175,-100,-100,-100;... 8500,-100,-80,-80;... 8500,-100,-54+a2p,-54+a2p;... 12000,-100,-54+a2p,-54+a2p;... 12000,-100,-80,-80;... 12000+175,-100,-100,-100;... 23000-175,-100,-100,-100;... 23000,-100,-100,-80;... 23000,-100,-100,-60+a2p;... 30000,-100,-100,-60+a2p;... 30000,-110,-110,-80;... 30175,-110,-110,-110;... ]; TableA1(:,1) = TableA1(:,1)*1e3; % fix kHz -> Hz % Convert into a calcPSD string tableDS = TableA1(:,[1 col]); tabstr=num2str(reshape([tableDS(:,1),tableDS(:,2)]',1,numel(tableDS))); tmp_tfplan.PSD.upstream =sprintf('calcPSD([%s ],''VDSL2'',ex.param.frequency.f,0,%g)',tabstr,276e3); % Name it tmp_tfplan.name=sprintf('ITU-VDSL-G.993.2-AnnexA-%s-EU-%d',profile,designator); else % designator=128 % Table A-3/G.993.2 - VTU-R EU-128 transmitterLimit PSD mask for operation % over POTS as a function of profile % From the profile and its column in Table1 extract a [f, PSD] table profileix = [1 1 1 1 2 2 2 3 ]; col = profileix(prix)+1; % Find right column in the table f0H=552; TableA3 = [... 0,-97.5,-97.5,-97.5;... 4,-97.5,-97.5,-97.5;... 4,-92.5,-92.5,-92.5;... 25.875,-34.5+p2a,-34.5+p2a,-34.5+p2a;... 138,-34.5+p2a,-34.5+p2a,-34.5+p2a;... % These formulas look strange, cf. units, but seems to work?? f0H,-34.5+p2a-10*log10(f0H-3)/(138-3),-34.5+p2a-10*log10(f0H-3)/(138-3),-34.5+p2a-10*log10(f0H-3)/(138-3);... 989,-100,-100,-100;... 1104,-100,-100,-100;... 3750-175,-100,-100,-100;... 3750,-80,-80,-80;... 3750,-53+a2p,-53+a2p,-53+a2p;... 5200,-53+a2p,-53+a2p,-53+a2p;... 5200,-80,-80,-80;... 5200+175,-100,-100,-100;... 8500-175,-100,-100,-100;... 8500,-100,-80,-80;... 8500,-100,-54+a2p,-54+a2p;... 12000,-100,-54+a2p,-54+a2p;... 12000,-100,-80,-80;... 12000+175,-100,-100,-100;... 23000-175,-100,-100,-100;... 23000,-100,-100,-80;... 23000,-100,-100,-60+a2p;... 30000,-100,-100,-60+a2p;... 30000,-110,-110,-80;... 30175,-110,-110,-110;... ]; TableA3(:,1) = TableA3(:,1)*1e3; % fix kHz -> Hz % Convert into a calcPSD string tableDS = TableA3(:,[1 col]); tabstr=num2str(reshape([tableDS(:,1),tableDS(:,2)]',1,numel(tableDS))); tmp_tfplan.PSD.upstream =sprintf('calcPSD([%s ],''VDSL2'',ex.param.frequency.f,0,%g)',tabstr,552e3); % Name it tmp_tfplan.name=sprintf('ITU-VDSL-G.993.2-AnnexA-%s-EU-%d',profile,designator); end; % designator %% -------------------- All-Digital Mode Downstream elseif mode == 2 % All-Digital Mode if designator < 65 %Table A-4/G.993.2 - VTU-R transmitter Limit PSD mask for all-digital % mode operation as a function of profile namelist = [32:4:64]; vix = find(designator==namelist); TableA5 = [... -34.5,138.00,242.92,-93.2;... -35.0,155.25,274.00,-94.0;... -35.5,172.50,305.16,-94.7;... -35.9,189.75,336.40,-95.4;... -36.3,207.00,367.69,-95.9;... -36.6,224.25,399.04,-96.5;... -36.9,241.50,430.45,-97.0;... -37.2,258.75,461.90,-97.4;... -37.5,276.00,493.41,-97.9;... ]; PSD1 = TableA5(vix,1)+p2a; f0H = TableA5(vix,2); % in kHz f_int = TableA5(vix,3); % in kHz PSD_int = TableA5(vix,4)+p2a; % From the profile and its column in Table1 extract a [f, PSD] table profileix = [1 1 1 1 2 2 2 3 ]; col = profileix(prix)+1; % Find right column in the table TableA4 = [... 0,-46.5,-46.5,-46.5;... 1.5,-46.5,-46.5,-46.5;... 3,PSD1,PSD1,PSD1;... f0H,PSD1,PSD1,PSD1;... fint,PSDint,PSDint,PSDint;... 686,-100,-100,-100;... 1104,-100,-100,-100;... 3750-175,-100,-100,-100;... 3750,-80,-80,-80;... 3750,-53+a2p,-53+a2p,-53+a2p;... 5200,-53+a2p,-53+a2p,-53+a2p;... 5200,-80,-80,-80;... 5200+175,-100,-100,-100;... 8500-175,-100,-100,-100;... 8500,-100,-80,-80;... 8500,-100,-54+a2p,-54+a2p;... 12000,-100,-54+a2p,-54+a2p;... 12000,-100,-80,-80;... 12000+175,-100,-100,-100;... 23000-175,-100,-100,-100;... 23000,-100,-100,-80;... 23000,-100,-100,-60+a2p;... 30000,-100,-100,-60+a2p;... 30000,-110,-110,-80;... 30175,-110,-110,-110;... ]; TableA4(:,1) = TableA4(:,1)*1e3; % fix kHz -> Hz % Convert into a calcPSD string tableDS = TableA4(:,[1 col]); tabstr=num2str(reshape([tableDS(:,1),tableDS(:,2)]',1,numel(tableDS))); tmp_tfplan.PSD.upstream =sprintf('calcPSD([%s ],''VDSL2'',ex.param.frequency.f,0,%g)',tabstr,276e3); % Name it tmp_tfplan.name=sprintf('ITU-VDSL-G.993.2-AnnexA-%s-ADLU-%d',profile,designator); else % Table A-6/G.993.2 - VTU-R ADLU-128 Limit PSD mask for all-digital mode % operation as a function of profile profileix = [1 1 1 1 2 2 2 3 ]; col = profileix(prix)+1; % Find right column in the table f0H=552; TableA6 = [... 0,-46.5,-46.5,-46.5;... 1.5,-46.5,-46.5,-46.5;... 3,-34.5+p2a,-34.5+p2a,-34.5+p2a;... 138,-34.5+p2a,-34.5+p2a,-34.5+p2a;... % These formulas look strange, cf. units, but seems to work?? f0H,-34.5+p2a-10*log10(f0H-3)/(138-3),-34.5+p2a-10*log10(f0H-3)/(138-3),-34.5+p2a-10*log10(f0H-3)/(138-3);... 989,-100,-100,-100;... 1104,-100,-100,-100;... 3750-175,-100,-100,-100;... 3750,-80,-80,-80;... 3750,-53+a2p,-53+a2p,-53+a2p;... 5200,-53+a2p,-53+a2p,-53+a2p;... 5200,-80,-80,-80;... 5200+175,-100,-100,-100;... 8500-175,-100,-100,-100;... 8500,-100,-80,-80;... 8500,-100,-54+a2p,-54+a2p;... 12000,-100,-54+a2p,-54+a2p;... 12000,-100,-80,-80;... 12000+175,-100,-100,-100;... 23000-175,-100,-100,-100;... 23000,-100,-100,-80;... 23000,-100,-100,-60+a2p;... 30000,-100,-100,-60+a2p;... 30000,-110,-110,-80;... 30175,-110,-110,-110;... ]; TableA6(:,1) = TableA6(:,1)*1e3; % fix kHz -> Hz % Convert into a calcPSD string tableDS = TableA6(:,[1 col]); tabstr=num2str(reshape([tableDS(:,1),tableDS(:,2)]',1,numel(tableDS))); tmp_tfplan.PSD.upstream =sprintf('calcPSD([%s ],''VDSL2'',ex.param.frequency.f,0,%g)',tabstr,552e3); % Name it tmp_tfplan.name=sprintf('ITU-VDSL-G.993.2-AnnexA-%s-ADLU-%d',profile,designator); end; % designator else error('unknown mode'); end; % mode 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; 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); % Extract the frequency plans (and upper tones) row = 11; if VDSL2profiles{row}{prix} == -1, error(sprintf('For plan %s, profile %s is not allowed.','',profile)); end; DSupper = (VDSL2profiles{row}{prix}+0.5)*df; USupper = (VDSL2profiles{row+1}{prix}+0.5)*df; Fplan = Fplan_998; dir='udududu'; % Fix the frequencies for US0 if needed if mode == 1 % POTS? Fplan(1) = 25; else Fplan(1) = 3; % ADM end; if f1 == f0H Fplan(2) = f0H; else % There is a space between US and DS assert(f1>f0H); Fplan = [f0H f1 Fplan(2:end)]; dir = [dir(1) 'n' dir(2:end)]; end; % Fix maximum frequency (based on profile) Fplan = Fplan*1e3; maxf = 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)