function tfplist = etsi_noisesSDSL(tfplist)
%% ===========================================================================
%etsi_noise(tfplist) - Sets up the tfplans for some standard alien systems
%
% Parameter:    tfplist	        Structure describing the time and freq plan
% Returns:      tfplist		Structure describing the time and freq plan
%
% Example(s):
%   ex.tfplist = etsi_noisesSDSL(ex.tfplist);           Add to existing tfplist
%   tfplan=getList(ex.tfplist,'ETSI-SDSL-NoiseA') ;     Get this SDSL noise
%
%   ex.tfplist = etsi_noisesSDSL([]);                   Create a new tfplist
%   tfplan=getList(ex.tfplist,'ETSI-SDSL-NoiseB');      Get this SDSL noise
%
%  Mask definitions:
%    ETSI TM6(98)19 rev. 3 (nov. 26, 1999)
%% ===========================================================================

%% ===========================================================================
% Copyright (C):                                        
%       1999-2000 by Telia Research AB, Lulea, Sweden;                
%       2000-2009 by Forschungszentrum Telekommunikation Wien, Austria;
%                                                         All rights reserved.
% Project       : FTW's xDSLsimu
% Author(s)     : Tomas Nordstrom (Tomas.Nordstrom@FTW.at)
%               : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se)
%               : Gernot Schmid (Gernot.Schmid@arcs.ac.at)
%
% CVS:       $Id: etsi_noisesSDSL.m 752 2009-01-02 13:03:52Z tono $
%% ===========================================================================
% Change History
%      1999-07-01 (Dab)  Created
%      1999-07-22 (ToNo) Removed the scenario definitions (done on the fly)
%      1999-10-25 (ToNo) Reorganized things into etsi,ansi,itu,fsan definitions
%      2000-01-19 (GS)   Added SDSL-Noise Models 
%      2002-08-23 (ToNo) Split the noises into different technologies
%% ===========================================================================

%% ===========================================================================
% Use a template, as order is important!

def_tfplan = templateTFP;

%% ===========================================================================
% ETSI SDSL noise models
%-------------------

% Models alien crosstalk from a disturber shall be coupled with and NEXT
% and FEXT functions.
% Reference TD17, TD20 ETSI TM6 Villach 1999  

tmp_tfplan=def_tfplan;
tmp_tfplan.name='ETSI-SDSL-NoiseA-rev0';
tmp_tfplan.PSD.downstream='calcPSD([1 -18.2 50e3 -18.2 75e3 -25.4 290e3 -25.4 330e3 -26.1 1.104e6 -26.1 2.50e6 -66.2 4.53e6 -96.5 30e6 -96.5],''Log-Linear'',ex.param.frequency.f)';
tmp_tfplan.PSD.upstream='calcPSD([1 -18.2 50e3 -18.2 75e3 -25.2 275e3 -25.3 400e3 -40.5 600e3 -54.3 1e6 -71.5 2.75e6 -96.5 30e6 -96.5],''Log-Linear'',ex.param.frequency.f)';
tfplist=insertList(tfplist,tmp_tfplan);

tmp_tfplan=def_tfplan;
tmp_tfplan.name='ETSI-SDSL-NoiseB-rev0';
tmp_tfplan.PSD.downstream='calcPSD([1 -22.2 50e3 -22.2 77e3 -30.2 292e3 -30.3 330e3 -30.8 550e3 -30.8 600e3 -32.6 700e3 -33.6 1.104e6 -33.6 4.53e6 -101 30e6 -101],''Log-Linear'',ex.param.frequency.f)';
tmp_tfplan.PSD.upstream='calcPSD([1 -22.2 50e3 -22.2 71e3 -29.3 145e3 -29.5 175e3 -31.0 274e3 -31.0 400e3 -45.9 600e3 -59.6 1e6 -76.8 2e6 -93.5 3e6 -101 30e6 -101],''Log-Linear'',ex.param.frequency.f)';
tfplist=insertList(tfplist,tmp_tfplan);

