FERS 0.1.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
radar_signal.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 radar_signal.h
10 * @brief Classes for handling radar waveforms and signals.
11 */
12
13#pragma once
14
15#include <cstddef>
16#include <cstdint>
17#include <memory>
18#include <optional>
19#include <span>
20#include <string>
21#include <string_view>
22#include <tuple>
23#include <vector>
24
25#include "core/config.h"
26#include "core/sim_id.h"
27
28namespace interp
29{
30 struct InterpPoint;
31}
32
33namespace fers_signal
34{
35 /// Sweep direction for a linear FMCW chirp.
36 enum class FmcwChirpDirection : std::uint8_t
37 {
38 Up, ///< Instantaneous baseband frequency increases over the chirp.
39 Down ///< Instantaneous baseband frequency decreases over the chirp.
40 };
41
42 /// Simulation mode assigned to samples loaded from a waveform file.
43 enum class FileWaveformKind : std::uint8_t
44 {
45 Pulsed,
46 Cw,
47 Fmcw
48 };
49
50 /// Converts a chirp direction to the schema token.
52
53 /// Parses a schema chirp direction token.
55
56 /**
57 * @class Signal
58 * @brief Class for handling radar waveform signal data.
59 */
60 class Signal
61 {
62 public:
63 virtual ~Signal() = default;
64
65 Signal() = default;
66
67 Signal(const Signal&) = delete;
68
69 Signal& operator=(const Signal&) = delete;
70
71 Signal(Signal&&) = default;
72
73 Signal& operator=(Signal&&) = default;
74
75 /**
76 * @brief Clears the internal signal data.
77 */
78 void clear() noexcept;
79
80 /**
81 * @brief Loads complex radar waveform data.
82 *
83 * @param inData The input span of complex signal data.
84 * @param samples The number of samples in the input data.
85 * @param sampleRate The sample rate of the input data.
86 */
87 void load(std::span<const ComplexType> inData, unsigned samples, RealType sampleRate);
88
89 /**
90 * @brief Gets the sample rate of the signal.
91 *
92 * @return The sample rate of the signal.
93 */
94 [[nodiscard]] RealType getRate() const noexcept { return _rate; }
95
96 /// Gets the number of native samples held by this signal.
97 [[nodiscard]] unsigned getSampleCount() const noexcept { return _size; }
98
99 /**
100 * @brief Renders the signal data based on interpolation points.
101 *
102 * @param points A vector of interpolation points used to render the signal.
103 * @param size Reference to store the size of the rendered data.
104 * @param fracWinDelay Fractional window delay to apply during rendering.
105 * @return A vector of rendered complex signal data.
106 */
107 virtual std::vector<ComplexType> render(const std::vector<interp::InterpPoint>& points, unsigned& size,
108 double fracWinDelay) const;
109
110 /// Renders a bounded absolute-time slice on the requested output grid.
111 [[nodiscard]] virtual std::vector<ComplexType> renderSlice(const std::vector<interp::InterpPoint>& points,
113 std::size_t sampleCount,
114 RealType fracWinDelay) const;
115
116 /// Returns true when this signal belongs to the FMCW waveform family.
117 [[nodiscard]] virtual bool isFmcwFamily() const noexcept { return false; }
118
119 /// Samples the finite stored complex envelope using the render interpolation filter.
120 /// Times outside [0, duration) return zero; file-backed signals never wrap implicitly.
122
123 private:
124 std::vector<ComplexType> _data; ///< The complex signal data.
125 unsigned _size{0}; ///< The size of the signal data.
126 RealType _rate{0}; ///< The sample rate of the signal.
127
128 /**
129 * @brief Calculates weights and delays for rendering.
130 *
131 * @param iter Iterator pointing to the current interpolation point.
132 * @param next Iterator pointing to the next interpolation point.
133 * @param sampleTime Current sample time.
134 * @param idelay Integer delay value.
135 * @param fracWinDelay Fractional window delay to apply.
136 * @return A tuple containing amplitude, phase, fractional delay, and sample unwrap index.
137 */
138 [[nodiscard]] std::tuple<double, double, double, int>
139 calculateWeightsAndDelays(std::vector<interp::InterpPoint>::const_iterator iter,
140 std::vector<interp::InterpPoint>::const_iterator next, double sampleTime,
141 double idelay, double fracWinDelay) const noexcept;
142
143 /**
144 * @brief Performs convolution with a filter.
145 *
146 * @param i Index of the current sample.
147 * @param filt Pointer to the filter coefficients.
148 * @param filtLength Length of the filter.
149 * @param amplitude Amplitude scaling factor.
150 * @param iSampleUnwrap Unwrapped sample index for the convolution.
151 * @return The result of the convolution for the given sample.
152 */
153 ComplexType performConvolution(int i, const double* filt, int filtLength, double amplitude,
154 int iSampleUnwrap) const noexcept;
155 };
156
157 /**
158 * @class RadarSignal
159 * @brief Class representing a radar signal with associated properties.
160 */
162 {
163 public:
164 /**
165 * @brief Constructs a RadarSignal object.
166 *
167 * @param name The name of the radar signal.
168 * @param power The power of the radar signal.
169 * @param carrierfreq The carrier frequency of the radar signal.
170 * @param length The length of the radar signal.
171 * @param signal A unique pointer to the `Signal` object containing the waveform data.
172 * @throws std::runtime_error if the signal is null.
173 */
174 RadarSignal(std::string name, RealType power, RealType carrierfreq, RealType length,
175 std::unique_ptr<Signal> signal, const SimId id = 0);
176
177 ~RadarSignal() = default;
178
179 RadarSignal(const RadarSignal&) noexcept = delete;
180
181 RadarSignal& operator=(const RadarSignal&) noexcept = delete;
182
184
186
187 /**
188 * @brief Sets the filename associated with this signal.
189 * @param filename The source filename.
190 */
191 void setFilename(const std::string& filename) noexcept { _filename = filename; }
192
193 /**
194 * @brief Gets the filename associated with this signal.
195 * @return The source filename, if one was set.
196 */
197 [[nodiscard]] const std::optional<std::string>& getFilename() const noexcept { return _filename; }
198
199 /**
200 * @brief Gets the power of the radar signal.
201 *
202 * @return The power of the radar signal.
203 */
204 [[nodiscard]] RealType getPower() const noexcept { return _power; }
205
206 /**
207 * @brief Gets the carrier frequency of the radar signal.
208 *
209 * @return The carrier frequency of the radar signal.
210 */
211 [[nodiscard]] RealType getCarrier() const noexcept { return _carrierfreq; }
212
213 /**
214 * @brief Gets the name of the radar signal.
215 *
216 * @return The name of the radar signal.
217 */
218 [[nodiscard]] const std::string& getName() const noexcept { return _name; }
219
220 /**
221 * @brief Gets the unique ID of the radar signal.
222 *
223 * @return The radar signal SimId.
224 */
225 [[nodiscard]] SimId getId() const noexcept { return _id; }
226
227 /**
228 * @brief Gets the sample rate of the radar signal.
229 *
230 * @return The sample rate of the radar signal.
231 */
232 [[nodiscard]] RealType getRate() const noexcept { return _signal->getRate(); }
233
234 /// Gets the number of native samples in the underlying signal.
235 [[nodiscard]] unsigned getSampleCount() const noexcept { return _signal->getSampleCount(); }
236
237 /**
238 * @brief Gets the length of the radar signal.
239 *
240 * @return The length of the radar signal.
241 */
242 [[nodiscard]] RealType getLength() const noexcept { return _length; }
243
244 /**
245 * @brief Gets the underlying signal object.
246 * @return A const pointer to the Signal object.
247 */
248 [[nodiscard]] const Signal* getSignal() const noexcept { return _signal.get(); }
249
250 /// Returns true when this signal is a continuous-wave signal.
251 [[nodiscard]] bool isCw() const noexcept;
252
253 /// Returns true when this signal is an FMCW linear chirp signal.
255
256 /// Returns true when this signal is an FMCW triangular modulation signal.
258
259 /// Returns true when this signal belongs to the FMCW waveform family.
261
262 /// Returns true when this signal is a stepped-frequency CW waveform.
264
265 /// Gets the FMCW chirp implementation, if this signal owns one.
267
268 /// Gets the FMCW triangle implementation, if this signal owns one.
270
271 /// Gets the stepped-frequency implementation, if this signal owns one.
273
274 /// Gets the file-backed signal implementation, if this signal owns one.
276
277 /**
278 * @brief Renders the radar signal.
279 *
280 * @param points A vector of interpolation points.
281 * @param size Reference to store the size of the rendered data.
282 * @param fracWinDelay Fractional window delay to apply during rendering.
283 * @return A vector of rendered complex radar signal data.
284 */
285 std::vector<ComplexType> render(const std::vector<interp::InterpPoint>& points, unsigned& size,
287
288 /// Renders a bounded absolute-time slice on the requested output grid.
289 [[nodiscard]] std::vector<ComplexType> renderSlice(const std::vector<interp::InterpPoint>& points,
291 std::size_t sampleCount, RealType fracWinDelay) const;
292
293 private:
294 std::string _name; ///< The name of the radar signal.
295 SimId _id; ///< Unique ID for this radar signal.
296 RealType _power; ///< The power of the radar signal.
297 RealType _carrierfreq; ///< The carrier frequency of the radar signal.
298 RealType _length; ///< The length of the radar signal.
299 std::unique_ptr<Signal> _signal; ///< The `Signal` object containing the radar signal data.
300 std::optional<std::string> _filename; ///< The original filename for file-based signals.
301 };
302
303 /// File-backed sampled waveform with explicit radar-mode identity.
305 {
306 public:
307 explicit FileSignal(FileWaveformKind kind) : _kind(kind) {}
308
309 ~FileSignal() override = default;
310
311 FileSignal(const FileSignal&) = delete;
312 FileSignal& operator=(const FileSignal&) = delete;
315
317 [[nodiscard]] bool isFmcwFamily() const noexcept override { return _kind == FileWaveformKind::Fmcw; }
318
319 private:
320 FileWaveformKind _kind;
321 };
322
323 /// Continuous-wave signal implementation.
324 class CwSignal final : public Signal
325 {
326 public:
327 CwSignal() = default;
328
329 ~CwSignal() override = default;
330
331 CwSignal(const CwSignal&) noexcept = delete;
332
333 CwSignal& operator=(const CwSignal&) noexcept = delete;
334
336
338
339 /**
340 * @brief Renders the signal data. For CW signals, this is a no-op.
341 * @return An empty vector of complex signal data.
342 */
343 std::vector<ComplexType> render(const std::vector<interp::InterpPoint>& points, unsigned& size,
345 };
346
347 /// Stepped-frequency continuous-wave signal implementation.
349 {
350 public:
351 /// Active SFCW dwell selected for one local waveform time.
353 {
354 std::size_t step_index = 0; ///< Zero-based step index inside a sweep.
355 std::size_t sweep_index = 0; ///< Zero-based sweep index.
356 RealType step_start_time = 0.0; ///< Local step period start time in seconds.
357 RealType dwell_end_time = 0.0; ///< Local active dwell end time in seconds.
358 RealType step_end_time = 0.0; ///< Local step period end time in seconds.
359 RealType rf_frequency = 0.0; ///< RF frequency for the active step in hertz.
360 };
361
362 /// Constructs a uniform stepped-frequency CW signal.
363 SteppedFrequencySignal(RealType start_frequency_offset, RealType step_size, std::size_t step_count,
364 RealType dwell_time, RealType step_period,
365 std::optional<std::size_t> sweep_count = std::nullopt);
366
367 ~SteppedFrequencySignal() override = default;
368
370
372
374
376
377 /// Gets the first-step offset from carrier in hertz.
378 [[nodiscard]] RealType getStartFrequencyOffset() const noexcept { return _start_frequency_offset; }
379
380 /// Gets the uniform frequency step in hertz.
381 [[nodiscard]] RealType getStepSize() const noexcept { return _step_size; }
382
383 /// Gets the number of steps per sweep.
384 [[nodiscard]] std::size_t getStepCount() const noexcept { return _step_count; }
385
386 /// Gets active dwell time per step in seconds.
387 [[nodiscard]] RealType getDwellTime() const noexcept { return _dwell_time; }
388
389 /// Gets step repetition period in seconds.
390 [[nodiscard]] RealType getStepPeriod() const noexcept { return _step_period; }
391
392 /// Gets optional finite sweep count.
393 [[nodiscard]] const std::optional<std::size_t>& getSweepCount() const noexcept { return _sweep_count; }
394
395 /// Gets full sweep period in seconds.
397 {
398 return static_cast<RealType>(_step_count) * _step_period;
399 }
400
401 /// Gets first-step RF frequency in hertz.
402 [[nodiscard]] RealType firstFrequency(RealType carrier_frequency) const noexcept;
403
404 /// Gets final-step RF frequency in hertz.
405 [[nodiscard]] RealType lastFrequency(RealType carrier_frequency) const noexcept;
406
407 /// Gets first-to-last absolute span in hertz.
408 [[nodiscard]] RealType frequencySpan() const noexcept;
409
410 /// Gets DFT-convention effective bandwidth in hertz.
411 [[nodiscard]] RealType effectiveBandwidth() const noexcept;
412
413 /// Gets finite waveform duration, if sweep_count is configured.
414 [[nodiscard]] std::optional<RealType> totalDuration() const noexcept;
415
416 /// Returns the active step for a time since the segment start.
417 [[nodiscard]] std::optional<StepState> activeStepAt(RealType time_since_segment_start,
418 RealType carrier_frequency) const noexcept;
419
420 /// Renders the signal data. For SFCW signals, this is a no-op.
421 std::vector<ComplexType> render(const std::vector<interp::InterpPoint>& points, unsigned& size,
423
424 private:
425 RealType _start_frequency_offset{}; ///< First-step frequency offset relative to carrier in hertz.
426 RealType _step_size{}; ///< Uniform frequency step in hertz.
427 std::size_t _step_count{}; ///< Steps per sweep.
428 RealType _dwell_time{}; ///< Active dwell time per step in seconds.
429 RealType _step_period{}; ///< Step repetition period in seconds.
430 std::optional<std::size_t> _sweep_count; ///< Optional finite sweep count.
431 };
432
433 /// FMCW linear chirp signal implementation.
435 {
436 public:
437 /// Constructs an FMCW chirp signal with timing and sweep parameters.
438 FmcwChirpSignal(RealType chirp_bandwidth, RealType chirp_duration, RealType chirp_period,
439 RealType start_frequency_offset = 0.0, std::optional<std::size_t> chirp_count = std::nullopt,
440 FmcwChirpDirection direction = FmcwChirpDirection::Up);
441
442 ~FmcwChirpSignal() override = default;
443
444 FmcwChirpSignal(const FmcwChirpSignal&) noexcept = delete;
445
446 FmcwChirpSignal& operator=(const FmcwChirpSignal&) noexcept = delete;
447
449
451
452 /// Gets the chirp bandwidth in hertz.
453 [[nodiscard]] RealType getChirpBandwidth() const noexcept { return _chirp_bandwidth; }
454
455 /// Gets the chirp duration in seconds.
456 [[nodiscard]] RealType getChirpDuration() const noexcept { return _chirp_duration; }
457
458 /// Gets the chirp period in seconds.
459 [[nodiscard]] RealType getChirpPeriod() const noexcept { return _chirp_period; }
460
461 /// Gets the start frequency offset relative to carrier in hertz.
462 [[nodiscard]] RealType getStartFrequencyOffset() const noexcept { return _start_frequency_offset; }
463
464 /// Gets the optional finite chirp count.
465 [[nodiscard]] const std::optional<std::size_t>& getChirpCount() const noexcept { return _chirp_count; }
466
467 /// Gets the chirp rate in hertz per second.
468 [[nodiscard]] RealType getChirpRate() const noexcept { return _chirp_rate; }
469
470 /// Gets the signed chirp rate in hertz per second.
472 {
473 return isDownChirp() ? -_chirp_rate : _chirp_rate;
474 }
475
476 /// Gets the FMCW sweep direction.
478
479 /// Returns true when this chirp sweeps downward.
480 [[nodiscard]] bool isDownChirp() const noexcept { return _direction == FmcwChirpDirection::Down; }
481
482 /// Returns false for linear chirps; triangles override this shape predicate.
483 [[nodiscard]] bool isTriangle() const noexcept { return false; }
484
485 /// Returns the active chirp index for a time since the segment start.
486 [[nodiscard]] std::optional<std::size_t> activeChirpIndexAt(RealType time_since_segment_start) const noexcept;
487
488 /// Returns true when the signal is inside an active chirp at the specified time.
490 {
491 return activeChirpIndexAt(time_since_segment_start).has_value();
492 }
493
494 /// Computes baseband phase for a time inside a chirp.
495 [[nodiscard]] RealType basebandPhaseForChirpTime(RealType chirp_time) const noexcept;
496
497 /// Computes instantaneous baseband phase at a time since segment start.
498 [[nodiscard]] std::optional<RealType>
499 instantaneousBasebandPhase(RealType time_since_segment_start) const noexcept;
500
501 /// Renders an FMCW waveform from interpolation points.
502 std::vector<ComplexType> render(const std::vector<interp::InterpPoint>& points, unsigned& size,
503 RealType fracWinDelay) const override;
504
505 [[nodiscard]] bool isFmcwFamily() const noexcept override { return true; }
506
507 private:
508 RealType _chirp_bandwidth{}; ///< Chirp bandwidth in hertz.
509 RealType _chirp_duration{}; ///< Active chirp duration in seconds.
510 RealType _chirp_period{}; ///< Chirp repetition period in seconds.
511 RealType _start_frequency_offset{}; ///< Start frequency offset relative to carrier in hertz.
512 std::optional<std::size_t> _chirp_count; ///< Optional finite chirp count.
513 RealType _chirp_rate{}; ///< Frequency sweep rate in hertz per second.
514 FmcwChirpDirection _direction{FmcwChirpDirection::Up}; ///< Frequency sweep direction.
515 };
516
517 /// FMCW symmetric triangular modulation signal implementation.
519 {
520 public:
521 /// Constructs an FMCW triangular modulation signal.
522 FmcwTriangleSignal(RealType chirp_bandwidth, RealType chirp_duration, RealType start_frequency_offset = 0.0,
523 std::optional<std::size_t> triangle_count = std::nullopt);
524
525 ~FmcwTriangleSignal() override = default;
526
527 FmcwTriangleSignal(const FmcwTriangleSignal&) noexcept = delete;
528
530
532
534
535 /// Gets the chirp bandwidth in hertz.
536 [[nodiscard]] RealType getChirpBandwidth() const noexcept { return _chirp_bandwidth; }
537
538 /// Gets the per-leg chirp duration in seconds.
539 [[nodiscard]] RealType getChirpDuration() const noexcept { return _chirp_duration; }
540
541 /// Gets the start frequency offset relative to carrier in hertz.
542 [[nodiscard]] RealType getStartFrequencyOffset() const noexcept { return _start_frequency_offset; }
543
544 /// Gets the optional finite triangle count.
545 [[nodiscard]] const std::optional<std::size_t>& getTriangleCount() const noexcept { return _triangle_count; }
546
547 /// Gets the chirp rate magnitude in hertz per second.
548 [[nodiscard]] RealType getChirpRate() const noexcept { return _chirp_rate; }
549
550 /// Gets the full up/down triangle period in seconds.
551 [[nodiscard]] RealType getTrianglePeriod() const noexcept { return _triangle_period; }
552
553 /// Gets the full, unreduced phase accumulated by one leg.
554 [[nodiscard]] RealType getDeltaPhiUp() const noexcept { return _delta_phi_up; }
555
556 /// Returns true for triangular FMCW waveforms.
557 [[nodiscard]] bool isTriangle() const noexcept { return true; }
558
559 /// Computes baseband phase at a time since the triangle train start.
560 [[nodiscard]] RealType basebandPhaseForTriangleTime(RealType triangle_time) const noexcept;
561
562 /// Computes instantaneous baseband phase at a time since segment start.
563 [[nodiscard]] std::optional<RealType>
564 instantaneousBasebandPhase(RealType time_since_segment_start) const noexcept;
565
566 /// Renders an FMCW waveform from interpolation points.
567 std::vector<ComplexType> render(const std::vector<interp::InterpPoint>& points, unsigned& size,
568 RealType fracWinDelay) const override;
569
570 [[nodiscard]] bool isFmcwFamily() const noexcept override { return true; }
571
572 private:
573 RealType _chirp_bandwidth{}; ///< Chirp bandwidth in hertz.
574 RealType _chirp_duration{}; ///< Per-leg chirp duration in seconds.
575 RealType _start_frequency_offset{}; ///< Start frequency offset relative to carrier in hertz.
576 std::optional<std::size_t> _triangle_count; ///< Optional finite triangle count.
577 RealType _chirp_rate{}; ///< Frequency sweep rate magnitude in hertz per second.
578 RealType _triangle_period{}; ///< Full triangle period in seconds.
579 RealType _delta_phi_up{}; ///< Full, unreduced phase accumulated by one leg.
580 };
581}
Continuous-wave signal implementation.
~CwSignal() override=default
CwSignal(CwSignal &&) noexcept=delete
CwSignal(const CwSignal &) noexcept=delete
CwSignal & operator=(const CwSignal &) noexcept=delete
File-backed sampled waveform with explicit radar-mode identity.
FileWaveformKind getKind() const noexcept
bool isFmcwFamily() const noexcept override
Returns true when this signal belongs to the FMCW waveform family.
FileSignal(const FileSignal &)=delete
FileSignal(FileWaveformKind kind)
FileSignal(FileSignal &&)=delete
~FileSignal() override=default
FileSignal & operator=(FileSignal &&)=delete
FileSignal & operator=(const FileSignal &)=delete
FMCW linear chirp signal implementation.
bool isFmcwFamily() const noexcept override
Returns true when this signal belongs to the FMCW waveform family.
RealType getChirpDuration() const noexcept
Gets the chirp duration in seconds.
~FmcwChirpSignal() override=default
FmcwChirpSignal(FmcwChirpSignal &&) noexcept=delete
RealType getChirpPeriod() const noexcept
Gets the chirp period in seconds.
bool isTriangle() const noexcept
Returns false for linear chirps; triangles override this shape predicate.
FmcwChirpSignal & operator=(const FmcwChirpSignal &) noexcept=delete
FmcwChirpSignal(const FmcwChirpSignal &) noexcept=delete
bool isDownChirp() const noexcept
Returns true when this chirp sweeps downward.
FmcwChirpDirection getDirection() const noexcept
Gets the FMCW sweep direction.
const std::optional< std::size_t > & getChirpCount() const noexcept
Gets the optional finite chirp count.
RealType getSignedChirpRate() const noexcept
Gets the signed chirp rate in hertz per second.
RealType getChirpRate() const noexcept
Gets the chirp rate in hertz per second.
bool isActiveAt(RealType time_since_segment_start) const noexcept
Returns true when the signal is inside an active chirp at the specified time.
RealType getStartFrequencyOffset() const noexcept
Gets the start frequency offset relative to carrier in hertz.
FMCW symmetric triangular modulation signal implementation.
RealType getStartFrequencyOffset() const noexcept
Gets the start frequency offset relative to carrier in hertz.
RealType getChirpRate() const noexcept
Gets the chirp rate magnitude in hertz per second.
~FmcwTriangleSignal() override=default
const std::optional< std::size_t > & getTriangleCount() const noexcept
Gets the optional finite triangle count.
RealType getChirpDuration() const noexcept
Gets the per-leg chirp duration in seconds.
bool isFmcwFamily() const noexcept override
Returns true when this signal belongs to the FMCW waveform family.
RealType getTrianglePeriod() const noexcept
Gets the full up/down triangle period in seconds.
FmcwTriangleSignal(FmcwTriangleSignal &&) noexcept=delete
FmcwTriangleSignal(const FmcwTriangleSignal &) noexcept=delete
RealType getDeltaPhiUp() const noexcept
Gets the full, unreduced phase accumulated by one leg.
bool isTriangle() const noexcept
Returns true for triangular FMCW waveforms.
FmcwTriangleSignal & operator=(const FmcwTriangleSignal &) noexcept=delete
Class representing a radar signal with associated properties.
SimId getId() const noexcept
Gets the unique ID of the radar signal.
const class SteppedFrequencySignal * getSteppedFrequencySignal() const noexcept
Gets the stepped-frequency implementation, if this signal owns one.
void setFilename(const std::string &filename) noexcept
Sets the filename associated with this signal.
RadarSignal(const RadarSignal &) noexcept=delete
RadarSignal & operator=(const RadarSignal &) noexcept=delete
const std::optional< std::string > & getFilename() const noexcept
Gets the filename associated with this signal.
std::vector< ComplexType > renderSlice(const std::vector< interp::InterpPoint > &points, RealType outputStartTime, RealType outputSampleRate, std::size_t sampleCount, RealType fracWinDelay) const
Renders a bounded absolute-time slice on the requested output grid.
RealType getRate() const noexcept
Gets the sample rate of the radar signal.
const class FileSignal * getFileSignal() const noexcept
Gets the file-backed signal implementation, if this signal owns one.
const class FmcwTriangleSignal * getFmcwTriangleSignal() const noexcept
Gets the FMCW triangle implementation, if this signal owns one.
std::vector< ComplexType > render(const std::vector< interp::InterpPoint > &points, unsigned &size, RealType fracWinDelay) const
Renders the radar signal.
RadarSignal(RadarSignal &&) noexcept=delete
const std::string & getName() const noexcept
Gets the name of the radar signal.
bool isFmcwTriangle() const noexcept
Returns true when this signal is an FMCW triangular modulation signal.
RealType getCarrier() const noexcept
Gets the carrier frequency of the radar signal.
bool isFmcwFamily() const noexcept
Returns true when this signal belongs to the FMCW waveform family.
RealType getLength() const noexcept
Gets the length of the radar signal.
const Signal * getSignal() const noexcept
Gets the underlying signal object.
bool isSteppedFrequency() const noexcept
Returns true when this signal is a stepped-frequency CW waveform.
bool isFmcwChirp() const noexcept
Returns true when this signal is an FMCW linear chirp signal.
bool isCw() const noexcept
Returns true when this signal is a continuous-wave signal.
const class FmcwChirpSignal * getFmcwChirpSignal() const noexcept
Gets the FMCW chirp implementation, if this signal owns one.
unsigned getSampleCount() const noexcept
Gets the number of native samples in the underlying signal.
RealType getPower() const noexcept
Gets the power of the radar signal.
Class for handling radar waveform signal data.
RealType getRate() const noexcept
Gets the sample rate of the signal.
virtual ~Signal()=default
Signal(Signal &&)=default
virtual std::vector< ComplexType > renderSlice(const std::vector< interp::InterpPoint > &points, RealType outputStartTime, RealType outputSampleRate, std::size_t sampleCount, RealType fracWinDelay) const
Renders a bounded absolute-time slice on the requested output grid.
void clear() noexcept
Clears the internal signal data.
Signal & operator=(const Signal &)=delete
Signal(const Signal &)=delete
unsigned getSampleCount() const noexcept
Gets the number of native samples held by this signal.
void load(std::span< const ComplexType > inData, unsigned samples, RealType sampleRate)
Loads complex radar waveform data.
ComplexType sampleAt(RealType time_since_start) const noexcept
Samples the finite stored complex envelope using the render interpolation filter.
virtual bool isFmcwFamily() const noexcept
Returns true when this signal belongs to the FMCW waveform family.
virtual std::vector< ComplexType > render(const std::vector< interp::InterpPoint > &points, unsigned &size, double fracWinDelay) const
Renders the signal data based on interpolation points.
Signal & operator=(Signal &&)=default
Stepped-frequency continuous-wave signal implementation.
RealType getSweepPeriod() const noexcept
Gets full sweep period in seconds.
const std::optional< std::size_t > & getSweepCount() const noexcept
Gets optional finite sweep count.
RealType getStepSize() const noexcept
Gets the uniform frequency step in hertz.
SteppedFrequencySignal(const SteppedFrequencySignal &) noexcept=delete
SteppedFrequencySignal & operator=(const SteppedFrequencySignal &) noexcept=delete
std::size_t getStepCount() const noexcept
Gets the number of steps per sweep.
RealType getStepPeriod() const noexcept
Gets step repetition period in seconds.
RealType getDwellTime() const noexcept
Gets active dwell time per step in seconds.
SteppedFrequencySignal(SteppedFrequencySignal &&) noexcept=delete
~SteppedFrequencySignal() override=default
Global configuration file for the project.
double RealType
Type for real numbers.
Definition config.h:27
std::complex< RealType > ComplexType
Type for complex numbers.
Definition config.h:35
FmcwChirpDirection parseFmcwChirpDirection(const std::string_view direction)
Parses a schema chirp direction token.
FileWaveformKind
Simulation mode assigned to samples loaded from a waveform file.
std::string_view fmcwChirpDirectionToken(const FmcwChirpDirection direction) noexcept
Converts a chirp direction to the schema token.
FmcwChirpDirection
Sweep direction for a linear FMCW chirp.
@ Down
Instantaneous baseband frequency decreases over the chirp.
@ Up
Instantaneous baseband frequency increases over the chirp.
uint64_t SimId
64-bit Unique Simulation ID.
Definition sim_id.h:18
math::Vec3 max
Active SFCW dwell selected for one local waveform time.