MIMO-OFDM1.1无线信道python

无线信道:传播与衰落

特点:动态且不可预测
传播方式:反射、绕射和散射

衰落和加性噪声的区别:衰落引起非加性的信号扰动,可以有多径传播引起,也可以由障碍物的遮蔽引起

衰落现象分为大尺度衰落小尺度衰落
当移动设备通过一段较长的距离时(如小区大小的距离)会产生大尺度衰落。它是由信号的路径损耗和大的障碍物(建筑物,植物,地形等)形成的阴影引起的。阴影衰落是中等路径损耗的波动特性。

大尺度衰落=平均路径损耗+阴影衰落

小尺度衰落是在较短距离移动时,由多个路径的相消或相长干涉引起信号电平的快速变化。
根据多径效应的相对时延拓展,用信道的频率选择性描述小尺度衰落的特性。同时根据时变特性可以分为快衰落慢衰落

在这里插入图片描述
在这里插入图片描述
(可以看做是信号衰落随时间距离变化缓急来排序的?)

链路预算:考虑增益和损耗,预测接受信号的强度和所需的功率储备

平均路径损耗是相对固定的因素,而阴影衰落和小尺度衰落随机现象,只能通过概率分布来预测(建模)
因此·,必须确定一个衰落余量,保证接受信号的功率大于给定阈值的概率在目标范围内(如98%~99%)
在这里插入图片描述
如图,发射功率-总损耗(平均路径损耗+大尺度衰落+小尺度衰落)大约有98%的可能比接收功率高

1.1大尺度衰落

1.1.1 一般路径损耗模型

在这里插入图片描述
比较经典的自由空间球形传播模型
在这里插入图片描述
对数距离路径损耗模型。其中d0是一个参考距离,在距离参考距离很近的位置,路径损耗具有自由空间损耗的特点,n=2
在这里插入图片描述
不同的环境有不同的n取值,如上表所示

由于自由损耗没有考虑不同的路径损耗,涉及更加真实的环境时,对数正态阴影衰落模型更为实用。
在这里插入图片描述
仿真效果图:
在这里插入图片描述

python程序

def pl_free(fc,dist,Gt=0,Gr=0):
    # 自由空间路径损耗模型
    # 输入
    # fc:载波频率
    # dist:基站和移动台之间的距离(m)
    # Gt:发射机天线增益
    # Gr:接收机天线增益
    # 输出
    # PL:路径损耗(dB)
    pl = np.zeros(shape=dist.shape)
    lamda = 3e8/fc  # 波长
    tmp = lamda / (4*math.pi * dist)
    if Gt != 0:
        tmp = tmp*math.sqrt(Gt)
    if Gr != 0:
        tmp = tmp*math.sqrt(Gr)
    for k in range(0,dist.size):
        pl[k] = -20 * math.log10(tmp[k])
    return pl
def pl_logdist_or_norm(fc,d,d0,n,sigma=0):
    # 对数距离或对数阴影路径损耗模型
    # 输入
    # fc:载波频率
    # d:基站与移动台之间的距离
    # d0:参考距离
    # n:路径损耗指数
    # sigma:方差
    # 输出
    # pl:路径损耗
    pl = np.zeros(shape=d.shape)
    lamda=3e8/fc
    for k in range(0, d.size):
        pl[k] = -20*math.log10(lamda/(4*math.pi*d0)) + 10*n*math.log10( d[k] /d0)
    if sigma != 0:
        pl = pl + sigma*np.random.normal(size=d.shape)
    return pl
# 绘制不同的路径损耗模型
fc = 1.5e9
d0 = 100
sigma = 3
distance = np.arange(1,33,2)**2  #好像比matlab里的少个数,arange不包括初始值

Gt = np.array([1,1,0.5])
Gr = np.array([1,0.5,0.5])
Exp = np.array([2,3,6])
y_Free = np.zeros([3,16])
y_logdist = np.zeros([3,16])
y_lognorm = np.zeros([3,16])


for k in range(0,3):
    y_Free[k,...] = pl_free(fc,distance,Gt[k],Gr[k])
    y_logdist[k,...] = pl_logdist_or_norm(fc,distance,d0,Exp[k])
    y_lognorm[k,...] = pl_logdist_or_norm(fc,distance,d0,Exp[0],sigma)


fig, ax = plt.subplots(1,3,figsize=(14,7))
ax[0].plot(distance,y_Free[0,...],label='Gt=1,Gr=1')
ax[0].plot(distance,y_Free[1,...],label='Gt=1,Gr=0.5')
ax[0].plot(distance,y_Free[2,...],label='Gt=0.5,Gr=0.5')
ax[0].set_xscale('log')
ax[0].set_title('Free PL-loss Model,fc=%d MHz'%fc)
ax[0].set_xlabel('Distance[m]')
ax[0].set_ylabel('Path loss[dB]')
ax[0].set(xlim=(1,1000),ylim=(40,110))
ax[0].legend()
ax[0].grid(which='both',axis='both')


