# comm_RicianChannel
通过多径 Rician 衰落信道对输入信号进行滤波
函数库: TyCommunication
# 描述
comm_RicianChannel 系统对象通过多径 Rician 衰落信道对输入信号进行滤波。
要通过多径 Rician 衰落信道对输入信号进行滤波:
创建 comm_RicianChannel 对象并设置其属性;
用 step 调用该对象。
# 构造
# 语法
ricianchan = comm_RicianChannel()
ricianchan = comm_RicianChannel(; Name = Value)
# 说明
ricianchan = comm_RicianChannel( ) 创建一个频率选择或频率平坦的多径 Rician 衰落信道系统对象。该对象通过多径信道过滤实数或复数输入信号,以获得信道受损的信号。
ricianchan = comm_RicianChannel(; Name = Value) 使用一个或多个 Name = Value 参数对设置属性。例如,SampleRate = 2 设置输入信号的采样率为 2。
# 属性
除非另有说明,否则属性是不可更改的,这意味着在调用对象后不能更改其值。对象在调用时锁定,可以使用 release 函数将其解锁。
如果属性是可调的,则可以随时更改其值。
SampleRate - 输入信号采样率1 (默认) | 正标量
以赫兹为单位的输入信号采样率,指定为正标量。
数据类型:Float
PathDelays - 离散路径延迟0(默认)| 标量 | 行向量
以秒为单位的离散路径延迟,指定为标量或行向量。
当将 PathDelays 设置为标量时,信道是频率平坦的;
当将 PathDelays 设置为向量时,信道是频率选择性的。
PathDelays 和 AveragePathGains 属性的长度必须相同。
数据类型:Float
AveragePathGains - 离散路径的平均增益0(默认)| 标量 | 行向量
以分贝为单位的离散路径的平均增益,指定为标量或行向量。 AveragePathGains 和 PathDelays 属性的长度必须相同。
数据类型:Float
NormalizePathGains - 归一化平均路径增益true(默认)| false
归一化平均路径增益,指定为下列逻辑值之一:
true — 对衰落过程归一化处理,使得路径增益的总功率(随时间平均)为 0 dB;
false — 路径增益的总功率未归一化处理。
AveragePathGains 属性用来指定路径增益的平均功率。
数据类型:Bool
KFactor - Rician 衰落信道的 K 因子
3(默认)| 正标量 | 非负值的 1 × 向量
3(默认)| 正标量 | 非负值的 1 ×
Rician 衰落信道的 K 因子,指定为正标量或非负值的 1 ×
当您将 KFactor 设置为标量时,第一个离散路径是 Rician 衰落过程,其 Rician K 因子为 KFactor。 任何剩余的离散路径都是独立的 Rayleigh 衰落过程;
当您将 KFactor 设置为向量时,对应于 KFactor 向量的正元素的离散路径是 Rician 衰落过程,其中 Rician K 因子由该元素指定。 对应于 KFactor 向量的任何零值元素的离散路径是 Rayleigh 衰落过程。 至少一个元素必须是非零的。
数据类型:Float
DirectPathDopplerShift - 视距分量的多普勒频移0(默认)| 标量 | 行向量
DirectPathInitialPhase - 视距分量的初始相位0(默认)| 标量 | 行向量
MaximumDopplerShift - 所有路径的最大多普勒频移0.001(默认)| 非负标量
所有路径的最大多普勒频移,指定为非负标量。 单位为赫兹。
最大多普勒频移限制适用于每个路径。 当您将此属性设置为 0 时,信道在整个输入中保持静态。 您可以使用 reset 对象函数来生成新的信道实现。
对于每条路径,MaximumDopplerShift 属性值必须小于 SampleRate/10/
数据类型:Float
DopplerSpectrum - 所有信道路径的多普勒频谱形状
doppler("Jakes")(默认)| 多普勒频谱结构的 1x 单元数组
doppler("Jakes")(默认)| 多普勒频谱结构的 1x
所有路径的多普勒频谱形状,指定为多普勒频谱结构或多普勒频谱结构的 1 ×
当您将 DopplerSpectrum 设置为单个多普勒频谱结构时,所有路径都具有相同的指定多普勒频谱;
当您将 DopplerSpectrum 设置为多普勒频谱结构的单元数组时,每条路径都具有由单元数组中的相应结构指定的多普勒频谱。
使用多普勒函数的 specType 输入指定频谱类型的选项。 如果将 FadingTechnique 属性设置为 "Sum of sinusoids",则必须将 DopplerSpectrum 设置为 doppler("Jakes")。
要启用此属性,请将 MaximumDopplerShift 属性设置为正标量。
数据类型:Tuple
ChannelFiltering - 信道滤波true(默认)| false
信道滤波,指定为以下选项之一:
true - 信道接收输入信号并产生滤波输出信号;
false - 对象不接收输入信号,不产生滤波输出信号,仅输出信道路径增益。必须使用 NumSamples 属性指定衰落过程的持续时间。
数据类型:Bool
PathGainsOutputPort - 输出信道路径增益false(默认)| true
输出信道路径增益,指定为 false 或 true。将该属性设置为 true,输出底层衰落过程的信道路径增益。
依赖
若要启用此属性,请将 ChannelFiltering 属性设置为 true。
数据类型:Bool
NumSamples - 样本数100(默认)| 非负整数
用于衰落过程持续时间的样本数,指定为非负整数。
若要启用此属性,请将 ChannelFiltering 属性设置为 false。
FadingTechnique - 信道模型衰落技术
"Filtered Gaussian noise"(默认)| "Sum of sinusoids"
信道模型衰落技术,指定为 "Filtered Gaussian noise" 或 "Sum of sinusoids"。
数据类型:String
NumSinusoids - 正弦波数
48(默认)| 正整数
InitialTimeSource - 控制衰落过程开始时间的源
"Property"(默认)| "Input port"
控制衰落过程开始时间的源,指定为 "Property" 或 "Input port"。
将 InitialTimeSource 设置为 "Property" 时,请使用 InitialTime 属性设置初始时间偏移;
将 InitialTimeSource 设置为 "Input port" 时,请使用 inittime 输入参数指定衰落过程的开始时间。输入值可以在对对象的连续调用中更改。
依赖
若要启用此属性,请将 FadingTechnique 属性设置为 "Sum of sinusoids"。
数据类型: String
InitialTime - 初始时间偏移
0 (默认) | 非负标量
衰落模型的初始时间偏移,以秒为单位,指定为非负标量。
当 mod(InitialTime/SampleRate) 非零时,将初始时间偏移量向上舍入到最接近的样本位置。
依赖
若要启用此属性,请将 FadingTechnique 属性设置为 "Sum of sinusoids",将 InitialTimeSource 属性设置为 "Property"。
数据类型: Float6
RandomStream - 随机数流的来源
"Global stream"(默认)| "mt19937ar with seed"
随机数流的来源,指定为 "Global stream" 或 "mt19937ar with Seed"。
当将属性设置为 "Global stream" 时,该对象使用当前全局随机数流生成随机数。在这种情况下,对象函数 reset 只重置滤波器;
当将属性设置为 "mt19937ar with seed" 时,对象使用 mt19937ar 算法生成随机数。在这种情况下,对象函数 reset 重置滤波器并将随机数流重新初始化为 Seed 属性的值。
数据类型: String
Seed - mt19937ar 随机数流的初始种子
73 (默认) | 非负整数
mt19937ar 随机数流生成器算法的初始种子,指定为非负整数。在调用对象函数 reset 时,将 mt19937ar 随机数流重新初始化为 Seed 值。
依赖
若要启用此属性,请将 RandomStream 属性设置为 "mt19937ar with seed"。
数据类型: Float
# 用法
# 语法
y, = step(ricianchan, x)
y, = step(ricianchan, x, inittime)
y, pathgains = step(ricianchan, ___)
pathgains = step(ricianchan)
pathgains = step(ricianchan, inittime)
# 说明
y, = step(ricianchan, x) 将输入信号 x 通过多径 Rician 衰落信道进行滤波,并将结果返回到 y 中。
要启用这种语法,请将 ChannelFiltering 属性设置为 true。
y, = step(ricianchan, x, inittime) 规定了衰落过程的开始时间。
要启用这种语法,请将 FadingTechnique 属性设置为 "Sum of sinusoids",InitialTimeSource 属性设置为 "Input port"。
y, pathgains = step(ricianchan, ___) 还可以使用前面语法中的任何输入参数组合,以 pathgains 的形式返回潜在多径 Rician 衰落过程的信道路径增益。
要启用这种语法,请将 PathGainsOutputPort 属性设置为 true。
pathgains = step(ricianchan) 返回潜在衰落过程的信道路径增益。在这种情况下,信道不需要输入信号,作为路径增益的来源。
要启用这种语法,请将 ChannelFiltering 属性设置为 false。
pathgains = step(ricianchan, inittime) 返回从指定的初始时间开始的基本衰落过程的信道路径增益。在这种情况下,信道不需要输入信号,作为路径增益的来源。
要启用这种语法,请将 FadingTechnique 属性设置为 "Sum of sinusoids",InitialTimeSource 属性设置为 "Input port",ChannelFiltering 属性设置为 false。
# 输入参数
x - 输入信号 ×1 向量
输入信号,指定为
数据类型: Float
复数支持: Yes
inittime - 初始时间偏移
0 | 非负标量
当 mod(inittime/SampleRate)非零时,初始时间偏移被舍入到最接近的样本位置。
数据类型: Float
# 输出参数
y - 输出信号 ×1 向量
输出信号以
pathgains - 输出路径增益 × 矩阵
输出路径增益,作为
当将 ChannelFiltering 属性设置为 false 时,该输出的数据类型与输入信号 x 相同。
# 对象函数
要使用对象函数,请将系统对象指定为第一个输入参数。例如,要释放名为 obj 的 System 对象的系统资源,请使用以下语法:
release(obj)
对系统对象通用的操作
| 函数 | 说明 |
|---|---|
| step | 运行系统对象算法 |
| release | 释放资源并允许更改系统对象属性值和输入特性 |
| reset | 重置系统对象的内部状态 |
# 示例
通过多径 Rician 衰落信道对输入信号进行滤波
多径 Rician 衰落信道系统对象包括两种生成随机数的方法。你可以使用当前的全局流或带有指定种子的 mt19937ar 算法。
创建一个 PSK 调制器系统对象来调制随机生成的数据。
using TyCommunication
using TyMath
rng = MT19937ar(73)
pskModulator = comm_PSKModulator()
insig = randi(rng, [0, pskModulator.ModulationOrder - 1], 1024, 1)
channelInput = step(pskModulator, insig)
创建一个多径 Rician 衰落信道系统对象,指定随机数生成方法为 mt19937ar 算法,随机数种子为 73。
ricianchan = comm_RicianChannel(;
SampleRate=1e6,
PathDelays=[0.0 0.5 1.2] * 1e-6,
AveragePathGains=[0.1 0.5 0.2],
KFactor=2.8,
DirectPathDopplerShift=5.0,
DirectPathInitialPhase=0.5,
MaximumDopplerShift=50,
DopplerSpectrum=doppler("Bell", 8),
RandomStream="mt19937ar with seed",
Seed=73,
PathGainsOutputPort=true,
)
通过使用多径 Rician 衰落信道系统对象对调制数据进行滤波。
RicianChanOut1, RicianPathGains1 = step(ricianchan, channelInput)
RicianChanOut1 = 1024-element Vector{ComplexF64}:
-0.01857469061040297 + 0.001328040431352001im
0.009094657686858682 - 0.013345797451833646im
-0.026036977256844177 + 0.004425405007692235im
0.019307186351886444 - 0.01734705423055794im
⋮
0.07825681252388667 + 1.2455699234983872im
0.967686344676291 - 0.2529326970249303im
-0.8613433047363604 - 0.7229867511146367im
0.1965555779224079 + 1.2169133792079452im
RicianPathGains1 = 1024×3 Matrix{ComplexF64}:
0.140202+0.587758im 0.255772+0.510997im 0.0841808-0.0841873im
0.140228+0.587775im 0.255742+0.511094im 0.0841736-0.0841948im
0.140254+0.587793im 0.255712+0.51119im 0.0841663-0.0842022im
0.14028+0.58781im 0.255682+0.511287im 0.0841591-0.0842096im
⋮
0.172726+0.604633im 0.222547+0.605167im 0.0773468-0.0908203im
0.172766+0.604648im 0.222511+0.605253im 0.0773414-0.0908251im
0.172806+0.604662im 0.222475+0.605338im 0.0773361-0.0908299im
0.172845+0.604677im 0.222438+0.605424im 0.0773307-0.0908347im
使用正弦和技术对 Rician 信道建模
通过使用配置为使用正弦和衰落技术的多径 Rician 衰落信道系统对象,显示信道状态对于不连续传输是保持的。观察不连续的信道响应段叠加在连续信道响应上。
设置信道属性。
using TyCommunication
using TyPlot
using TyMath
rng = MT19937ar(1234)
fs = 1000 # Sample rate in Hz
pathDelays = [0 2.5e-3] # In seconds
pathPower = [0 -6] # In dB
fD = 5 # Maximum Doppler shift in Hz
ns = 1000 # Number of samples
nsdel = 100 # Number of samples for delayed paths
定义一个连续的时间跨度和三个不连续的时间段,在此基础上绘制和查看信道响应。查看从时间 0 开始的 1000个 样本的连续信道响应和分别从时间 0.1、0.4 和 0.7 秒开始的三个 100 个样本的信道响应。
to0 = 0.0
to1 = 0.1
to2 = 0.5
to3 = 0.8
t0 = collect((to0:(ns - 1)) / fs) # Transmission 0
t1 = collect(to1 .+ (0:(nsdel - 1)) / fs) # Transmission 1
t2 = collect(to2 .+ (0:(nsdel - 1)) / fs) # Transmission 2
t3 = collect(to3 .+ (0:(nsdel - 1)) / fs) # Transmission 3
创建一个频率平坦的多径 Rician 衰落系统对象,指定 1000 Hz 的采样率、正弦和衰落技术、查看的样本数,禁用信道滤波。指定一个种子值,以便结果可以重复。使用默认的 InitialTime 属性设置,以便从时间 0 开始模拟衰落信道。
ricianchan1 = comm_RicianChannel(;
SampleRate=fs,
MaximumDopplerShift=fD,
RandomStream="mt19937ar with seed",
Seed=17,
FadingTechnique="Sum of sinusoids",
ChannelFiltering=false,
NumSamples=ns,
)
创建一个多径 Rician 衰落信道系统对象的复制副本。设置延迟路径的样本数。设置初始时间的来源,以便在使用系统对象时,可以指定衰落信道的偏移时间作为输入参数。
ricianchan2 = deepcopy(ricianchan1)
ricianchan2.InitialTimeSource = "Input port"
ricianchan2.NumSamples = nsdel
使用 ricianchan1 对象保存连续通道响应的路径增益输出,使用 ricianchan2 对象保存非连续延迟通道响应的路径增益输出,初始时间偏移量作为输入参数提供。
pg0 = step(ricianchan1)
pg1 = step(ricianchan2, to1)
pg2 = step(ricianchan2, to2)
pg3 = step(ricianchan2, to3)
将路径增益转换成分贝。
pathGain0 = 20 * log10.(abs.(pg0))
pathGain1 = 20 * log10.(abs.(pg1))
pathGain2 = 20 * log10.(abs.(pg2))
pathGain3 = 20 * log10.(abs.(pg3))
绘制出连续和不连续情况下的路径增益。三段的增益与连续情况下的增益一致。因为即使在不传输数据的情况下,信道特性也会保持不变,这两张图的一致性表明,正弦和技术适用于模拟分组数据。
plot(t0, pathGain0, "r--")
hold("on")
plot(t1, pathGain1, "b")
plot(t2, pathGain2, "b")
plot(t3, pathGain3, "b")
xlim([0, 1])
grid("on")
xlabel("Time (s)")
ylabel("Path Gain (dB)")
legend(["Continuous", "Discontinuous"]; loc="northwest")
title("Continuous and Discontinuous Transmission Path Gains")
使用 info 方法来重现多径莱斯衰落信道响应
示例展示了如何使用 comm_RicianChannel 对象的 info object 函数返回的 ChannelFilterCoefficients 属性来重现多径 Rician fading 信道输出。
创建一个多径 Rician fading 信道对象,定义两条路径并指定要通过该信道的数据。
using TyCommunication
using TyMath
rng = mt19937ar(5489)
ricianchan = comm_RicianChannel(;
SampleRate=1000,
PathDelays=[0 1e-3],
AveragePathGains=[0 -2],
PathGainsOutputPort=true,
RandomStream="mt19937ar with seed",
)
ricianchan = comm_RicianChannel( comm_MIMOChannel - Property:
SampleRate: 1000.0
PathDelays: [0.0, 0.001]
AveragePathGains: [0.0, -2.0]
NormalizePathGains: true
FadingDistribution: Rician
MaximumDopplerShift: 0.001
DopplerSpectrum: doppler[doppler - Property:
SpectrumType: Jakes
]
SpatialCorrelationSpecification: None
TransmitCorrelationMatrix: [1 0; 0 1]
ReceiveCorrelationMatrix: [1 0; 0 1]
AntennaSelection: Off
NormalizeChannelOutputs: true
ChannelFiltering: true
PathGainsOutputPort: true
, 1000.0, [0.0, 0.001], [0.0, -2.0], true, [3.0], [0.0], [0.0], 0.001, doppler[doppler - Property:
SpectrumType: Jakes
], true, true, 100, "Filtered Gaussian noise", 48, "Property", 0.0, "mt19937ar with seed", 73, "Off", 1, 0.25, "Rician", "None", 1, 1, "Off", false, [1, 1], "mt19937ar", false)
data = randi(rng, [0 1], 600, 1)
通过通道传递数据 将 ChannelFilterCoefficients 属性值赋值给变量 coeff。
chanout1, pg = step(ricianchan, data)
chaninfo = info(ricianchan)
chaninfo = (ChannelFilterDelay = -0.0, ChannelFilterCoefficients = [1.0 0.0; 0.0 1.0], NumSamplesProcessed = 600)
coeff = chaninfo.ChannelFilterCoefficients
计算系数中存储的路径延迟位置上的分数延迟输入信号。
Np = length(ricianchan.PathDelays)
fracdelaydata = zeros(size(data, 1), Np)
for ii in 1:Np
fracdelaydata[:, ii] = filter1(coeff[ii, :], 1, data)[1]
end
应用路径增益并求和所有路径的结果。
chanout2 = sum(pg .* fracdelaydata; dims=2)
将多径 Rician fading 信道系统对象的输出与使用多径 Rician fading 信道系统对象的路径增益和 ChannelFilterCoefficients 属性重现的输出进行比较。
isequal(chanout1, chanout2)
ans = true
# 更多关于
截止频率系数
截止频率系数
对于高斯和双高斯以外的任何多普勒频谱类型,
等于 1; 对于 doppler("Gaussian") 频谱类型,
等于归一化标准差(NormalizedStandardDeviation) × ; 对于 doppler("BiGaussian") 频谱类型:
如果功率增益(PowerGains[1])和归一化中心频率(NormalizedCenterFrequencies[2])的字段值都是 0,那么
就等于 NormalizedStandardDeviation[1] × ; 如果 PowerGains[2] 和 NormalizedCenterFrequencies[1] 字段值都是 0,那么
等于 NormalizedStandardDeviation[2] × ; 如果 NormalizedCenterFrequencies 字段的值是 [0, 0],而 NormalizedStandardDeviation 字段有两个相同的元素,那么
等于 NormalizedStandardDeviation[1] × ; 在所有其他情况下,
等于 1。
# 参考文献
[1] Oestges, Claude, and Bruno Clerckx. MIMO Wireless Communications: From Real-World Propagation to Space-Time Code Design. 1st ed. Boston, MA: Elsevier, 2007.
[2] Correia, Luis M., and European Cooperation in the Field of Scientific and Technical Research (Organization), eds. Mobile Broadband Multimedia Networks: Techniques, Models and Tools for 4G. 1st ed. Amsterdam ; Boston: Elsevier/Academic Press, 2006.
[3] Kermoal, J.P., L. Schumacher, K.I. Pedersen, P.E. Mogensen, and F. Frederiksen. “A Stochastic MIMO Radio Channel Model with Experimental Validation.” IEEE Journal on Selected Areas in Communications 20, no. 6 (August 2002): 1211–26. https://doi.org/10.1109/JSAC.2002.801223.
[4] Jeruchim, Michel C., Philip Balaban, and K. Sam Shanmugan. Simulation of Communication Systems. Second edition. Boston, MA: Springer US, 2000.
[5] Patzold, M., Cheng-Xiang Wang, and B. Hogstad. “Two New Sum-of-Sinusoids-Based Methods for the Efficient Generation of Multiple Uncorrelated Rayleigh Fading Waveforms.” IEEE Transactions on Wireless Communications 8, no. 6 (June 2009): 3122–31. https://doi.org/10.1109/TWC.2009.080769.
# 另请参阅
comm_AWGNChannel | comm_MIMOChannel | comm_ChannelFilter | comm_RayleighChannel