def __init__(self, Nr=64, C=7, Nu=64, Ns=64, beta=.01,L=5,ang=10,rice_k_dB=10,ple=4,SNR_dB=10.0,ambig=False,scramble=False,S=None,cpx=False,mmv2d=False,normS=None):
"""
Nr : number of Rx antennas
C : number of cells (>1 indicates there are "far" users)
Nu : max # users per cell
Ns : spreading code length
beta : user load (i.e.,expected active / total user ratio)
L : paths per cluster
ang : angular spread within cluster (in degrees)
rice_k_dB : rice k parameter in dB
ple : path-loss exponent: gain = 1/(1+d^ple) for distance d
S : set of spreading codes, shape=(Ns,C*Nu) """
if S is None:
S = random_qpsk(Ns,C*Nu)
self.Nr = Nr
self.C = C
self.Nu = Nu
self.Ns = Ns
self.beta = beta
self.L = L
self.ang = ang
self.rice_k_dB = rice_k_dB
self.ple = ple
self.SNR_dB = SNR_dB
self.ambig = ambig
self.scramble = scramble
self.cpx = cpx
self.mmv2d = mmv2d
if self.cpx == np.iscomplexobj(S):
self.S = S
else:
if not self.cpx:
top = np.concatenate( (S.real, -S.imag),axis=1 )
btm = np.concatenate( (S.imag, S.real),axis=1 )
self.S = np.concatenate( (top,btm),axis=0 )
else:
assert False,'WHY!?'
if self.cpx:
assert self.S.shape == (Ns,C*Nu)
else:
assert self.S.shape == (2*Ns,2*C*Nu)
if normS is not None:
dnorm = np.asarray(normS) / np.sqrt( np.square(self.S).sum(axis=0) )
self.S = self.S * dnorm
self.timegen = 0 # time spent waiting for generation of YX (does NOT count subprocess cpus time if nsubprocs>0
评论列表
文章目录