| Communications Toolbox | ![]() |
Construct a Rayleigh fading channel object
chan = rayleighchan(ts,fd)
chan = rayleighchan(ts,fd,tau,pdb)
chan = rayleighchan
chan = rayleighchan(ts,fd) constructs a frequency-flat ("single path") Rayleigh fading channel object. ts is the sample time of the input signal, in seconds. fd is the maximum Doppler shift, in Hertz. You can model the effect of the channel on a signal x by using the syntax y = filter(chan,x).
chan = rayleighchan(ts,fd,tau,pdb) constructs a frequency-selective ("multiple path") fading channel object that models each discrete path as an independent Rayleigh fading process. tau is a vector of path delays, each specified in seconds. pdb is a vector of average path gains, each specified in dB.
chan = rayleighchan constructs a frequency-flat Rayleigh channel object with no Doppler shift. This is a static channel. The sample time of the input signal is irrelevant for frequency-flat static channels.
The tables below describe the properties of the channel object, chan, that you can set and that MATLAB sets automatically. To learn how to view or change the values of a channel object, see Viewing Object Properties or Changing Object Properties.
Writeable Properties
| Property | Description |
|---|---|
| InputSamplePeriod | Sample period of the signal on which the channel acts, measured in seconds |
| MaxDopplerShift | Maximum Doppler shift of the channel, in Hz |
| PathDelays | Vector listing the delays of the discrete paths, in seconds |
| AvgPathGaindB | Vector listing the average gain of the discrete paths, in dB |
| NormalizePathGains | If 1, the Rayleigh fading process is normalized such that the expected value of the path gains' total power is 1. |
| StoreHistory | If 1, channel state information is stored as the channel filter function processes the signal. The default value is 0. |
| ResetBeforeFiltering | If 1, each call to filter resets the state of chan before filtering. If 0, the fading process maintains continuity from one call to the next. |
Read-Only Properties
| Property | Description | When MATLAB Sets or Updates Value |
|---|---|---|
| ChannelType | Fixed value, 'Rayleigh' | When you create object |
| PathGains | Complex vector listing the current gains of the discrete paths. When you create or reset chan, PathGains is a random vector influenced by AvgPathGaindB and NormalizePathGains. | When you create object, reset object, or use it to filter a signal |
| ChannelFilterDelay | Delay of the channel filter, measured in samples | When you create object or change ratio of InputSamplePeriod to PathDelays |
| NumSamplesProcessed | Number of samples the channel processed since the last reset. When you create or reset chan, this property value is 0. | When you create object, reset object, or use it to filter a signal |
The PathDelays and AvgPathGaindB properties of the channel object must always have the same vector length, because this length equals the number of discrete paths of the channel. If you change the value of PathDelays, then MATLAB truncates or zero-pads the value of AvgPathGaindB if necessary to adjust its vector length. MATLAB might also change the values of read-only properties such as PathGains and ChannelFilterDelay.
The characteristics of a channel can be plotted using the channel visualization tool. See for details.
Several examples using this function are in Fading Channels.
The example below illustrates that when you change the value of PathDelays, MATLAB automatically changes the values of other properties to make their vector lengths consistent with that of the new value of PathDelays.
c1 = rayleighchan(1e-5,130) % Create object. c1.PathDelays = [0 1e-6] % Change the number of delays. % MATLAB automatically changes the size of c1.AvgPathGaindB, % c1.PathGains, and c1.ChannelFilterDelay.
The output below displays all the properties of the channel object before and after the change in the value of the PathDelays property. Notice that in the second listing of properties, the AvgPathGaindB, PathGains, and ChannelFilterDelay properties all have different values compared to the first listing of properties.
c1 =
ChannelType: 'Rayleigh'
InputSamplePeriod: 1.0000e-005
MaxDopplerShift: 130
PathDelays: 0
AvgPathGaindB: 0
NormalizePathGains: 1
StoreHistory: 0
PathGains: 0.2104- 0.6197i
ChannelFilterDelay: 0
ResetBeforeFiltering: 1
NumSamplesProcessed: 0
c1 =
ChannelType: 'Rayleigh'
InputSamplePeriod: 1.0000e-005
MaxDopplerShift: 130
PathDelays: [0 1.0000e-006]
AvgPathGaindB: [0 0]
NormalizePathGains: 1
StoreHistory: 0
PathGains: [-0.3088+ 0.1842i 0.3008- 0.0338i]
ChannelFilterDelay: 4
ResetBeforeFiltering: 1
NumSamplesProcessed: 0
This toolbox models a fading channel as a linear FIR filter, with tap weights given by

where
The summation has one term for each major path.
is the set of path delays.
T is the input sample period.
N1 and N2 are chosen so that |gn| is small when n is less than –N1 or greater than N2.
N1 is the value of the object's ChannelFilterDelay property.
{hk} is the set of complex path gains, which are not correlated with each other.
To generate a particular path gain hk, the function performs these steps:
Generates white Gaussian noise
Passes the noise through a filter whose power spectrum corresponds to the Jakes Doppler spectrum
Interpolates values so that the sample period is consistent with that of the signal
Adjusts accordingly to obtain the correct average path gain
ricianchan, filter, plot (channel), reset, Fading Channels
[1] Jeruchim, Michel C., Philip Balaban, and K. Sam Shanmugan, Simulation of Communication Systems, Second Edition, New York, Kluwer Academic/Plenum, 2000.
| randsrc | rcosfir | ![]() |
© 1994-2005 The MathWorks, Inc.