ax[1].plot(distance,y_logdist[0,...],label='n=2')
ax[1].plot(distance,y_logdist[1,...],label='n=3')
ax[1].plot(distance,y_logdist[2,...],label='n=6')
ax[1].set_xscale('log')
ax[1].set_title('Log-distance Path-loss Model,fc=%d'%fc)
ax[1].set_xlabel('Distance[m]')
ax[1].set_ylabel('Path loss[dB]')
ax[1].set(xlim=(1,1000),ylim=(40,110))
ax[1].legend()
ax[1].grid(which='both',axis='both')


ax[2].plot(distance,y_lognorm[0,...],label='path 1')
ax[2].plot(distance,y_lognorm[1,...],label='path 2')
ax[2].plot(distance,y_lognorm[2,...],label='path 3')
ax[2].set_xscale('log')
ax[2].set_title('Log-norm Path-loss Model,fc=%d,sigma=%ddB'%(fc,sigma))
ax[2].set_xlabel('Distance[m]')
ax[2].set_ylabel('Path loss[dB]')
ax[2].set(xlim=(1,1000),ylim=(40,110))
ax[2].legend()
ax[2].grid(which='both',axis='both')

1.1.2 Okumura/Hata模型

主要适用于载波范围为200-1500MHz,小区半径为1-100km,天线高度为30-1000m的移动通信系统,其路径损耗可以表示为:

在这里插入图片描述

AMU(f,d)是频率f处的中等起伏衰减因子,GRx和GTx分别为接收天线和发射天线的增益,GAREA是具体地区的传播环境增益。这里天线增益仅仅是天线高度的函数,不考虑天线方向图等其他因素,此外可以从经验图中查到AMU(f,d),GAREA

Hata模型将Okumura模型拓展到各种传播环境,是当今最常用的路径损耗模型。对于发射天线高度为hTx[m],载波频率为fc[MHz],距离为d[Km],在市区环境中的损耗为:

在这里插入图片描述

注:这里的距离是以Km为单位的,书上的有问题

CRx为接收天线相关系数,取决于覆盖范围的大小。市区环境中,对于中等大小的覆盖范围,CRx取值为:

在这里插入图片描述

hRx为接收天线高度,对于大的覆盖范围,CRx取决于载波频率,例如:

在这里插入图片描述

对于郊区和开阔地,Hata模型分别表示为:

在这里插入图片描述
在这里插入图片描述
仿真:
在这里插入图片描述
python程序
pl_hata函数

def pl_hata(fc,d,htx,hrx,etype='URBAN'):
    # etype:环境类型,‘urban’,'suburban','open'
    pl = np.zeros(d.shape)
    fc=fc/1e6
    for k in range(0,d.size):
        pl[k] = 69.55 + 26.16*math.log10(fc) - 13.82*math.log10(htx) + (44.9-6.55*math.log10(htx))*math.log10(d[k])
    if etype == 'URBAN':
        if fc>=150 and fc <=200:
            C = 8.29*math.log10(1.54*hrx)**2 - 1.1
        elif fc>=200 and fc<=1500:
            C = 3.2*math.log10(11.75*hrx)**2 - 4.97
        pl = pl - C
    else:
        C = 0.8 + (1.1*math.log10(fc)-0.7)*hrx - 1.56*math.log10(fc)
        pl = pl -C
        if etype == 'SUBURBAN':
            pl = pl - 2*math.log10(fc/28)**2 - 5.4
        elif etype == 'OPEN':
            pl = pl - 4.78*math.log10(fc)**2 + 18.33*math.log10(fc) - 40.97
    return pl

主函数

import numpy as np
import math
import matplotlib.pyplot as plt
import paths


# 绘制不同的路径损耗模型
fc = 1.5e9
d0 = 100
sigma = 3
distance = np.arange(1,33,2)**2  #好像比matlab里的少个数,arange不包括初始值

htx = 70
hrx = 1.5

y_urban = paths.pl_hata(fc,distance,htx,hrx,'URBAN')
y_suburban = paths.pl_hata(fc,distance,htx,hrx,'SUBURBAN')
y_open = paths.pl_hata(fc,distance,htx,hrx,'OPEN')
fig,ax = plt.subplots(figsize=(14,7))
ax.plot(distance,y_urban,label='urban')
ax.plot(distance,y_suburban,label='suburban')
ax.plot(distance,y_open,label='open area')
ax.set_xscale('log')
ax.set_title('Hata PL model,fc=%dMHz'%(fc/1e6))
ax.set_xlabel('Distance[Km]')
ax.set_ylabel('Path loss[dB]')
ax.grid(which='both',axis='both')
ax.legend()

