/*---------------------------------------------------------------------------* * IT++ * *---------------------------------------------------------------------------* * Copyright (c) 1995-2004 by Tony Ottosson, Thomas Eriksson, Pål Frenger, * * Tobias Ringström, and Jonas Samuelsson. * * * * Permission to use, copy, modify, and distribute this software and its * * documentation under the terms of the GNU General Public License is hereby * * granted. No representations are made about the suitability of this * * software for any purpose. It is provided "as is" without expressed or * * implied warranty. See the GNU General Public License for more details. * *---------------------------------------------------------------------------*/ /*! \file \brief Implementation of spread spectrum classes and functions \author Tony Ottosson 1.8 2004/09/03 07:47:28 */ #include "base/binary.h" #include "base/elmatfunc.h" #include "base/stat.h" #include "base/matfunc.h" #include "base/fastmath.h" #include "base/operators.h" #include "comm/spread.h" //------------- Spread1d ------------------- namespace itpp { Spread_1d::Spread_1d(const vec &incode) { set_code(incode); } void Spread_1d::set_code(const vec &incode) { N = incode.size(); code=incode; code/=norm(code); } vec Spread_1d::get_code() { return code; } void Spread_1d::spread(const vec &symbols, vec &out) { out.set_size(symbols.length()*N, false); for(int i=0;i