|
FERS 0.1.0
The Flexible Extensible Radar Simulator
|
Manages radar signal reception and response processing. More...
#include "receiver.h"
Inheritance diagram for radar::Receiver:
Collaboration diagram for radar::Receiver:Classes | |
| struct | DechirpReference |
| Parsed and resolved dechirp reference details. More... | |
| struct | FmcwIfChainRequest |
| Receiver-local FMCW IF-chain request parsed from scenario input. More... | |
Public Types | |
| enum class | RecvFlag : std::uint8_t { FLAG_NODIRECT = 1 , FLAG_NOPROPLOSS = 2 } |
| Enumeration for receiver configuration flags. More... | |
| enum class | DechirpMode : std::uint8_t { None , Physical , Ideal } |
| Receiver-side FMCW dechirping mode. More... | |
| enum class | DechirpReferenceSource : std::uint8_t { None , Attached , Transmitter , Custom } |
| Source used to construct the receiver LO reference. More... | |
| using | FmcwIfOutputCallback = std::function< void(std::span< const ComplexType >, std::uint64_t)> |
Public Member Functions | |
| Receiver (Platform *platform, std::string name, unsigned seed, OperationMode mode, const SimId id=0) noexcept | |
| Constructs a Receiver object. | |
| ~Receiver () override=default | |
| Receiver (const Receiver &)=delete | |
| Receiver (Receiver &&)=delete | |
| Receiver & | operator= (const Receiver &)=delete |
| Receiver & | operator= (Receiver &&)=delete |
| void | addResponseToInbox (std::unique_ptr< serial::Response > response) noexcept |
| Adds a response to the receiver's pulsed-mode inbox. | |
| void | addInterferenceToLog (std::unique_ptr< serial::Response > response) noexcept |
| Adds a pulsed interference response to the receiver's streaming-mode log. | |
| bool | checkFlag (RecvFlag flag) const noexcept |
| Checks if a specific flag is set. | |
| SimId | getId () const noexcept |
| Retrieves the unique ID of the receiver. | |
| RealType | getNoiseTemperature () const noexcept |
| Retrieves the noise temperature of the receiver. | |
| RealType | getWindowLength () const noexcept |
| Retrieves the radar window length. | |
| RealType | getWindowPrf () const noexcept |
| Retrieves the pulse repetition frequency (PRF) of the radar window. | |
| RealType | getWindowSkip () const noexcept |
| Retrieves the window skip time. | |
| RealType | getNoiseTemperature (const math::SVec3 &angle) const noexcept override |
| Gets the noise temperature for a specific angle. | |
| RealType | getWindowStart (unsigned window) const |
| Retrieves the start time of a specific radar window. | |
| unsigned | getWindowCount () const noexcept |
| Gets the number of radar windows. | |
| std::mt19937 & | getRngEngine () noexcept |
| Gets the receiver's internal random number generator engine. | |
| OperationMode | getMode () const noexcept |
| Gets the operational mode of the receiver. | |
| DechirpMode | getDechirpMode () const noexcept |
| Gets the configured dechirp mode. | |
| bool | isDechirpEnabled () const noexcept |
| Returns true when the receiver emits dechirped IF data. | |
| const DechirpReference & | getDechirpReference () const noexcept |
| Gets the configured dechirp reference. | |
| const FmcwIfChainRequest & | getFmcwIfChainRequest () const noexcept |
| Gets the optional receiver-local FMCW IF-chain request. | |
| std::optional< RealType > | getIfSampleRate () const noexcept |
| Gets the receiver-local FMCW IF sample rate in Hz. | |
| std::optional< RealType > | getIfFilterBandwidth () const noexcept |
| Gets the receiver-local FMCW IF filter bandwidth in Hz. | |
| std::optional< RealType > | getIfFilterTransitionWidth () const noexcept |
| Gets the receiver-local FMCW IF filter transition width in Hz. | |
| bool | hasFmcwIfSampleRate () const noexcept |
| Returns true when this receiver requests IF-rate FMCW output. | |
| bool | hasFmcwIfResamplingSink () const noexcept |
| Returns true when this receiver is using the online FMCW IF resampling sink. | |
| const std::optional< fers_signal::FmcwIfResamplerPlan > & | getFmcwIfResamplerPlan () const noexcept |
| Gets the active or most recently used IF resampling plan, if any. | |
| const std::vector< core::ActiveStreamingSource > & | getDechirpSources () const noexcept |
| Gets resolved receive-time LO source segments. | |
| bool | isActive () const noexcept |
| Checks if the receiver is currently active (listening). | |
| void | setActive (const bool active) noexcept |
| Sets the active state of the receiver. | |
| void | setMode (OperationMode mode) noexcept |
| Sets the operational mode of the receiver. | |
| void | setDechirpMode (DechirpMode mode) noexcept |
| Sets the receiver-side dechirp mode. | |
| void | setDechirpReference (DechirpReference reference) |
| Stores the unresolved dechirp reference parsed from scenario input. | |
| void | setFmcwIfChainRequest (FmcwIfChainRequest request) noexcept |
| Stores the receiver-local FMCW IF-chain request. | |
| void | initializeFmcwIfResampling (fers_signal::FmcwIfResamplerPlan plan) |
| Creates the online FMCW IF resampling sink and clears the output buffer. | |
| void | beginFmcwIfResamplingSegment (RealType segment_start_time) |
| Advances the continuous IF resampling timeline to the next active segment start. | |
| void | consumeFmcwIfBlock (std::span< const ComplexType > block, RealType block_start_time) |
| Feeds one completed high-rate dechirped block into the online IF sink. | |
| void | setFmcwIfOutputCallback (FmcwIfOutputCallback callback) |
| Routes emitted IF samples to a live consumer instead of the HDF5 accumulation buffer. | |
| void | endFmcwIfResamplingSegment () |
| Marks the current scheduled IF segment inactive. | |
| void | flushFmcwIfResampling () |
| Flushes remaining samples from the online IF sink into the output buffer. | |
| void | setResolvedDechirpSources (std::vector< core::ActiveStreamingSource > sources) |
| Replaces resolved receive-time LO source segments. | |
| void | clearResolvedDechirpSources () noexcept |
| Clears resolved dechirp source segments. | |
| std::vector< std::unique_ptr< serial::Response > > | drainInbox () noexcept |
| Moves all responses from the inbox into a RenderingJob. | |
| void | enqueueFinalizerJob (core::RenderingJob &&job) |
| Adds a completed RenderingJob to the finalizer queue. | |
| bool | waitAndDequeueFinalizerJob (core::RenderingJob &job) |
| Waits for and dequeues a RenderingJob from the finalizer queue. | |
| void | setWindowProperties (RealType length, RealType prf, RealType skip) noexcept |
| Sets the properties for radar windows. | |
| void | setFlag (RecvFlag flag) noexcept |
| Sets a receiver flag. | |
| void | clearFlag (RecvFlag flag) noexcept |
| Clears a receiver flag. | |
| void | setNoiseTemperature (RealType temp) |
| Sets the noise temperature of the receiver. | |
| const std::vector< std::unique_ptr< serial::Response > > & | getPulsedInterferenceLog () const |
| Retrieves the log of pulsed interferences for streaming modes. | |
| void | prunePulsedInterferenceEndingBefore (RealType cutoff_time) noexcept |
| Removes logged pulsed interference responses that ended before a receive time. | |
| void | setSchedule (std::vector< SchedulePeriod > schedule) |
| Sets the active schedule for the receiver. | |
| const std::vector< SchedulePeriod > & | getSchedule () const noexcept |
| Retrieves the list of active reception periods. | |
| std::optional< RealType > | getNextWindowTime (RealType time) const |
| Determines the next valid window start time at or after the given time. | |
| const Radar * | getAttached () const noexcept |
| Retrieves the attached radar object. | |
| const antenna::Antenna * | getAntenna () const noexcept |
| Gets the antenna associated with this radar. | |
| RealType | getGain (const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const |
| Calculates the radar gain based on input angles and wavelength. | |
| std::shared_ptr< timing::Timing > | getTiming () const |
| Retrieves the timing source for the radar. | |
| void | setTiming (const std::shared_ptr< timing::Timing > &tim) |
| Sets the timing source for the radar. | |
| void | setAntenna (const antenna::Antenna *ant) |
| Sets the antenna for the radar. | |
| void | setAttached (const Radar *obj) |
| Attaches another radar object to this radar. | |
| math::Vec3 | getPosition (const RealType time) const |
| Retrieves the position of the object. | |
| math::SVec3 | getRotation (const RealType time) const |
| Retrieves the rotation of the object. | |
| Platform * | getPlatform () const noexcept |
| Retrieves the associated platform of the object. | |
| const std::string & | getName () const noexcept |
| Retrieves the name of the object. | |
| void | setName (std::string name) noexcept |
| Sets the name of the object. | |
Protected Attributes | |
| std::shared_ptr< timing::Timing > | _timing |
| Timing source for the radar. | |
Manages radar signal reception and response processing.
Definition at line 46 of file receiver.h.
| using radar::Receiver::FmcwIfOutputCallback = std::function<void(std::span<const ComplexType>, std::uint64_t)> |
Definition at line 49 of file receiver.h.
|
strong |
Receiver-side FMCW dechirping mode.
| Enumerator | |
|---|---|
| None | Output raw pre-mix streaming IQ. |
| Physical | Preserve timing phase-noise decorrelation in the IF output. |
| Ideal | Ignore timing phase noise during the dechirp mix. |
Definition at line 62 of file receiver.h.
|
strong |
Source used to construct the receiver LO reference.
| Enumerator | |
|---|---|
| None | No reference configured. |
| Attached | Use the attached transmitter. |
| Transmitter | Use a named transmitter. |
| Custom | Use a named top-level waveform with the receiver schedule. |
Definition at line 70 of file receiver.h.
|
strong |
Enumeration for receiver configuration flags.
| Enumerator | |
|---|---|
| FLAG_NODIRECT | Disable direct-path reception. |
| FLAG_NOPROPLOSS | Disable propagation-loss scaling. |
Definition at line 55 of file receiver.h.
|
explicitnoexcept |
Constructs a Receiver object.
| platform | The platform associated with this receiver. |
| name | The name of the receiver. |
| seed | The seed for the receiver's internal random number generator. |
| mode | The operational mode (PULSED_MODE, CW_MODE, or FMCW_MODE). |
Definition at line 109 of file receiver.cpp.
|
overridedefault |
|
delete |
|
noexcept |
Adds a pulsed interference response to the receiver's streaming-mode log.
| response | A unique pointer to the response object. |
Definition at line 122 of file receiver.cpp.
References max.
|
noexcept |
Adds a response to the receiver's pulsed-mode inbox.
| response | A unique pointer to the response object. |
Definition at line 116 of file receiver.cpp.
References max.
Advances the continuous IF resampling timeline to the next active segment start.
Definition at line 233 of file receiver.cpp.
References max.
Referenced by consumeFmcwIfBlock().
Here is the caller graph for this function:Checks if a specific flag is set.
| flag | The flag to check. |
Definition at line 137 of file receiver.h.
References max.
Clears a receiver flag.
| flag | The flag to clear. |
Definition at line 350 of file receiver.h.
References max.
|
noexcept |
Clears resolved dechirp source segments.
Definition at line 305 of file receiver.h.
| void radar::Receiver::consumeFmcwIfBlock | ( | std::span< const ComplexType > | block, |
| RealType | block_start_time | ||
| ) |
Feeds one completed high-rate dechirped block into the online IF sink.
Definition at line 243 of file receiver.cpp.
References beginFmcwIfResamplingSegment(), and max.
Here is the call graph for this function:
|
noexcept |
Moves all responses from the inbox into a RenderingJob.
Definition at line 135 of file receiver.cpp.
References max.
| void radar::Receiver::endFmcwIfResamplingSegment | ( | ) |
Marks the current scheduled IF segment inactive.
Definition at line 306 of file receiver.cpp.
Referenced by flushFmcwIfResampling().
Here is the caller graph for this function:| void radar::Receiver::enqueueFinalizerJob | ( | core::RenderingJob && | job | ) |
Adds a completed RenderingJob to the finalizer queue.
| job | The RenderingJob to enqueue. |
Definition at line 143 of file receiver.cpp.
References max.
| void radar::Receiver::flushFmcwIfResampling | ( | ) |
Flushes remaining samples from the online IF sink into the output buffer.
Definition at line 315 of file receiver.cpp.
References endFmcwIfResamplingSegment(), params::endTime(), and max.
Here is the call graph for this function:
|
noexceptinherited |
Gets the antenna associated with this radar.
Definition at line 93 of file radar_obj.h.
Referenced by radar::to_json().
Here is the caller graph for this function:Retrieves the attached radar object.
Definition at line 79 of file radar_obj.h.
|
noexcept |
Gets the configured dechirp mode.
Definition at line 212 of file receiver.h.
|
noexcept |
Gets the configured dechirp reference.
Definition at line 218 of file receiver.h.
|
noexcept |
Gets resolved receive-time LO source segments.
Definition at line 251 of file receiver.h.
|
noexcept |
Gets the optional receiver-local FMCW IF-chain request.
Definition at line 221 of file receiver.h.
|
noexcept |
Gets the active or most recently used IF resampling plan, if any.
Definition at line 245 of file receiver.h.
|
inherited |
Calculates the radar gain based on input angles and wavelength.
| angle | The radar's pointing angle. |
| refangle | The reference angle for comparison. |
| wavelength | The wavelength of the radar signal. |
Definition at line 26 of file radar_obj.cpp.
References antenna::Antenna::getGain(), and max.
Here is the call graph for this function:
|
noexcept |
Retrieves the unique ID of the receiver.
Definition at line 144 of file receiver.h.
References radar::Radar::getId().
Here is the call graph for this function:
|
noexcept |
Gets the receiver-local FMCW IF filter bandwidth in Hz.
Definition at line 227 of file receiver.h.
References radar::Receiver::FmcwIfChainRequest::filter_bandwidth_hz.
|
noexcept |
Gets the receiver-local FMCW IF filter transition width in Hz.
Definition at line 233 of file receiver.h.
References radar::Receiver::FmcwIfChainRequest::filter_transition_width_hz.
|
noexcept |
Gets the receiver-local FMCW IF sample rate in Hz.
Definition at line 224 of file receiver.h.
References radar::Receiver::FmcwIfChainRequest::sample_rate_hz.
|
noexcept |
Gets the operational mode of the receiver.
Definition at line 209 of file receiver.h.
|
noexceptinherited |
Retrieves the name of the object.
Definition at line 79 of file object.h.
Referenced by setNoiseTemperature(), radar::to_json(), and radar::to_json().
Here is the caller graph for this function:Determines the next valid window start time at or after the given time.
| time | The proposed window start time. |
Definition at line 384 of file receiver.cpp.
References max.
|
noexcept |
Retrieves the noise temperature of the receiver.
Definition at line 151 of file receiver.h.
|
overridevirtualnoexcept |
Gets the noise temperature for a specific angle.
| angle | The angle in spherical coordinates (SVec3). |
Reimplemented from radar::Radar.
Definition at line 164 of file receiver.cpp.
References radar::Radar::getNoiseTemperature(), and max.
Here is the call graph for this function:
|
noexceptinherited |
|
inherited |
Retrieves the position of the object.
| time | The time at which to get the position of the object. |
Definition at line 50 of file object.h.
References radar::Platform::getPosition().
Here is the call graph for this function:| const std::vector< std::unique_ptr< serial::Response > > & radar::Receiver::getPulsedInterferenceLog | ( | ) | const |
Retrieves the log of pulsed interferences for streaming modes.
Definition at line 364 of file receiver.h.
|
noexcept |
Gets the receiver's internal random number generator engine.
Definition at line 202 of file receiver.h.
|
inherited |
Retrieves the rotation of the object.
| time | The time at which to get the rotation of the object. |
Definition at line 58 of file object.h.
References radar::Platform::getRotation().
Referenced by radar::FileTarget::getRcs().
Here is the call graph for this function:
Here is the caller graph for this function:
|
noexcept |
Retrieves the list of active reception periods.
Definition at line 382 of file receiver.h.
|
inherited |
Retrieves the timing source for the radar.
Definition at line 66 of file radar_obj.cpp.
References radar::Radar::_timing, and LOG.
Referenced by radar::to_json().
Here is the caller graph for this function:
|
noexcept |
Gets the number of radar windows.
Definition at line 364 of file receiver.cpp.
References params::endTime(), max, and params::startTime().
Here is the call graph for this function:
|
noexcept |
Retrieves the radar window length.
Definition at line 158 of file receiver.h.
|
noexcept |
Retrieves the pulse repetition frequency (PRF) of the radar window.
Definition at line 165 of file receiver.h.
|
noexcept |
Retrieves the window skip time.
Definition at line 172 of file receiver.h.
Retrieves the start time of a specific radar window.
| window | The index of the window. |
| std::logic_error | If the receiver is not associated with a timing source. |
Definition at line 371 of file receiver.cpp.
References radar::Radar::_timing, logging::FATAL, LOG, and max.
|
noexcept |
Returns true when this receiver is using the online FMCW IF resampling sink.
Definition at line 242 of file receiver.h.
|
noexcept |
Returns true when this receiver requests IF-rate FMCW output.
Definition at line 239 of file receiver.h.
References radar::Receiver::FmcwIfChainRequest::sample_rate_hz.
| void radar::Receiver::initializeFmcwIfResampling | ( | fers_signal::FmcwIfResamplerPlan | plan | ) |
Creates the online FMCW IF resampling sink and clears the output buffer.
Definition at line 223 of file receiver.cpp.
|
noexcept |
Checks if the receiver is currently active (listening).
Definition at line 260 of file receiver.h.
|
noexcept |
Returns true when the receiver emits dechirped IF data.
Definition at line 215 of file receiver.h.
References None.
Removes logged pulsed interference responses that ended before a receive time.
Definition at line 128 of file receiver.cpp.
References max.
Sets the active state of the receiver.
| active | The new active state. |
Definition at line 266 of file receiver.h.
References max.
|
inherited |
Sets the antenna for the radar.
| ant | Pointer to the antenna to set. |
Definition at line 46 of file radar_obj.cpp.
Attaches another radar object to this radar.
| obj | Pointer to the radar object to attach. |
| std::runtime_error | If another object is already attached. |
Definition at line 56 of file radar_obj.cpp.
|
noexcept |
Sets the receiver-side dechirp mode.
Definition at line 189 of file receiver.cpp.
| void radar::Receiver::setDechirpReference | ( | DechirpReference | reference | ) |
Stores the unresolved dechirp reference parsed from scenario input.
Definition at line 206 of file receiver.cpp.
References max.
Sets a receiver flag.
| flag | The flag to set. |
Definition at line 343 of file receiver.h.
References max.
|
noexcept |
Stores the receiver-local FMCW IF-chain request.
Definition at line 212 of file receiver.cpp.
References max.
| void radar::Receiver::setFmcwIfOutputCallback | ( | FmcwIfOutputCallback | callback | ) |
Routes emitted IF samples to a live consumer instead of the HDF5 accumulation buffer.
Definition at line 266 of file receiver.cpp.
References max.
|
noexcept |
Sets the operational mode of the receiver.
| mode | The operational mode (PULSED_MODE, CW_MODE, or FMCW_MODE). |
Definition at line 179 of file receiver.cpp.
References radar::FMCW_MODE.
|
noexceptinherited |
Sets the noise temperature of the receiver.
| temp | The new noise temperature. |
| std::runtime_error | If the noise temperature is negative. |
Definition at line 169 of file receiver.cpp.
References EPSILON, logging::FATAL, radar::Object::getName(), LOG, and max.
Here is the call graph for this function:| void radar::Receiver::setResolvedDechirpSources | ( | std::vector< core::ActiveStreamingSource > | sources | ) |
Replaces resolved receive-time LO source segments.
Definition at line 351 of file receiver.cpp.
References max.
| void radar::Receiver::setSchedule | ( | std::vector< SchedulePeriod > | schedule | ) |
Sets the active schedule for the receiver.
| schedule | A vector of active periods. |
Definition at line 382 of file receiver.cpp.
References max.
|
inherited |
Sets the timing source for the radar.
| tim | Shared pointer to the timing source to set. |
Definition at line 36 of file radar_obj.cpp.
References radar::Radar::_timing, LOG, and max.
Sets the properties for radar windows.
| length | The length of the radar window. |
| prf | The pulse repetition frequency. |
| skip | The skip time between windows. |
Definition at line 356 of file receiver.cpp.
References max, params::oversampleRatio(), and params::rate().
Here is the call graph for this function:| bool radar::Receiver::waitAndDequeueFinalizerJob | ( | core::RenderingJob & | job | ) |
Waits for and dequeues a RenderingJob from the finalizer queue.
This is a blocking call, intended for use by the dedicated finalizer thread.
| job | A reference to a RenderingJob to be filled. |
false if a shutdown signal is received, true otherwise. Definition at line 152 of file receiver.cpp.
References max.
|
protectedinherited |
Timing source for the radar.
Definition at line 144 of file radar_obj.h.
Referenced by radar::Radar::getTiming(), getWindowStart(), and radar::Radar::setTiming().