function [result,errorStr] = checkEx(); %% =========================================================================== %checkEx - Check experiment description in the global structure ex % % Returns: result 1=OK 0=Error % Returns: errorStr error string % % Example(s): % ok=checkEx; % if ~ok, % error('Ex struct not correct'); % end; % % Reference: % FSAN duplex simulation memo, Telia 1998 %% =========================================================================== %% =========================================================================== % Copyright (C) 1999 by Telia Research AB, Lulea, Sweden; All rights reserved. % Project : FSAN duplex model % Author(s) : Tomas Nordstrom (Tomas.B.Nordstrom@Telia.se) % % CVS: $Id: checkEx.m,v 1.3 1999/03/31 15:16:39 dab Exp $ %% =========================================================================== % Change History % 1999-01-14 (ToNo) Created % 1999-01-18 (ToNo) Fixed "No Disturbed modem" check % 1999-01-18 (ToNo) Added many new checks and now it returns the % error string % 1999-02-25 (ToNo) Generlized list (tfplist) handling % 1999-02-26 (ToNo) Added checks for vdslDuplex and removed for noiseMargin. %% =========================================================================== global ex; result=1; errorStr=''; %% =========================================================================== % Check param if ~ex.param.testVDSL & ~ex.param.testADSL, result=0; errorStr=[errorStr sprintf('Error: No Disturbed modem!\n')]; end; if ~strncmp(ex.param.vdslDuplex,'VDSL',4) result=0; errorStr=[errorStr sprintf('Error: VDSL duplex (%s) not VDSL?\n', ex.param.vdslDuplex)]; end; if ex.param.SNRMax<0 | ex.param.SNRMax>160, result=0; errorStr=[errorStr sprintf('Error: SNRMax should not be %.2f\n',ex.param.SNRMax)]; end; if ex.param.backgroundNoise>-60, result=0; errorStr=[errorStr ... sprintf('Error: backgroundNoise should not be %.2f\n', ex.param.backgroundNoise)]; end; if ex.param.shannonGap<0 | ex.param.shannonGap>50, result=0; errorStr=[errorStr sprintf('Error: shannonGap should not be %.2f\n',ex.param.shannonGap)]; end; if ex.param.efficiencyLoss<0 | ex.param.efficiencyLoss>1, result=0; errorStr=[errorStr sprintf('Error: efficiencyLoss should not be %.2f\n',ex.param.efficiencyLoss)]; end; %% =========================================================================== % Check tf plan/list tfplan=getList(ex.tfplist,ex.param.vdslDuplex); PSD_up=eval(tfplan.upstream); PSD_down=eval(tfplan.downstream); if (tfplan.timeDivision.down+tfplan.timeDivision.up > 2) | ... (tfplan.timeDivision.down < 0) | ... (tfplan.timeDivision.up < 0), result=0; errorStr=[errorStr ... sprintf('Error: timeDivision should not be %.2f, %.2f (down, up)\n', ... tfplan.timeDivision.down,tfplan.timeDivision.up)]; end; %% =========================================================================== % Check tt % TBD %% =========================================================================== % Check PBO PBOmethod=tfplan.PBOmethod; PBOparam=tfplan.PBOparam; switch PBOmethod case 'RefLen', % Reference length method if PBOparam>ex.param.PBOmaxlen, errorStr=[errorStr sprintf('Warning: RefLen (PBOparam) longer than Max Len')]; result=1; end; if PBOparam>10000, errorStr=[errorStr sprintf('Error: Too long >10km RefLen')]; result=0; end; case 'RefFEXT', % Reference FEXT method if PBOparam>ex.param.PBOmaxlen, errorStr=[errorStr sprintf('Warning: RefLen (PBOparam) longer than Max Len')]; result=1; end; if PBOparam>10000, errorStr=[errorStr sprintf('Error: Too long >10km RefLen')]; result=0; end; case 'RefFreq' % Reference frequency method if PBOparam>30e6, errorStr=[errorStr sprintf('Error: RefFreq (PBOparam) to high >30MHz')]; result=0; end; if PBOparam<0.5e6, errorStr=[errorStr sprintf('Warning: RefFreq (PBOparam) lower than 0.5 MHz')]; result=1; end; otherwise end; %switch