function [Zin, ZinNT] = getZin(ex,start,stop,topology,f,Zterm); %getZin - Get the input impedance % 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: Zin Input impedance % % Example(s): % segs = size(ex.tt.topology); % f = ex.param.frequency.f; % Zin = getZin(ex,1,segs(1),ex.tt.topology,f,ex.param.Zterm); % semilogx(f,Zin); % % Reference: % Chen "DSL simulations Techniques and Standards Development", 1998 %% =========================================================================== %% =========================================================================== % Copyright (C): % 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) % : Petr Kadlec (kadlec@ftw.at) % % CVS: $Id: getZin.m,v 3.2 2003/11/03 12:33:22 tono Exp $ %% =========================================================================== % Change History % 2000-07-17 (ToNo) Split out a function getABCD to be able to do this % 2001-12-17 (ToNo) Fixed a reverse impedance % 2002-07-22 (PeKa) Octave port % 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); % From Starr Eq. 3.7 (or Chen p.48) % Zin = (fi_tot{1,1}.*Zl+fi_tot{1,2})./(fi_tot{2,1}.*Zl+fi_tot{2,2}); Zin = (fi_tot{1}.*Zl+fi_tot{2})./(fi_tot{3}.*Zl+fi_tot{4}); % We can also calculate the reverse impedance (Chen p.53) % ZinNT = (fi_tot{2,2}.*Zs+fi_tot{1,2})./(fi_tot{2,1}.*Zs+fi_tot{1,1}); ZinNT = (fi_tot{4}.*Zs+fi_tot{2})./(fi_tot{3}.*Zs+fi_tot{1});