function AdjustForNID() %% =========================================================================== % Copyright (C) 2001 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Description : ADSL performance simulations, % Adjusting for noise injection device % % Project : FTW, B1 % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % % Reference: % ETSI STC TM6 Draft RTS/TM-06006 rev 10a (ADSL), 2001-05 % % CVS: $Id: AdjustForNID.m,v 1.2 2002/03/12 14:50:24 tono Exp $ %% =========================================================================== %% =========================================================================== % Change History % 2001-12-14 (ToNo) Created % 2002-01-21 (ToNo) Changed the way I handle R_V and R_N in my simulation %% =========================================================================== global ex; global result; plotit = 0; %% =========================================================================== % Define the total calibration impedance (only once for speed sake) if ~exist('ex.param.Znom') Zx = 4000; Rv = 100; w=2*pi*ex.param.frequency.f; Zcal = 120 + ... 1./(1/150 + j*w*47e-9) + ... 1./(1/750 + j*w*150e-9); ex.param.Znom = 1./(1./Zcal + 1./Zx + 1./Rv); end; %% =========================================================================== % Define the total "actual" impedance (i.e. with the line there) Rx=100; % ex.param.Zterm; segs = size(ex.tt.topology); [Zlt, Znt] = getZin(ex,1,segs(1),ex.tt.topology,ex.param.frequency.f,Rx); if plotit, figure; f = ex.param.frequency.f; semilogx(f,abs(Zlt),'g',f,abs(Znt),'b',f,abs(Zcal),'r'); legend('Zlt','Znt','Zcal'); end; ZactualLT = 1./(1./Zlt + 1./Zx + 1./Rv); ZactualNT = 1./(1./Znt + 1./Zx + 1./Rv); %% =========================================================================== % Calculate the power adjustment needed AfactLT = abs(ZactualLT./ex.param.Znom).^2; AfactNT = abs(ZactualNT./ex.param.Znom).^2; if plotit, figure; semilogx(f,10*log10(abs(AfactLT)),'g'); figure; semilogx(f,10*log10(abs(AfactNT)),'b'); end; %% =========================================================================== % Adjust the results result.NT.Tot_noise.up = result.NT.Tot_noise.up.*AfactNT; result.NT.Tot_noise.down = result.NT.Tot_noise.down.*AfactNT; result.LT.Tot_noise.up = result.LT.Tot_noise.up.*AfactLT; result.LT.Tot_noise.down = result.LT.Tot_noise.down.*AfactLT;