Click or drag to resize

Code Sample

Below is a detailed code example for a monostatic radar, tracking a target aircraft with interference from a secondary radar system.

Note Note

The functionality described in this topic requires a license for the Radar Library and the Communications Library.

Aircraft Target
Java
JulianDate epoch = new GregorianDate(2016, 7, 27, 16, 0, 0.0).toJulianDate();
double aircraftAltitude = 10668.0; // meters
double aircraftRadarCrossSection = 0.1; //meters squared
SwerlingTargetModel aircraftSwerlingModel = SwerlingTargetModel.II;
CentralBody earth = CentralBodiesFacet.getFromContext().getEarth();

JulianDate[] wayPointTimes = {
    epoch,
    new GregorianDate(2016, 7, 27, 16, 3, 59.991).toJulianDate(),
    new GregorianDate(2016, 7, 27, 16, 9, 26.975).toJulianDate(),
};

Cartographic[] wayPointLocations = {
    new Cartographic(Trig.degreesToRadians(-75.97198961), Trig.degreesToRadians(39.77474399), aircraftAltitude),
    new Cartographic(Trig.degreesToRadians(-75.59880655), Trig.degreesToRadians(40.03338572), aircraftAltitude),
    new Cartographic(Trig.degreesToRadians(-75.03595287), Trig.degreesToRadians(40.34252416), aircraftAltitude),
};
WaypointPropagator aircraftPropagator =
        WaypointPropagator.constructConstantVelocityWaypointPropagator(earth, Arrays.asList(wayPointTimes), Arrays.asList(wayPointLocations));

//Construct the target platform
Platform radarTargetPlatform = new Platform();
radarTargetPlatform.setLocationPoint(aircraftPropagator.createPoint());
radarTargetPlatform.setOrientationAxes(new AxesVehicleVelocityLocalHorizontal(earth.getInertialFrame(), radarTargetPlatform.getLocationPoint()));

ConstantCrossSectionScatteringCoefficient constantCrossSection = new ConstantCrossSectionScatteringCoefficient(aircraftRadarCrossSection);

//Construct the radar cross section platform extension with a constant cross section coefficient
TargetRadarCrossSectionExtension targetExtension = new TargetRadarCrossSectionExtension(constantCrossSection);
PointScattererFrequencyBand firstBand = targetExtension.getFrequencyBands().get(0);

//Additional signal data can be added to each frequency band which will be added to the processed reflected signal, which can be discovered by downstream processors.  Below we are
//adding a data structure to the signal data which indicates the frequency band Swerling case of this target, used by the downstream Mitchell-Walker probability-of-detection algorithm.
firstBand.getSignalData().add(new SignalSwerlingTargetModel(aircraftSwerlingModel));
radarTargetPlatform.getExtensions().add(targetExtension);
Radar Transmitter
Java
//Radar Latitude, Longitude, and Altitude
double radarLatitude = 0.698806;
double radarLongitude = -1.31941;
double radarAltitude = 0.0;

//Transmit waveform properties.
double pulseRepetitionFrequency = 1.0e6;
double pulseWidth = 1 / (2 * pulseRepetitionFrequency);
int pulseCount = 20;

//Transmitter properties
double wavelength = 0.1; //meters
double frequency = Constants.SpeedOfLight / wavelength;
double amplifierGain = 1e4;
double antennaDiameter = 5.0; //meters;
double antennaEfficiency = 0.8;
double antennaBacklobeGain = 0.001;
ParabolicGainPattern parabolicGainPattern = new ParabolicGainPattern(antennaDiameter, antennaEfficiency, antennaBacklobeGain);

//Define the monostatic radar Point which will be used by both the radar transmitter and receiver platforms
Cartographic monostaticRadarLocation = new Cartographic(radarLongitude, radarLatitude, radarAltitude);
Point monostaticPoint = new PointCartographic(earth, monostaticRadarLocation);

//Construct the radar transmitter platform
Platform radarTransmitterPlatform = new Platform();
radarTransmitterPlatform.setLocationPoint(monostaticPoint);

//Using the AxesAlignedConstrained axes type will target the radar transmitter antenna boresight at the radar target
VectorFixed earthZAxis = new VectorFixed(earth.getInertialFrame().getAxes(), Cartesian.toCartesian(UnitCartesian.getUnitZ()));
Axes targetTrackingAxes = new AxesAlignedConstrained(new VectorTrueDisplacement(monostaticPoint, radarTargetPlatform.getLocationPoint()),
        AxisIndicator.THIRD, earthZAxis, AxisIndicator.FIRST);
radarTransmitterPlatform.setOrientationAxes(targetTrackingAxes);

