function [fi_tot] = getABCD(ex,start,stop,topology,f,Zterm); %getABCD - Get the ABCD parameters % between start and stop node in the topology % % Parameter: ex experiment struct % Parameter: start start node % Parameter: stop stop node % Parameter: topology Scenario Topology % Parameter: f Frequency axis % Parameter: Zterm Termination Impedance % Returns: fi The ABCD parameters % A=fi_tot{1,1}; % B=fi_tot{1,2}; % C=fi_tot{2,1}; % D=fi_tot{2,2}; % % Example(s): % segs = size(ex.tt.topology); % f = ex.param.frequency.f; % fi_tot = getABCD(ex,1,segs(1),ex.tt.topology,f,ex.param.Zterm); % Zl = ex.param.Zterm; % Zin = (fi_tot{1,1}.*Zl+fi_tot{1,2})./(fi_tot{2,1}.*Zl+fi_tot{2,2}); % % Reference: % FSAN xDSL simulation tool manual %% =========================================================================== %% =========================================================================== % Copyright (C): % 1999 by Telia Research AB, Lulea, Sweden; % 2000-2001 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : FSAN xDSL simulation tool % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se) % % CVS: $Id: getABCD.m,v 1.4 2001/12/05 15:01:14 tono Exp $ %% =========================================================================== % Change History % 1999-08-11 (DaB) Created % 2000-03-14 (ToNo) Modified how cables are defined (now in a list) % 2000-04-03 (UvAn) Changed according to new interface of getTwoPortModel % 2000-07-05 (GS) Modified for also accepting bridged tap directly at LT % 2000-07-17 (ToNo) Split out ABCD calcs to its own function % (Makes it easier to do calc things like Zin) % 2001-01-04 (InJo) Fixed bug in index start (added +1) % 2001-02-22 (ToNo) Added support for insertion loss numbers % Useful for splitters and cable models % given as an IL number %% =========================================================================== temp=size(topology); % Start with unity matrix fi_tot{1,1}=1; fi_tot{1,2}=0; fi_tot{2,1}=0; fi_tot{2,2}=1; for index=start+1:stop, seg=topology(index,:); temp=size(seg); cablename=seg{2}; if ~isempty(cablename), % Take care of a cable section cablemodel = getList(ex.clist,cablename); switch cablemodel.model case 'IL' d=seg{1}./1000; fi{1,1}=1; fi{1,2}=getBFromIL(cablemodel,f,Zterm,d); fi{2,1}=0; fi{2,2}=1; fi_tot=ABCDprod(fi_tot,fi); otherwise [Z0,gamma] = getTwoPortModel(cablemodel,f); d=seg{1}./1000; fi{1,1}=cosh(gamma*d); fi{1,2}=Z0.*sinh(gamma*d); fi{2,1}=1./Z0.*sinh(gamma*d); fi{2,2}=cosh(gamma*d); fi_tot=ABCDprod(fi_tot,fi); end; end if length(seg)>5, cablename=seg{6}; else cablename=''; end if ~isempty(cablename), % Take care of a bridge tap (with open circuit termination) d=seg{5}./1000; cablemodel = getList(ex.clist,cablename); [Z0,gamma] = getTwoPortModel(cablemodel,f); fi{1,1}=1; fi{1,2}=0; fi{2,1}=1./Z0.*tanh(gamma*d); fi{2,2}=1; fi_tot=ABCDprod(fi_tot,fi); end; end;