Skip to content

Rayleigh fading computation #956

@dragos-bth

Description

@dragos-bth

Hi,

I am looking into the source code for computing Rayleigh fading in INET/INETMANET

double RayleighFading::computePathLoss(mps propagationSpeed, Hz frequency, m distance) const
{
m waveLength = propagationSpeed / frequency;
double freeSpacePathLoss = computeFreeSpacePathLoss(waveLength, distance, alpha, systemLoss);
double x = normal(0, 1);
double y = normal(0, 1);
return freeSpacePathLoss * 0.5 * (x * x + y * y);
}

double RayleighFading::computePathLoss(mps propagationSpeed, Hz frequency, m distance) const
{
    m waveLength = propagationSpeed / frequency;
    double freeSpacePathLoss = computeFreeSpacePathLoss(waveLength, distance, alpha, systemLoss);
    double x = normal(0, 1);
    double y = normal(0, 1);
    return freeSpacePathLoss * 0.5 * (x * x + y * y);
}

I would like to understand where 0.5 term comes from on the line with the return statement. As far as I know, $\sqrt{x^2 + y^2}$ has a Rayleigh density when $x$ and $y$ are normal and independent random variables with zero mean and equal variance. Therefore I was expecting that line to look like

return freeSpacePathLoss * sqrt((x * x + y * y));

This has also been reported in the OMNeT++ discussions: omnetpp/omnetpp#1119.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions