function IL = getIL(ex,start,stop,topology,f,Zterm); %getIL - Get the insertion loss (attenuation) % 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: IL Instertion loss [dB(f)] % % Example(s): % segs = size(ex.tt.topology); % f = ex.param.frequency.f; % IL = getIL(ex,1,segs(1),ex.tt.topology,f,ex.param.Zterm); % semilogx(f,IL); % % Reference: % FTW's xDSLsimu manual %% =========================================================================== %% =========================================================================== % Copyright (C): % 1999 by Telia Research AB, Lulea, Sweden; % 2000-2003 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) % : Bo Engstrom (bosse@upzide.com) % % CVS: $Id: getIL.m,v 3.3 2003/11/03 12:33:22 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) Added comments, split out a function getABCD % 2001-06-18 (Bosse) Octave port % 2002-07-01 (PeKa) Octave to Matlab compatibility port % 2002-08-22 (ToNo) Renamed attenuation to insertion loss % 2003-11-03 (ToNo) Lists now use cell arrays for both Octave and Matlab %% =========================================================================== Zl = Zterm; Zs = Zterm; fi_tot = getABCD(ex,start,stop,topology,f,Zterm); % Calculate the cable transfer function (insertion loss) H = (Zs+Zl)./(fi_tot{1}.*Zl+fi_tot{2}+fi_tot{3}.*Zs.*Zl +fi_tot{4}.*Zs); IL=20*log10(abs(H));