//Transmitter identification.  This platform extension is used by the IntendedSignalByTransmitter intended signal strategy for identifying the
//desired signal.
IdentifiableTransmitterExtension transmitterIdentifier = new IdentifiableTransmitterExtension();
SignalDataCollection additionalSignalData = new SignalDataCollection();
additionalSignalData.add(transmitterIdentifier.getIdentifier());

//Pulsed Signal Source
PulsedSignalData pulsedSignalData = new PulsedSignalData(pulseRepetitionFrequency, pulseWidth, pulseCount);
PulsedSignalSource pulsedSignalSource = new PulsedSignalSource(pulsedSignalData, additionalSignalData);

//Pulsed Signal Modulator
PulsedSignalModulator modulator = new PulsedSignalModulator(pulsedSignalSource, Constants.SpeedOfLight / wavelength);

//Constant Gain Amplifier
ConstantGainAmplifier amplifier = new ConstantGainAmplifier(modulator, amplifierGain);

//Transmitting Antenna Extension
RadarTransmittingAntennaExtension transmitAntennaExtension = new RadarTransmittingAntennaExtension(amplifier, parabolicGainPattern);
radarTransmitterPlatform.getExtensions().add(transmitAntennaExtension);
radarTransmitterPlatform.getExtensions().add(transmitterIdentifier); //Transmitter identification
Radar Receiver
Java
//Construct the radar receiver platform
Platform radarReceiverPlatform = new Platform();
radarReceiverPlatform.setLocationPoint(monostaticPoint);
radarReceiverPlatform.setOrientationAxes(targetTrackingAxes);

//Receiver properties
double noiseBandwidth = 1.0 / pulseWidth;
double halfNoiseBandwidth = noiseBandwidth / 2.0;
double lowNoiseAmplifierGain = 1e4;
double antennaNoiseTemperature = 290.0;

//Receiver Antenna Extension
RadarReceivingAntennaExtension receiveAntennaExtension = new RadarReceivingAntennaExtension(parabolicGainPattern, antennaNoiseTemperature);
radarReceiverPlatform.getExtensions().add(receiveAntennaExtension);

//Configure the receiver filter
RectangularFilter filter = new RectangularFilter(receiveAntennaExtension.getOutputSignalProcessor(), 0.0, frequency, -halfNoiseBandwidth, halfNoiseBandwidth);

//Receiver Low Noise Amplifier
ConstantGainAmplifier lowNoiseAmplifier = new ConstantGainAmplifier(filter, lowNoiseAmplifierGain);

//Configure the SignalOutputExtension
SignalOutputExtension signalOutput = new SignalOutputExtension(lowNoiseAmplifier);
radarReceiverPlatform.getExtensions().add(signalOutput);

//Configure waveform processing
PerfectFixedNumberOfPulsesWaveformIntegrator waveformIntegrator = new PerfectFixedNumberOfPulsesWaveformIntegrator(pulseCount);

//Attach the last SignalProcessor as input to the first RadarWaveformProcessor
waveformIntegrator.attachSignalProcessorAsInput(lowNoiseAmplifier);

ProcessedRadarWaveformOutputExtension processedWaveformOutput = new ProcessedRadarWaveformOutputExtension(waveformIntegrator);
radarReceiverPlatform.getExtensions().add(processedWaveformOutput);
Links and Signal Propagation Graph
Java
//Construct the forward link from the transmitter to the target
LinkSpeedOfLight forwardLink = new LinkSpeedOfLight(radarTransmitterPlatform, radarTargetPlatform, earth.getInertialFrame());
forwardLink.getExtensions().add(new WirelessLinkExtension());

//Construct the return link from the target to the receiver
LinkSpeedOfLight returnLink = new LinkSpeedOfLight(radarTargetPlatform, radarReceiverPlatform, earth.getInertialFrame());
returnLink.getExtensions().add(new WirelessLinkExtension());

SignalPropagationGraph propagationGraph = new SignalPropagationGraph();
propagationGraph.addLink(forwardLink);
propagationGraph.addLink(returnLink);
Interfering Secondary Radar
Java
//Radar Latitude, Longitude, and Altitude
double interferingRadarLatitude = 0.69865;
double interferingRadarLongitude = -1.31893;
double interferingRadarAltitude = 30.0;
Cartographic interferingRadarCartographic = new Cartographic(interferingRadarLongitude, interferingRadarLatitude, interferingRadarAltitude);

//Construct the interfering radar transmitter platform
Platform interferingRadarTransmitterPlatform = new Platform();
interferingRadarTransmitterPlatform.setLocationPoint(new PointCartographic(earth, interferingRadarCartographic));
interferingRadarTransmitterPlatform.setOrientationAxes(new AxesEastNorthUp(earth, interferingRadarTransmitterPlatform.getLocationPoint()));
interferingRadarTransmitterPlatform.getExtensions().add(new IdentifiableTransmitterExtension());

