Radar Model

Radar Configuration and Phase Noise Modeling in Python

This module contains classes and functions to define and simulate the parameters and behavior of radar systems. It includes tools for configuring radar system properties, modeling oscillator phase noise, and simulating radar motion and noise characteristics. A major focus of the module is on accurately modeling radar signal properties, including phase noise and noise amplitudes.

██████╗  █████╗ ██████╗  █████╗ ██████╗ ███████╗██╗███╗   ███╗██╗  ██╗
██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║████╗ ████║╚██╗██╔╝
██████╔╝███████║██║  ██║███████║██████╔╝███████╗██║██╔████╔██║ ╚███╔╝
██╔══██╗██╔══██║██║  ██║██╔══██║██╔══██╗╚════██║██║██║╚██╔╝██║ ██╔██╗
██║  ██║██║  ██║██████╔╝██║  ██║██║  ██║███████║██║██║ ╚═╝ ██║██╔╝ ██╗
╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝╚═╝     ╚═╝╚═╝  ╚═╝

radarsimpy.Transmitter

class radarsimpy.Transmitter(f, t, tx_power=0, pulses=1, prp=None, f_offset=None, pn_f=None, pn_power=None, channels=None)[source]

Bases: object

Defines the basic parameters and properties of a radar transmitter.

This class handles the waveform configuration, pulse parameters, and properties of the transmitter channels.

Parameters:
  • f (float or numpy.ndarray) –

    Waveform frequency in Hertz (Hz). The value can be:

    • A single number: For a single-tone waveform.

    • A list [f_start, f_stop]: For linear frequency modulation.

    • A 1D array: For arbitrary waveforms, which must be paired with t for timing.

  • t (float or numpy.ndarray) – Timing of the pulse(s) in seconds (s). Used when f is a 1D array to specify an arbitrary waveform.

  • tx_power (float) – Transmitter power in decibels-milliwatts (dBm).

  • pulses (int) – Total number of pulses.

  • prp (float or numpy.ndarray) –

    Pulse repetition period (PRP) in seconds (s). Must satisfy prp >= pulse_length.

    • If prp is None, it defaults to pulse_length.

    • Can also be a 1D array to specify different PRPs for each pulse. In this case, the array length must match pulses.

  • f_offset (numpy.ndarray) – Frequency offset for each pulse in Hertz (Hz). The length must match pulses.

  • pn_f (numpy.ndarray) – Frequencies associated with phase noise in Hertz (Hz).

  • pn_power (numpy.ndarray) – Power of phase noise in dB/Hz.

  • channels (list[dict]) –

    Properties of transmitter channels. Each channel is represented as a dictionary with the following keys:

    • location (numpy.ndarray): 3D location of the channel relative to the radar [x, y, z] in meters.

    • polarization (numpy.ndarray): Antenna polarization vector [x, y, z]. Default: [0, 0, 1] (vertical polarization). Examples:

      • Vertical polarization: [0, 0, 1]

      • Horizontal polarization: [0, 1, 0]

      • Right-handed circular polarization: [0, 1, 1j]

      • Left-handed circular polarization: [0, 1, -1j]

    • delay (float): Transmit delay (s). Default: 0.

    • azimuth_angle (numpy.ndarray): Azimuth angles in degrees (°). Default: [-90, 90].

    • azimuth_pattern (numpy.ndarray): Azimuth pattern in decibels (dB). Default: [0, 0].

    • elevation_angle (numpy.ndarray): Elevation angles in degrees (°). Default: [-90, 90].

    • elevation_pattern (numpy.ndarray): Elevation pattern in decibels (dB). Default: [0, 0].

    • pulse_amp (numpy.ndarray): Relative amplitude sequence for pulse amplitude modulation. Length must match pulses. Default: 1.

    • pulse_phs (numpy.ndarray): Phase code sequence for pulse phase modulation in degrees (°). Length must match pulses. Default: 0.

    • mod_t (numpy.ndarray): Timestamps for waveform modulation in seconds (s). Default: None.

    • phs (numpy.ndarray): Phase modulation scheme in degrees (°). Default: None.

    • amp (numpy.ndarray): Relative amplitude scheme for waveform modulation. Default: None.

