Skip to content

receiver_sim.py

Corey Koval edited this page Jul 25, 2020 · 2 revisions

receiver_sim.py

def wr_xml(DOA_res_fd, station_id, freq, location, heading, doa, conf, pwr)

Generates the XML output data.

  • DOA_res_fd

    • XML output file descriptor.
  • station_id

    • string, Name of the RDF station.
  • freq

    • float, Frequency of the transmitter
  • location

    • tuple, latitude and longitude of the RDF station
  • heading

    • float, heading of the RDF station
  • doa

    • LOB detected by the RDF station
  • conf

    • Receiver confidence of the LOB
  • pwr

    • SNR of the received signal.

def pathloss(distance)

Calculates the pathloss of the transmitted signal based on distance from the receiver. Returns SNR.

  • distance
    • float, distance between receiver and transmitter in meters.

def rx(station_id, DOA_res_fd, rx_location, freq, tx_location, heading=0)

Calculates LOB and preps data for wr_xml.

  • station_id

    • string, Name of the RDF station.
  • DOA_res_fd

    • XML output file descriptor.
  • rx_location

    • tuple, latitude and longitude of the RDF station
  • freq

    • float, Frequency of the transmitter
  • tx_location

    • tuple, latitude and longitude of the transmitter
  • heading

    • float, heading of the RDF station, defaults to 0

def interpolate_two_points(coord1, coord2, speed, resolution)

Interpolates straight line path between two waypoints.

  • coord1

    • tuple, coordinates of point A
  • coord2

    • tuple, coordinates of point B
  • speed

    • float, speed of moving object in meters per second.
  • resolution

    • float, Generally the refresh rate of the loop running the moving object. Determines how many points to generate based on speed.

interpolate_all_points(waypoints, speed, resolution)

Takes a list of waypoints and interpolates a full list of coordinates to create a path that starts at point 0 and returns to point 0.

  • waypoints

    • list of tuples, all waypoints to interpolate.
  • speed

    • float, speed of moving object in meters per second.
  • resolution

    • float, Generally the refresh rate of the loop running the moving object. Determines how many points to generate based on speed.