FERS 0.1.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
response.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// Copyright (c) 2006-2008 Marc Brooker and Michael Inggs
4// Copyright (c) 2008-present FERS Contributors (see AUTHORS.md).
5//
6// See the GNU GPLv2 LICENSE file in the FERS project root for more information.
7
8/**
9 * @file response.h
10 * @brief Classes for managing radar signal responses.
11 */
12
13#pragma once
14
15#include <cstddef>
16#include <string>
17#include <vector>
18
19#include "core/config.h"
20#include "core/sim_id.h"
22
23class XmlElement;
24
25namespace fers_signal
26{
27 class RadarSignal;
28}
29
30namespace radar
31{
32 class Transmitter;
33}
34
35namespace serial
36{
37 /**
38 * @class Response
39 * @brief Manages radar signal responses from a transmitter.
40 */
42 {
43 public:
44 /**
45 * @brief Constructor for the `Response` class.
46 *
47 * @param wave Pointer to the radar signal object.
48 * @param transmitter Pointer to the transmitter object.
49 */
51 _transmitter(transmitter), _wave(wave)
52 {
53 }
54
55 ~Response() = default;
56 Response(const Response&) = delete;
57 Response& operator=(const Response&) = delete;
58 Response(Response&&) = delete;
60
61 /**
62 * @brief Retrieves the start time of the response.
63 *
64 * @return Start time as a `RealType`. Returns 0.0 if no points are present.
65 */
66 [[nodiscard]] RealType startTime() const noexcept { return _points.empty() ? 0.0 : _points.front().time; }
67
68 /**
69 * @brief Retrieves the end time of the response.
70 *
71 * @return End time as a `RealType`. Returns 0.0 if no points are present.
72 */
73 [[nodiscard]] RealType endTime() const noexcept { return _points.empty() ? 0.0 : _points.back().time; }
74
75 /**
76 * @brief Adds an interpolation point to the response.
77 *
78 * @param point The interpolation point to be added.
79 * @throws std::logic_error If the new point has a time earlier than the last point.
80 */
82
83 /**
84 * @brief Renders the response in binary format.
85 *
86 * @param rate Output parameter for the signal rate.
87 * @param size Output parameter for the size of the binary data.
88 * @param fracWinDelay Delay factor applied during windowing.
89 * @return A vector of `ComplexType` representing the binary data.
90 */
91 std::vector<ComplexType> renderBinary(RealType& rate, unsigned& size, RealType fracWinDelay) const;
92
93 /// Renders a bounded absolute-time response slice on the requested output grid.
95 std::size_t sampleCount, RealType fracWinDelay) const;
96
97 /// Returns the waveform native sample rate.
99
100 /// Returns the waveform native sample count.
101 [[nodiscard]] unsigned sampleCount() const noexcept;
102
103 /**
104 * @brief Retrieves the length of the response.
105 *
106 * @return The length of the response as a `RealType`.
107 */
109
110 /**
111 * @brief Retrieves the ID of the associated transmitter.
112 *
113 * @return The transmitter SimId.
114 */
116
117 private:
118 const radar::Transmitter* _transmitter; ///< Pointer to the transmitter object.
119 const fers_signal::RadarSignal* _wave; ///< Pointer to the radar signal object.
120 std::vector<interp::InterpPoint> _points; ///< Vector of interpolation points.
121 };
122}
const Transmitter & transmitter
Class representing a node in an XML document.
Class representing a radar signal with associated properties.
Represents a radar transmitter system.
Definition transmitter.h:34
Manages radar signal responses from a transmitter.
Definition response.h:42
void addInterpPoint(const interp::InterpPoint &point)
Adds an interpolation point to the response.
Definition response.cpp:27
RealType sampleRate() const noexcept
Returns the waveform native sample rate.
Definition response.cpp:41
Response & operator=(const Response &)=delete
RealType startTime() const noexcept
Retrieves the start time of the response.
Definition response.h:66
Response & operator=(Response &&)=delete
SimId getTransmitterId() const noexcept
Retrieves the ID of the associated transmitter.
Definition response.cpp:25
unsigned sampleCount() const noexcept
Returns the waveform native sample count.
Definition response.cpp:43
~Response()=default
RealType getLength() const noexcept
Retrieves the length of the response.
Definition response.h:108
Response(Response &&)=delete
std::vector< ComplexType > renderBinary(RealType &rate, unsigned &size, RealType fracWinDelay) const
Renders the response in binary format.
Definition response.cpp:29
RealType endTime() const noexcept
Retrieves the end time of the response.
Definition response.h:73
std::vector< ComplexType > renderSlice(RealType outputRate, RealType outputStartTime, std::size_t sampleCount, RealType fracWinDelay) const
Renders a bounded absolute-time response slice on the requested output grid.
Definition response.cpp:35
Response(const Response &)=delete
Response(const fers_signal::RadarSignal *wave, const radar::Transmitter *transmitter) noexcept
Constructor for the Response class.
Definition response.h:50
Global configuration file for the project.
double RealType
Type for real numbers.
Definition config.h:27
Defines a structure to store interpolation point data for signal processing.
uint64_t SimId
64-bit Unique Simulation ID.
Definition sim_id.h:18
math::Vec3 max
Stores data for an interpolation point.