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
C#
JulianDate epoch = new JulianDate(new GregorianDate(2016, 7, 27, 16, 0, 0));

double aircraftAltitude = 10668.0; // meters
double aircraftRadarCrossSection = 0.1; //meters squared
SwerlingTargetModel aircraftSwerlingModel = SwerlingTargetModel.II;

CentralBody earth = CentralBodiesFacet.GetFromContext().Earth;

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

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, wayPointTimes, wayPointLocations);
Point aircraftPoint = aircraftPropagator.CreatePoint();

//Construct the target platform
Platform radarTargetPlatform = new Platform
{
    LocationPoint = aircraftPoint
};
radarTargetPlatform.OrientationAxes = new AxesVehicleVelocityLocalHorizontal(earth.InertialFrame, radarTargetPlatform.LocationPoint);

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.FrequencyBands[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.SignalData.Add(new SignalSwerlingTargetModel(aircraftSwerlingModel));

radarTargetPlatform.Extensions.Add(targetExtension);
Radar Transmitter
C#
//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
{
    LocationPoint = monostaticPoint
};

//Using the AxesAlignedConstrained axes type will target the radar transmitter antenna boresight at the radar target
VectorFixed earthZAxis = new VectorFixed(earth.InertialFrame.Axes, UnitCartesian.UnitZ);
Axes targetTrackingAxes = new AxesAlignedConstrained(new VectorTrueDisplacement(monostaticPoint, radarTargetPlatform.LocationPoint),
                                                     AxisIndicator.Third, earthZAxis, AxisIndicator.First);

radarTransmitterPlatform.OrientationAxes = 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
{
    transmitterIdentifier.Identifier
};

//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.Extensions.Add(transmitAntennaExtension);
radarTransmitterPlatform.Extensions.Add(transmitterIdentifier); //Transmitter identification
Radar Receiver
C#
//Construct the radar receiver platform
Platform radarReceiverPlatform = new Platform
{
    LocationPoint = monostaticPoint,
    OrientationAxes = 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.Extensions.Add(receiveAntennaExtension);

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

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

//Configure the SignalOutputExtension
SignalOutputExtension signalOutput = new SignalOutputExtension(lowNoiseAmplifier);
radarReceiverPlatform.Extensions.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.Extensions.Add(processedWaveformOutput);
Links and Signal Propagation Graph
C#
//Construct the forward link from the transmitter to the target
LinkSpeedOfLight forwardLink = new LinkSpeedOfLight(radarTransmitterPlatform, radarTargetPlatform, earth.InertialFrame);
forwardLink.Extensions.Add(new WirelessLinkExtension());

//Construct the return link from the target to the receiver
LinkSpeedOfLight returnLink = new LinkSpeedOfLight(radarTargetPlatform, radarReceiverPlatform, earth.InertialFrame);
returnLink.Extensions.Add(new WirelessLinkExtension());

SignalPropagationGraph propagationGraph = new SignalPropagationGraph();
propagationGraph.AddLink(forwardLink);
propagationGraph.AddLink(returnLink);
Interfering Secondary Radar
C#
//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
{
    LocationPoint = new PointCartographic(earth, interferingRadarCartographic)
};
interferingRadarTransmitterPlatform.OrientationAxes = new AxesEastNorthUp(earth, interferingRadarTransmitterPlatform.LocationPoint);

interferingRadarTransmitterPlatform.Extensions.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.Extensions.Add(interferingAntennaExtension);

//Construct the interference link
LinkSpeedOfLight interferenceLink = new LinkSpeedOfLight(interferingRadarTransmitterPlatform, radarReceiverPlatform, earth.InertialFrame);
interferenceLink.Extensions.Add(new WirelessLinkExtension());

//Add the interference link to the propagation graph
propagationGraph.AddLink(interferenceLink);
SingleTargetRadarLinkScalars and Evaluators
C#
//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.SinglePulse);

SignalToNoiseRatioScalar integratedSignalToNoiseRatioScalar =
    new SignalToNoiseRatioScalar(radarTransmitterPlatform,
                                 radarTargetPlatform,
                                 radarReceiverPlatform,
                                 intendedSignalStrategy,
                                 propagationGraph, false,
                                 SignalToNoiseRatioComputeMode.Integrated);

SignalToNoiseRatioScalar signalToNoisePlusInterferenceRatioScalar =
    new SignalToNoiseRatioScalar(radarTransmitterPlatform,
                                 radarTargetPlatform,
                                 radarReceiverPlatform,
                                 intendedSignalStrategy,
                                 propagationGraph, true,
                                 SignalToNoiseRatioComputeMode.SinglePulse);

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);
}