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 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.1 2000/07/17 12:42:18 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) %% =========================================================================== 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:stop, seg=topology(index,:); temp=size(seg); cablename=seg{2}; if ~isempty(cablename), % Take care of a cable section d=seg{1}./1000; cablemodel = getList(ex.clist,cablename); [Z0,gamma] = getTwoPortModel(cablemodel,f); 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=mult(fi_tot,fi); 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=mult(fi_tot,fi); end; end; function res=mult(a,b) res{1,1}=a{1,1}.*b{1,1}+a{1,2}.*b{2,1}; res{1,2}=a{1,1}.*b{1,2}+a{1,2}.*b{2,2}; res{2,1}=a{2,1}.*b{1,1}+a{2,2}.*b{2,1}; res{2,2}=a{2,1}.*b{1,2}+a{2,2}.*b{2,2};