Variables:
  • rf_prop (dict) –

    RF properties of the transmitter:

    • tx_power (float): Transmitter power in dBm.

    • pn_f (numpy.ndarray): Frequencies associated with phase noise (Hz).

    • pn_power (numpy.ndarray): Power of phase noise (dB/Hz).

  • waveform_prop (dict) –

    Waveform properties:

    • f (float or numpy.ndarray): Waveform frequency (Hz).

    • t (float or numpy.ndarray): Timing of each pulse (s).

    • bandwidth (float): Transmitting bandwidth (Hz).

    • pulse_length (float): Duration of each pulse (s).

    • pulses (int): Total number of pulses.

    • f_offset (numpy.ndarray): Frequency offset for each pulse (Hz).

    • prp (float or numpy.ndarray): Pulse repetition period (s).

    • pulse_start_time (numpy.ndarray): Start times of each pulse (s).

  • txchannel_prop (dict) –

    Properties of the transmitter channels:

    • size (int): Number of transmitter channels.

    • delay (numpy.ndarray): Transmitter start delay (s).

    • grid (float): Ray tracing grid size (°).

    • locations (numpy.ndarray): 3D locations of the transmitter channels [x, y, z] in meters.

    • polarization (numpy.ndarray): Polarization vectors of the transmitter channels.

    • waveform_mod (dict): Waveform modulation parameters.

    • pulse_mod (dict): Pulse modulation parameters.

    • az_angles (numpy.ndarray): Azimuth angles (°).

    • az_patterns (numpy.ndarray): Azimuth patterns (dB).

    • el_angles (numpy.ndarray): Elevation angles (°).

    • el_patterns (numpy.ndarray): Elevation patterns (dB).

    • antenna_gains (numpy.ndarray): Transmitter antenna gains (dB).

Waveform Schematic:

Illustration of the waveform, pulse repetition period, and modulation:

█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
█                        prp                                            █
█                   +-----------+                                       █
█       +---f[1]--------->  /            /            /                 █
█                          /            /            /                  █
█                         /            /            /                   █
█                        /            /            /                    █
█                       /            /            /     ...             █
█                      /            /            /                      █
█                     /            /            /                       █
█                    /            /            /                        █
█       +---f[0]--->/            /            /                         █
█                   +-------+                                           █
█                  t[0]    t[1]                                         █
█                                                                       █
█     Pulse         +--------------------------------------+            █
█     modulation    |pulse_amp[0]|pulse_amp[1]|pulse_amp[2]|  ...       █
█                   |pulse_phs[0]|pulse_phs[1]|pulse_phs[2]|  ...       █
█                   +--------------------------------------+            █
█                                                                       █
█     Waveform      +--------------------------------------+            █
█     modulation    |           amp / phs / mod_t          |  ...       █
█                   +--------------------------------------+            █
█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █

radarsimpy.Receiver

class radarsimpy.Receiver(fs, noise_figure=10, rf_gain=0, load_resistor=500, baseband_gain=0, bb_type='complex', channels=None)[source]

Bases: object

Represents the basic parameters and properties of a radar receiver.

This class defines the RF and baseband properties of a radar receiver, along with the characteristics of its receiver channels.

Parameters:
  • fs (float) – Sampling rate in samples per second (sps).

  • noise_figure (float) – Noise figure of the receiver in decibels (dB).

  • rf_gain (float) – Total RF gain of the receiver in decibels (dB).

  • load_resistor (float) – Load resistance to convert power to voltage, in ohms (Ω).

  • baseband_gain (float) – Total baseband gain in decibels (dB).

  • bb_type (str) – Baseband data type, either complex or real. Defaults to complex.

  • channels (list[dict]) –

    A list of dictionaries defining the properties of receiver channels, where each dictionary contains the following keys:

    • location (numpy.ndarray): 3D location of the channel relative to the radar’s position [x, y, z] in meters.

    • polarization (numpy.ndarray): Antenna polarization vector [x, y, z]. Defaults to [0, 0, 1] (vertical polarization). Examples:

      • Vertical polarization: [0, 0, 1]

      • Horizontal polarization: [0, 1, 0]

      • Right-handed circular polarization: [0, 1, 1j]

      • Left-handed circular polarization: [0, 1, -1j]

    • azimuth_angle (numpy.ndarray): Azimuth pattern angles in degrees. Defaults to [-90, 90].

    • azimuth_pattern (numpy.ndarray): Azimuth pattern in decibels (dB). Defaults to [0, 0].

    • elevation_angle (numpy.ndarray): Elevation pattern angles in degrees. Defaults to [-90, 90].

    • elevation_pattern (numpy.ndarray): Elevation pattern in decibels (dB). Defaults to [0, 0].

