function [activef]=activeVDSLf(f,afset,hamPSD) %% =========================================================================== % activeVDSLf - Generates a vector with active frequencies from % a set of start and stop frequencies % % Parameter: f Frequency axis % Parameter: afset Active frequencies, start and stop points % Parameter: hamPSD PSD for HAM bands % % Returns: activef The active frequencies % % Examples: % f=1e3:1e3:12e6; % act=activeVDSLf(f,[138 2875 5225 6925]*1e3); % Direct use % plot(f,act) % % % As part of a callback % tfplan.PSD.active.actmaskds = ... % sprintf('activeVDSLf(f,[%s])',num2str([138 2875 5225 6925]*1e3)); % %% =========================================================================== %% =========================================================================== % Copyright (C) 2003-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : FTW's xDSLsimu % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % % CVS: $Id: activeVDSLf.m,v 1.3 2005/01/04 10:32:28 tono Exp $ %% =========================================================================== % Change History % 2003-12-01 (ToNo) Created to help etsi_tfplansVDSL %% =========================================================================== if nargin>2, HAM=1; else HAM=0; end if mod(length(afset),2) == 1 error('activeVDSLf: Not an even number for start and stop frequencies'); end; activef = zeros(size(f)); for bandp = 1:2:length(afset); fix=find(f>=afset(bandp) & f<=afset(bandp+1)); activef(fix)=1; if HAM fixham = hamPSD<10^-6; % HAM band activef(fixham)=0; end; end;