DEEKSHITH N S
DEEKSHITH N S

Reputation: 77

How to get the reception signal power value in simulation script?

I have a channel model, where some transmission loss is calculated, If I have to test it against different values of frequency and print the values calculated in getRxPower(rx) function in simulation script, how can I access this value in the simulation script.

Upvotes: 2

Views: 74

Answers (1)

Mandar Chitre
Mandar Chitre

Reputation: 2280

The simplest way may be to create your own channel model that extends the UrickAcousticModel, override the getRxPower() method, and log the return value of the original method before returning it.

This might look something like:

public class MyUrickAcousticModel extends org.arl.unet.sim.channels.UrickAcousticModel {

  protected Logger log = Logger.getLogger(getClass().getName());

  @Override
  public double getRxPower(org.arl.unet.sim.Reception rx) {
    double v = super.getRxPower(rx);
    log.info("getRxPower returned "+v);
    return v;
  }

}

You can then use this model in your simulation, exactly in the same way as the UrickAcousticModel.

Upvotes: 2

Related Questions