tmp_tfplan=def_tfplan;
tmp_tfplan.name='ETSI-SDSL-NoiseC-rev0';
tmp_tfplan.PSD.downstream='calcPSD([1 -22.2 50e3 -22.2 74e3 -30.2 292e3 -30.3 330e3 -30.8 550e3 -30.8 600e3 -32.6 700e3 -33.6 1.104e6 -33.6 2e6 -62 15e6 -101 30e6 -101],''Log-Linear'',ex.param.frequency.f)';
tmp_tfplan.PSD.upstream='calcPSD([1	-22.2 50e3 -22.2 71e3 -29.3 145e3 -29.5 175e3 -31.0 274e3 -31.0 450e3 -48.8 900e3 -46.6 1.2e6 -48.2 1.5e6 -52.0 1.78e6 -60.3 16e6 -101 30e6 -101],''Log-Linear'',ex.param.frequency.f)';
tfplist=insertList(tfplist,tmp_tfplan);


%% ===========================================================================
% Extension to SDSL noise models according to 
% ETSI TM6(98)19 rev. 3 (nov. 26, 1999)

tmp_tfplan=def_tfplan;
tmp_tfplan.name='ETSI-SDSL-NoiseA';
tmp_tfplan.PSD.upstream='calcPSD([1 -20 .015e6 -20 .06e6 -25.2 .276e6 -25.8 .5e6 -51.9 .57e6 -69.5 .6e6 -69.9 .65e6 -62.4 .763e6 -62.4 1e6 -71.5 2.75e6 -96.5 30e6 -96.5] ,''Log-Linear'',ex.param.frequency.f)';
tmp_tfplan.PSD.downstream='calcPSD([1 -20 .015e6 -20 .03e6 -21.5 .067e6 -27 .125e6 -27 .138e6 -25.7 .4e6 -26.1 1.104e6 -26.1 2.5e6 -66.2 4.55e6 -96.5 30e6 -96.5],''Log-Linear'',ex.param.frequency.f)';
tfplist=insertList(tfplist,tmp_tfplan);

tmp_tfplan=def_tfplan;
tmp_tfplan.name='ETSI-SDSL-NoiseB';
tmp_tfplan.PSD.upstream='calcPSD([.000001e6 -25.7 0.015e6 -25.7 .03e6 -26.8 .067e6 -31.2 .142e6 -31.2 .156e6 -32.7 .276e6 -33.2 .4e6 -46 .5e6 -57.9 .57e6 -75.7 .6e6 -76.0 .65e6 -68.3 .763e6 -68.3 1e6 -77.5 2.8e6 -103 30e6 -103],''Log-Linear'',ex.param.frequency.f)';
tmp_tfplan.PSD.downstream='calcPSD([.000001e6 -25.7 .015e6 -25.7 .03e6 -27.4 .045e6 -30.3 .07e6 -36.3 .127e6 -36.3 .138e6 -32.1 .4e6 -32.5 .55e6 -32.5 .61e6 -34.8 .7e6 -35.4 1.104e6 -35.4 4.55e6 -103 30e6 -103],''Log-Linear'',ex.param.frequency.f)';
tfplist=insertList(tfplist,tmp_tfplan);

tmp_tfplan=def_tfplan;
tmp_tfplan.name='ETSI-SDSL-NoiseC';
tmp_tfplan.PSD.upstream='calcPSD([.000001e6 -25.7 0.015e6 -25.7 .03e6 -26.8 .067e6 -31.2 .142e6 -31.2 .156e6 -32.7 .276e6 -33.2 .335e6 -42 .45e6 -47.9 .75e6 -45.4 1.04e6 -45.5 2.46e6 -63.6 23.44e6 -103 30e6 -103],''Log-Linear'',ex.param.frequency.f)';
tmp_tfplan.PSD.downstream='calcPSD([.000001e6 -25.7 .015e6 -25.7 .03e6 -27.4 .045e6 -30.3 .07e6 -36.3 .127e6 -36.3 .138e6 -32.1 .4e6 -32.5 .55e6 -32.5 .61e6 -34.8 .7e6 -35.3 1.104e6 -35.3 1.85e6 -58.5 22.4e6 -103 30e6 -103],''Log-Linear'',ex.param.frequency.f)';
tfplist=insertList(tfplist,tmp_tfplan);


tmp_tfplan=def_tfplan;
tmp_tfplan.name='ETSI-SDSL-NoiseD';
tmp_tfplan.PSD.upstream='calcPSD([.000001e6  -300  30e6 -300],''Log-Linear'',ex.param.frequency.f)';
tmp_tfplan.PSD.downstream='calcPSD([.000001e6  -300  30e6 -300],''Log-Linear'',ex.param.frequency.f)';
tfplist=insertList(tfplist,tmp_tfplan);