FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
signal_processor.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 signal_processor.h
10 * @brief Header for receiver-side signal processing and rendering.
11 *
12 * This file contains declarations for functions that perform digital signal
13 * processing on received radar signals. This includes rendering raw responses
14 * into time-domain I/Q samples, adding thermal noise, and simulating ADC quantization.
15 */
16
17#pragma once
18
19#include <memory>
20#include <random>
21#include <span>
22#include <vector>
23
24#include "core/config.h"
25
26namespace serial
27{
28 class Response;
29}
30
31namespace pool
32{
33 class ThreadPool;
34}
35
36namespace processing
37{
38 /**
39 * @brief Renders a time-window of I/Q data from a collection of raw radar responses.
40 *
41 * This function orchestrates the process of converting abstract `Response` objects
42 * into a concrete vector of complex I/Q samples for a specific time window.
43 * It handles the superposition of multiple signals arriving at the receiver
44 * during the window and can use a thread pool for parallel processing.
45 *
46 * @param window The output vector where the rendered I/Q samples will be added.
47 * @param length The duration of the time window in seconds.
48 * @param start The start time of the window in seconds.
49 * @param fracDelay A fractional sample delay to apply for fine-grained timing.
50 * @param responses A span of unique pointers to the `Response` objects to be rendered.
51 */
52 void renderWindow(std::vector<ComplexType>& window, RealType length, RealType start, RealType fracDelay,
53 std::span<const std::unique_ptr<serial::Response>> responses);
54
55 /**
56 * @brief Applies thermal (Johnson-Nyquist) noise to a window of I/Q samples.
57 *
58 * Simulates the addition of white Gaussian noise based on the receiver's noise
59 * temperature and the simulation bandwidth.
60 *
61 * @param window A span of I/Q data to which noise will be added.
62 * @param noiseTemperature The effective noise temperature in Kelvin.
63 * @param rngEngine A random number generator engine to use for noise generation.
64 */
65 void applyThermalNoise(std::span<ComplexType> window, RealType noiseTemperature, std::mt19937& rngEngine);
66
67 /**
68 * @brief Simulates ADC quantization and scales a window of complex I/Q samples.
69 *
70 * This function first finds the maximum absolute value in the I/Q data to determine
71 * the full-scale range. It then simulates the quantization process based on the
72 * configured number of ADC bits. If no quantization is specified (adc_bits=0), it
73 * normalizes the data to a maximum amplitude of 1.0.
74 *
75 * @param window The window of complex I/Q samples to quantize and scale.
76 * @return The full-scale value used for quantization/normalization.
77 */
78 RealType quantizeAndScaleWindow(std::span<ComplexType> window);
79}
Global configuration file for the project.
double RealType
Type for real numbers.
Definition config.h:27
void applyThermalNoise(std::span< ComplexType > window, const RealType noiseTemperature, std::mt19937 &rngEngine)
Applies thermal (Johnson-Nyquist) noise to a window of I/Q samples.
RealType quantizeAndScaleWindow(std::span< ComplexType > window)
Simulates ADC quantization and scales a window of complex I/Q samples.
void renderWindow(std::vector< ComplexType > &window, const RealType length, const RealType start, const RealType fracDelay, const std::span< const std::unique_ptr< serial::Response > > responses)
Renders a time-window of I/Q data from a collection of raw radar responses.