function fqstruct=planConvertion(frequencies,directions,guardband) %% =========================================================================== %planConvertion - Convert a frequency plan into centre frequencies and bw % % Parameter: frequencies Array of switching frequencies % Parameter: directions Direction at these frequencies % Parameter: guardband Size (0-1) or (f Hz) of guardbands % Returns: fqstruct Frequency and bw struct % .up.fc Center frequencies for upstream % .up.bw Bandwidth for each upstream band % .down.fc Center frequencies for downstream % .down.bw Bandwidth for each downstream band % % Example(s): % fqstruct=planConvertion([.138e6 2.6e6 5.4e6 10.25e6 20e6],'dudu') % Defines a four band plan % % fqstruct=planConvertion([.138e6 2.6e6 5.4e6 10.25e6 15e6 20e6],'dudnu') % Defines a four band plan with a gap between 10.25 and 15 MHz % % fqstruct=planConvertion([.138e6 2.6e6 5.4e6 10.25e6 15e6 20e6],'dudud',0.1) % Defines a five band plan with guard bands of 10% % % fqstruct=planConvertion([.138e6 2.6e6 5.4e6 10.25e6 15e6 20e6],'dudud',100e3) % Defines a five band plan with guard bands of 100e3kHz % %% =========================================================================== %% =========================================================================== % Copyright (C): % 1999 by Telia Research AB, Lulea, Sweden; % 2000-2009 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) % % CVS: $Id: planConvertion.m 752 2009-01-02 13:03:52Z tono $ %% =========================================================================== % Change History % 1999-10-10 (ToNo) Created % 1999-11-02 (ToNo) Modified the way guard bands is defined % 2000-03-09 (ToNo) Fixed a mixup in ui/di index % 2005-03-24 (ToNo) Added support for absolute valued guardbands %% =========================================================================== if nargin<2, error('Not enough input arguments.'); end if nargin<3 guardband = 0; end; if length(frequencies) ~= length(directions)+1, error('planConvertion: length mismatch'); end; ui=1; di=1; endi=length(frequencies); i=1; while i <= length(directions), stopi=i+1; while ((stopi