function [upband,downband]=planConvertion2Band(frequencies,directions,guardband) %% =========================================================================== %planConvertion2Band - Convert a frequency plan into two active bands % % Parameter: frequencies Array of switching frequencies % Parameter: directions Direction at these frequencies % Parameter: guardband Size (0-1) or (f Hz) of guardbands % Returns: upband Upper and lower edges in upstream band % Returns: downband Upper and lower edges in downstream band % % Example(s): % %% Define a four band plan % [upb,downb]=planConvertion2Band([.138e6 2.6e6 5.4e6 10.25e6 20e6],'dudu') % low=1;high=2; % upb(2,low) % Returns 10.25e6 % downb(1,high) % Returns 2.6e6 % % %% Set up UPBO bands for plan 997 with 125e3 used as guardband % bplan = [138 3000 5100 7050 12000]*1e3; % 997 % tfplan.PSD.UPBO.band=planConvertion2Band(bplan,'dudu',125e3) % %% =========================================================================== %% =========================================================================== % Copyright (C): % 2005-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: planConvertion2Band.m 593 2005-03-24 16:28:02Z tono $ %% =========================================================================== % Change History % 2005-03-29 (ToNo) Created (based on planConvertion.m) %% =========================================================================== if nargin<2, error('Not enough input arguments.'); end if nargin<3 guardband = 0; end; if length(frequencies) ~= length(directions)+1, error('planConvertion2Band: length mismatch'); end; ui=1; di=1; endi=length(frequencies); i=1; while i <= length(directions), stopi=i+1; while ((stopi