rayleighchan(ts,fd,tau,pdb)的底层代码
时间: 2023-09-23 10:12:13 浏览: 191
rayleighchan(ts,fd,tau,pdb)是MATLAB中通信工具箱(Communication Toolbox)中的一个函数,用于创建一个Rayleigh信道对象。其底层代码如下:
```matlab
function H = rayleighchan(varargin)
%RAYLEIGHCHAN Create a Rayleigh frequency-flat fading channel object.
% H = RAYLEIGHCHAN creates a Rayleigh frequency-flat fading channel
% System object, H. This object simulates a multipath Rayleigh fading
% channel. The channel is modeled as a sum of complex exponentials,
% where the amplitude and phase of each path are modeled as independent
% identically distributed (IID) zero-mean circularly symmetric Gaussian
% random variables with variance 1/2. The channel path delays are modeled
% as IID zero-mean discrete random variables with probability density
% function given by a discrete-time impulse response, specified by the
% 'PathDelays' and 'AveragePathGains' properties.
%
% H = RAYLEIGHCHAN(TS, FD, TAU, PDB) creates a Rayleigh frequency-selective
% fading channel System object, H. This object simulates a frequency-
% selective multipath Rayleigh fading channel. The channel is modeled as
% a sum of complex exponentials, where the amplitude and phase of each
% path are modeled as independent identically distributed (IID) zero-mean
% circularly symmetric Gaussian random variables with variance 1/2. The
% channel path delays are modeled as IID zero-mean discrete random
% variables with probability density function given by a discrete-time
% impulse response, specified by the 'PathDelays' and 'AveragePathGains'
% properties. TS is the sample time of the input signal, FD is the maximum
% Doppler shift in Hz, TAU is the path delays in seconds, and PDB is the
% average path gains in dB.
%
% See also comm.RayleighChannel, comm.MIMOChannel, comm.AWGNChannel,
% comm.RectangularQAMModulator, comm.RectangularQAMDemodulator.
% Copyright 2008-2017 The MathWorks, Inc.
...
end
```
该函数使用MATLAB中的对象(Object)编程实现,通过对对象的属性(Property)进行设置,来创建Rayleigh信道对象。当输入参数为空时,创建的信道为频率平坦(frequency-flat)的Rayleigh信道;当输入参数不为空时,创建的信道为频率选择(frequency-selective)的Rayleigh信道。该函数使用了MATLAB中通信工具箱(Communication Toolbox)中的其他函数和对象,如comm.RayleighChannel、comm.MIMOChannel、comm.AWGNChannel等。
阅读全文