//Pulsed Signal Source
PulsedSignalData interferencePulsedSignalData = new PulsedSignalData(pulseRepetitionFrequency, pulseWidth, pulseCount);
PulsedSignalSource interferencePulsedSignalSource = new PulsedSignalSource(interferencePulsedSignalData);

//Pulsed Signal Modulator
PulsedSignalModulator interferenceModulator = new PulsedSignalModulator(interferencePulsedSignalSource, Constants.SpeedOfLight / wavelength);

//Constant Gain Amplifier
ConstantGainAmplifier interferenceAmplifier = new ConstantGainAmplifier(interferenceModulator, amplifierGain);

//Interfering Radar Transmitting Antenna Extension
RadarTransmittingAntennaExtension interferingAntennaExtension = new RadarTransmittingAntennaExtension(interferenceAmplifier, new IsotropicGainPattern());
interferingRadarTransmitterPlatform.getExtensions().add(interferingAntennaExtension);

//Construct the interference link
LinkSpeedOfLight interferenceLink = new LinkSpeedOfLight(interferingRadarTransmitterPlatform, radarReceiverPlatform, earth.getInertialFrame());
interferenceLink.getExtensions().add(new WirelessLinkExtension());

//Add the interference link to the propagation graph
propagationGraph.addLink(interferenceLink);
SingleTargetRadarLinkScalars and Evaluators
Java
//Construct the intended signal strategy.
IntendedSignalByTransmitter intendedSignalStrategy = new IntendedSignalByTransmitter(radarTransmitterPlatform);

//Construct the scalar types
SignalToNoiseRatioScalar signalToNoiseRatioScalar = new SignalToNoiseRatioScalar(radarTransmitterPlatform, radarTargetPlatform, radarReceiverPlatform, intendedSignalStrategy,
        propagationGraph, false, SignalToNoiseRatioComputeMode.SINGLE_PULSE);
SignalToNoiseRatioScalar integratedSignalToNoiseRatioScalar = new SignalToNoiseRatioScalar(radarTransmitterPlatform, radarTargetPlatform, radarReceiverPlatform, intendedSignalStrategy,
        propagationGraph, false, SignalToNoiseRatioComputeMode.INTEGRATED);
SignalToNoiseRatioScalar signalToNoisePlusInterferenceRatioScalar = new SignalToNoiseRatioScalar(radarTransmitterPlatform, radarTargetPlatform, radarReceiverPlatform, intendedSignalStrategy,
        propagationGraph, true, SignalToNoiseRatioComputeMode.SINGLE_PULSE);
SignalToNoiseRatioScalar integratedSignalToNoisePlusInterferenceRatioScalar = new SignalToNoiseRatioScalar(radarTransmitterPlatform, radarTargetPlatform, radarReceiverPlatform,
        intendedSignalStrategy, propagationGraph, true, SignalToNoiseRatioComputeMode.INTEGRATED);

//Construct the evaluator group
EvaluatorGroup group = new EvaluatorGroup();

//Get the evaluators from the scalar instances
ScalarEvaluator signalToNoiseRatioEvaluator = signalToNoiseRatioScalar.getEvaluator(group);
ScalarEvaluator integratedSignalToNoiseRatioEvaluator = integratedSignalToNoiseRatioScalar.getEvaluator(group);
ScalarEvaluator signalToNoisePlusInterferenceRatioEvaluator = signalToNoisePlusInterferenceRatioScalar.getEvaluator(group);
ScalarEvaluator integratedSignalToNoisePlusInterferenceRatioEvaluator = integratedSignalToNoisePlusInterferenceRatioScalar.getEvaluator(group);

group.optimizeEvaluators();

JulianDate pulseTransmissionTime = epoch;
int analysisDuration = 30; //seconds;

double[] signalToNoiseRatio = new double[analysisDuration];
double[] integratedSignalToNoiseRatio = new double[analysisDuration];
double[] signalToNoisePlusInterferenceRatio = new double[analysisDuration];
double[] integratedSignalToNoisePlusInterferenceRatio = new double[analysisDuration];

for (int i = 0; i < analysisDuration; ++i) {
    signalToNoiseRatio[i] = signalToNoiseRatioEvaluator.evaluate(pulseTransmissionTime);
    integratedSignalToNoiseRatio[i] = integratedSignalToNoiseRatioEvaluator.evaluate(pulseTransmissionTime);
    signalToNoisePlusInterferenceRatio[i] = signalToNoisePlusInterferenceRatioEvaluator.evaluate(pulseTransmissionTime);
    integratedSignalToNoisePlusInterferenceRatio[i] = integratedSignalToNoisePlusInterferenceRatioEvaluator.evaluate(pulseTransmissionTime);
    pulseTransmissionTime = pulseTransmissionTime.addSeconds(i);
}