function [Rate_LT, Rate_NT, Rate_LT_bg, Rate_NT_bg]=calcFSANresult(ex,result); %% =========================================================================== %calcFSANresult - Calculate all disturbed modem bitrates % % Parameter: ex The experiment parameters % Parameter: result The experiment result structure % % Returns: b_LT Resulting bitrates at LT side (in Mbit) % Returns: b_NT Resulting bitrates at NT side (in Mbit) % Returns: b_LT_bg Resulting bitrates at LT side with no VDSL disturbers (in Mbit) % Returns: b_NT_bg Resulting bitrates at NT side with no VDSL disturbers(in Mbit) % % % Example(s): % result = evalExperiment; % [bitrate_LT, bitrate_NT, bitrate_LT_bg, bitrate_NT_bg]=calcFSANresult(ex,result); % % Algorithmic details: % % Reference: %% =========================================================================== %% =========================================================================== % Copyright (C) 1998 by Telia Research AB, Lulea, Sweden; All rights reserved. % Project : FSAN duplex model % Author(s) : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se) % : Tomas Nordstrom (Tomas.B.Nordstrom@Telia.se) % % CVS: $Id: calcFSANresult.m,v 1.3 1999/03/31 13:31:39 dab Exp $ %% =========================================================================== % Change History % 1998-11-09 (DaB) Created % 1998-12-15 (ToNo) Added header and comments % 1998-12-17 (ToNo) Split out plotting % 1999-01-07 (DaB) Added rate without xtalk-noise % 1999-02-25 (ToNo) Generlized list (tfplist) handling % 1999-03-01 (DaB) Upadated to correct addition bug % 1999-03-03 (DaB) Renamed bg to Alien % 1999-03-11 (DaB) Added background noise to Alien noise % 1999-03-15 (DaB) Renamed Alien back to bg %% =========================================================================== if nargin<2, error('Not enough input arguments.'); end % Get hold of some global parameters SNRmax=ex.param.SNRMax; Gamma=ex.param.shannonGap; f=ex.param.f; delta_f=diff(f);%f(2)-f(1); delta_f=[delta_f delta_f(length(delta_f))]; % Loop over all VDSL cases and collect bit rates n=length(result); for k=1:n tmp=ex.tt.traffic(ex.tt.dm(k),:); modem=tmp{3}; if strncmp(modem,'VDSL',4), modem=ex.param.vdslDuplex; end; tfplan=getList(ex.tfplist,modem); TimeDivision_up=tfplan.timeDivision.up; TimeDivision_down=tfplan.timeDivision.down; f_start_NT=tfplan.active.downstream(1); f_stop_NT=tfplan.active.downstream(2); f_start_LT=tfplan.active.upstream(1); f_stop_LT=tfplan.active.upstream(2); Rx_NT=result(k).NT.Rx_signal; Tx_NT=result(k).NT.Tx_signal; tmp=find(Tx_NT>10.^-14); LT_mask=10.^14.*ones(size(f)); LT_mask(tmp)=ones(size(tmp)); Alien_NT=result(k).NT.Alien_noise; if strncmp(modem,'VDSL',4), Tot_NT=result(k).NT.Tot_noise.down; Tot_LT=result(k).LT.Tot_noise.up; else Tot_NT=result(k).NT.Tot_noise.up; Tot_LT=result(k).LT.Tot_noise.down; end; Rx_LT=result(k).LT.Rx_signal; Tx_LT=result(k).LT.Tx_signal; tmp=find(Tx_LT>10.^-14); NT_mask=10.^14.*ones(size(f)); NT_mask(tmp)=ones(size(tmp)); Alien_LT=result(k).LT.Alien_noise; noise_LT=Tot_LT; noise_NT=Tot_NT; SNR_LT(k,:)=Rx_LT./noise_LT; b_LT(k,:)=calcTheoBitLoad(10*log10(SNR_LT(k,:)),SNRmax,Gamma); SNR_LT_Alien(k,:)=Rx_LT./(Alien_LT+10.^(ex.param.backgroundNoise/10)); b_LT_Alien(k,:)=calcTheoBitLoad(10*log10(SNR_LT_Alien(k,:)),SNRmax,Gamma); tmp=calcRate(b_LT(k,:),f,f_start_LT,f_stop_LT); Rate_LT(k)=tmp./1e6.*TimeDivision_up.*(1-ex.param.efficiencyLoss); tmp=calcRate(b_LT_Alien(k,:),f,f_start_LT,f_stop_LT); Rate_LT_bg(k)=tmp./1e6.*TimeDivision_up.*(1-ex.param.efficiencyLoss); SNR_NT(k,:)=Rx_NT./noise_NT; b_NT(k,:)=calcTheoBitLoad(10*log10(SNR_NT(k,:)),SNRmax,Gamma); SNR_NT_Alien(k,:)=Rx_NT./(Alien_NT+10.^(ex.param.backgroundNoise/10)); b_NT_Alien(k,:)=calcTheoBitLoad(10*log10(SNR_NT_Alien(k,:)),SNRmax,Gamma); tmp=calcRate(b_NT(k,:),f,f_start_NT,f_stop_NT); Rate_NT(k)=tmp./1e6.*TimeDivision_down.*(1-ex.param.efficiencyLoss); tmp=calcRate(b_NT_Alien(k,:),f,f_start_NT,f_stop_NT); Rate_NT_bg(k)=tmp./1e6.*TimeDivision_down.*(1-ex.param.efficiencyLoss); end;