1.1.3 IEEE 802.16d 模型

属于对数正态阴影路径损耗模型。根据郊区宏蜂窝中发射机和接收机之间的障碍物密度(按照树密度),可以将其分为三种类型(A,B,C)

在这里插入图片描述

其中ART和BRT分别表示屋顶上方和屋顶下方。

路径损耗模型为:
在这里插入图片描述

其中d0=100m,γ=a-bhTx+c/hTx,a,b,c为参数,hTx为发射天线高度,Cf为与fc相关的系数。

在这里插入图片描述

CRx为接收天线相关系数

在这里插入图片描述

在这里插入图片描述

发现此模型有不连续处,是因为在d0之前按照自由空间传播计算的,所以需要计算出新的参考距离:

在这里插入图片描述

在这里插入图片描述

效果图:
在这里插入图片描述
代码:
主程序:

# 绘制不同的路径损耗模型
fc = 2e9
d0 = 100
htx = np.array([30,30])
hrx = np.array([2,10])
distance = np.arange(1,1001)
y_ieee16d = np.zeros([2,distance.size])
y_mieee16d = np.zeros([2,distance.size])

for k in range(0,2):
    y_ieee16d[k,...] = paths.pl_ieee80216d(fc,distance,'A',htx[k],hrx[k],'ATNT')
    y_mieee16d[k,...] = paths.pl_ieee80216d(fc,distance,'A',htx[k],hrx[k],'ATNT','MOD')
fig,ax = plt.subplots(1,2,figsize=(14,7))
ax[0].plot(distance,y_ieee16d[0,...],label='htx=%dm,hrx=%dm'%(htx[0],hrx[0]))
ax[0].plot(distance,y_ieee16d[1,...],label='htx=%dm,hrx=%dm'%(htx[1],hrx[1]))
ax[0].set(xlim=(1,1000),ylim=(10,150))
ax[0].set_xscale('log')
ax[0].set_xlabel('Distance[m]')
ax[0].set_ylabel('Pathloss[dB]')
ax[0].legend()
ax[0].grid(axis='both',which='both')
ax[0].set_title('IEEE 802.16d path loss models,fc=%dMHz'%(fc/1e6))

ax[1].plot(distance,y_mieee16d[0,...],label='htx=%dm,hrx=%dm'%(htx[0],hrx[0]))
ax[1].plot(distance,y_mieee16d[1,...],label='htx=%dm,hrx=%dm'%(htx[1],hrx[1]))
ax[1].set(xlim=(1,1000),ylim=(10,150))
ax[1].set_xscale('log')
ax[1].set_xlabel('Distance[m]')
ax[1].set_ylabel('Pathloss[dB]')
ax[1].legend()
ax[1].grid(axis='both',which='both')
ax[1].set_title('Modified IEEE 802.16d path loss models,fc=%dMHz'%(fc/1e6))

函数:

def pl_ieee80216d(fc,d,type,htx,hrx,corr_fact,mod='UNMOD'):
    # corr_fact:如果存在阴影,那么设置为‘ATnT’或‘Okumura',否则设置为No
    d0 = 100
    d0_new = 100
    lammda = 3e8/fc
    fc = fc/1e6
    Cf = 6*math.log10(fc/2e3)
    pl = np.zeros(d.shape)

    if corr_fact == 'ATNT':
        if type == 'A' or type == 'B':
            Crx = -10.8*math.log10(hrx/2)
        elif type == 'C':
            Crx = -20*math.log10(hrx/2)
    elif corr_fact == 'OKUMURA':
        if hrx <= 3:
            Crx = -10*math.log10(hrx/3)
        elif hrx >3:
            Crx = -20*math.log10(hrx/3)
    if type == 'A':#这段判断语句感觉可以优化
        a=4.6
        b=0.0075
        c=12.6
    elif type == 'B':
        a=4
        b=0.065
        c=17.1
    elif type == 'C':
        a=3.6
        b=0.005
        c=20
    gamma = a - b*htx +c/htx
    if mod == 'MOD':
        d0_new = d0*10**(-(Cf+Crx)/(10*gamma))
    for k in range(0,d.size):
        if d[k] <= d0_new:
            pl[k] = 20*math.log10(4*math.pi*d[k]/lammda)
        elif d[k] > d0_new:
            pl[k] = 20*math.log10(4*math.pi*d0_new/lammda) + 10*gamma*math.log10(d[k]/d0) + Cf + Crx
    return pl
  • 16
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值