function B = getBFromIL(cablemodel,f,Zterm,d) %% =========================================================================== % getBFromInserLoss - Get the "B" parameter from insertion loss of splitter, % where B is a parameter of transmisson line % given by an "ABCD" or "two-port modeling" theory % (A=D=1, C=0). % % Parameter: cablemodel Cable model structure % cablemodel.param.ffile Filename containing the frequencies % cablemodel.param.ilfile Filename containing the IL values % f Frequency axis % Zterm Load impedance % d Cable length in km % If d>1/1000 we asssume a length dependence % d<= we assume no length % dependence (e.g. a splitter) % Returns: B The resulting B(f) vector % % Example(s): % Reference: % %% =========================================================================== %% =========================================================================== % Copyright (C): % 2000-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : FTW's xDSLsimu % Author(s) : Driton Statovci(statovci@ftw.at) % : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) %% =========================================================================== % Change History % 2000-11-20 (DrSt) Created % 2001-02-22 (ToNo) Modified to read from a file for data % 2008-08-27 (ToNo) Modified when length dependance kicks in %% =========================================================================== % We assume Zs=Zterm; % Source impedance Zl=Zterm; % Load impedance % Get the data pointed to by the cable model if isfield(cablemodel.param, 'ffile'), ftmp = load(cablemodel.param.ffile); Tiltmp = load(cablemodel.param.ilfile); % Insertion loss from file, in [dB] else ftmp = cablemodel.param.ftab; Tiltmp = cablemodel.param.iltab; % Insertion loss from data field, in [dB] end; % Insertion loss interpolation method ='linear'; Til = interp1(ftmp,Tiltmp, f, method); % If the length is greater than one meter we assume a length dependence if d>1/1000 Til = Til*d; end; % Convert IL onto B T = 10.^(Til/20); B = (Zl+Zs)*(1 - T)./T;