Variables:
  • rf_prop (dict) –

    RF properties of the receiver:

    • rf_gain (float): RF gain in decibels (dB).

    • noise_figure (float): Noise figure in decibels (dB).

  • bb_prop (dict) –

    Baseband properties of the receiver:

    • fs (float): Sampling rate in samples per second (sps).

    • load_resistor (float): Load resistance in ohms (Ω).

    • baseband_gain (float): Baseband gain in decibels (dB).

    • bb_type (str): Baseband data type, either real or complex.

  • rxchannel_prop (dict) –

    Properties of the receiver channels:

    • size (int): Number of receiver channels.

    • locations (numpy.ndarray): 3D locations of the receiver channels [x, y, z] in meters.

    • polarization (numpy.ndarray): Polarization vectors of the receiver channels.

    • az_angles (numpy.ndarray): Azimuth angles in degrees.

    • az_patterns (numpy.ndarray): Azimuth pattern in decibels (dB).

    • el_angles (numpy.ndarray): Elevation angles in degrees.

    • el_patterns (numpy.ndarray): Elevation pattern in decibels (dB).

    • antenna_gains (numpy.ndarray): Antenna gains of the receiver channels in decibels (dB).

Receiver Noise Model:

The following diagram illustrates the radar receiver noise model and calculations:

█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
█  +-------------+                                              █
█  | Rx Antenna  |                                              █
█  +------+------+                                              █
█         | n1 = 10*log10(boltzmann_const * noise_temp * 1000)  █
█         ↓      + 10*log10(noise_bandwidth)  (dBm)             █
█  +------+------+                                              █
█  |    RF Amp   |                                              █
█  +------+------+                                              █
█         | n2 = n1 + noise_figure + rf_gain (dBm)              █
█         ↓ n3 = 1e-3 * 10^(n2/10) (Watts)                      █
█  +------+------+                                              █
█  |    Mixer    |                                              █
█  +------+------+                                              █
█         | n4 = sqrt(n3 * load_resistor) (V)                   █
█         ↓                                                     █
█  +------+------+                                              █
█  |Baseband Amp |                                              █
█  +------+------+                                              █
█         | noise amplitude (peak to peak)                      █
█         ↓ n5 = n4 * 10^(baseband_gain / 20) * sqrt(2) (V)     █
█  +------+------+                                              █
█  |     ADC     |                                              █
█  +-------------+                                              █
█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █

radarsimpy.Radar

class radarsimpy.Radar(transmitter, receiver, location=(0, 0, 0), speed=(0, 0, 0), rotation=(0, 0, 0), rotation_rate=(0, 0, 0), seed=None, **kwargs)[source]

Bases: object

Defines the basic parameters and properties of a radar system.

This class represents the overall configuration of a radar system, including its transmitter, receiver, spatial properties (location, speed, orientation), and associated metadata.

Parameters:
  • transmitter (Transmitter) – The radar transmitter instance.

  • receiver (Receiver) – The radar receiver instance.

  • location (list) – The 3D location of the radar relative to a global coordinate system [x, y, z] in meters (m). Default: [0, 0, 0].

  • speed (list) – The velocity of the radar in meters per second (m/s), specified as [vx, vy, vz]. Default: [0, 0, 0].

  • rotation (list) – The radar’s orientation in degrees (°), specified as [yaw, pitch, roll]. Default: [0, 0, 0].

  • rotation_rate (list) – The radar’s angular velocity in degrees per second (°/s), specified as [yaw rate, pitch rate, roll rate]. Default: [0, 0, 0].

  • seed (int) – Seed for the random noise generator to ensure reproducibility.

Variables:
  • time_prop (dict) –

    Time-related properties of the radar system:

    • timestamp_shape (tuple): The shape of the timestamp array.

    • timestamp (numpy.ndarray): The timestamp for each sample in a frame, structured as [channels, pulses, samples]. Channel order in timestamp (with M Tx channels and N Rx channels):

      • [0, :, :]: Tx[0] Rx[0]

      • [1, :, :]: Tx[0] Rx[1]

      • [N-1, :, :]: Tx[0] Rx[N-1]

      • [N, :, :]: Tx[1] Rx[0]

      • [MN-1, :, :]: Tx[M-1] Rx[N-1]

  • sample_prop (dict) –

    Sample-related properties:

    • samples_per_pulse (int): Number of samples in a single pulse.

    • noise (float): Noise amplitude.

    • phase_noise (numpy.ndarray): Phase noise matrix for pulse samples.

  • array_prop (dict) –

    Metadata related to the radar’s virtual array:

    • size (int): Total number of virtual array elements.

    • virtual_array (numpy.ndarray): 3D locations of each virtual array element, structured as [channel_size, 3] where each row corresponds to an [x, y, z] position.

  • radar_prop (dict) –

    Radar system properties:

    • transmitter (Transmitter): Instance of the radar transmitter.

    • receiver (Receiver): Instance of the radar receiver.

    • location (list): The radar’s 3D location in meters (m).

    • speed (list): The radar’s velocity in meters per second (m/s).

    • rotation (list): The radar’s orientation in radians (rad).

    • rotation_rate (list): Angular velocity of the radar in radians per second (rad/s).