FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
fers_signal::RadarSignal Class Reference

Class representing a radar signal with associated properties. More...

#include "radar_signal.h"

Public Member Functions

 RadarSignal (std::string name, RealType power, RealType carrierfreq, RealType length, std::unique_ptr< Signal > signal, const SimId id=0)
 Constructs a RadarSignal object.
 
 ~RadarSignal ()=default
 
 RadarSignal (const RadarSignal &) noexcept=delete
 
RadarSignaloperator= (const RadarSignal &) noexcept=delete
 
 RadarSignal (RadarSignal &&) noexcept=delete
 
RadarSignaloperator= (RadarSignal &&) noexcept=delete
 
void setFilename (const std::string &filename) noexcept
 Sets the filename associated with this signal.
 
const std::optional< std::string > & getFilename () const noexcept
 Gets the filename associated with this signal.
 
RealType getPower () const noexcept
 Gets the power of the radar signal.
 
RealType getCarrier () const noexcept
 Gets the carrier frequency of the radar signal.
 
const std::string & getName () const noexcept
 Gets the name of the radar signal.
 
SimId getId () const noexcept
 Gets the unique ID of the radar signal.
 
RealType getRate () const noexcept
 Gets the sample rate of the radar signal.
 
RealType getLength () const noexcept
 Gets the length of the radar signal.
 
const SignalgetSignal () const noexcept
 Gets the underlying signal object.
 
std::vector< ComplexTyperender (const std::vector< interp::InterpPoint > &points, unsigned &size, RealType fracWinDelay) const
 Renders the radar signal.
 

Detailed Description

Class representing a radar signal with associated properties.

Definition at line 121 of file radar_signal.h.

Constructor & Destructor Documentation

◆ RadarSignal() [1/3]

fers_signal::RadarSignal::RadarSignal ( std::string  name,
RealType  power,
RealType  carrierfreq,
RealType  length,
std::unique_ptr< Signal signal,
const SimId  id = 0 
)

Constructs a RadarSignal object.

Parameters
nameThe name of the radar signal.
powerThe power of the radar signal.
carrierfreqThe carrier frequency of the radar signal.
lengthThe length of the radar signal.
signalA unique pointer to the Signal object containing the waveform data.
Exceptions
std::runtime_errorif the signal is null.

Definition at line 36 of file radar_signal.cpp.

37 :
38 _name(std::move(name)), _id(id == 0 ? SimIdGenerator::instance().generateId(ObjectType::Waveform) : id),
39 _power(power), _carrierfreq(carrierfreq), _length(length), _signal(std::move(signal))
40 {
41 if (!_signal)
42 {
43 throw std::runtime_error("Signal is empty");
44 }
45 }
static SimIdGenerator & instance()
Get the singleton instance of SimIdGenerator.
Definition sim_id.h:48

◆ ~RadarSignal()

fers_signal::RadarSignal::~RadarSignal ( )
default

◆ RadarSignal() [2/3]

fers_signal::RadarSignal::RadarSignal ( const RadarSignal )
deletenoexcept

◆ RadarSignal() [3/3]

fers_signal::RadarSignal::RadarSignal ( RadarSignal &&  )
deletenoexcept

Member Function Documentation

◆ getCarrier()

RealType fers_signal::RadarSignal::getCarrier ( ) const
noexcept

Gets the carrier frequency of the radar signal.

Returns
The carrier frequency of the radar signal.

Definition at line 171 of file radar_signal.h.

171{ return _carrierfreq; }

Referenced by simulation::calculateDirectPathContribution(), simulation::calculateReflectedPathContribution(), serial::xml_serializer_utils::serializeWaveform(), simulation::solveRe(), simulation::solveReDirect(), and fers_signal::to_json().

+ Here is the caller graph for this function:

◆ getFilename()

const std::optional< std::string > & fers_signal::RadarSignal::getFilename ( ) const
noexcept

Gets the filename associated with this signal.

Returns
The source filename, if one was set.

Definition at line 157 of file radar_signal.h.

157{ return _filename; }

Referenced by serial::xml_serializer_utils::serializeWaveform(), and fers_signal::to_json().

+ Here is the caller graph for this function:

◆ getId()

SimId fers_signal::RadarSignal::getId ( ) const
noexcept

Gets the unique ID of the radar signal.

Returns
The radar signal SimId.

Definition at line 185 of file radar_signal.h.

185{ return _id; }

Referenced by fers_signal::to_json(), and radar::to_json().

+ Here is the caller graph for this function:

◆ getLength()

RealType fers_signal::RadarSignal::getLength ( ) const
noexcept

Gets the length of the radar signal.

Returns
The length of the radar signal.

Definition at line 199 of file radar_signal.h.

199{ return _length; }

Referenced by simulation::calculateResponse().

+ Here is the caller graph for this function:

◆ getName()

const std::string & fers_signal::RadarSignal::getName ( ) const
noexcept

Gets the name of the radar signal.

Returns
The name of the radar signal.

Definition at line 178 of file radar_signal.h.

178{ return _name; }

Referenced by serial::xml_serializer_utils::serializeMonostatic(), serial::xml_serializer_utils::serializeTransmitter(), serial::xml_serializer_utils::serializeWaveform(), and fers_signal::to_json().

+ Here is the caller graph for this function:

◆ getPower()

RealType fers_signal::RadarSignal::getPower ( ) const
noexcept

Gets the power of the radar signal.

Returns
The power of the radar signal.

Definition at line 164 of file radar_signal.h.

164{ return _power; }

Referenced by simulation::calculatePreviewLinks(), serial::xml_serializer_utils::serializeWaveform(), and fers_signal::to_json().

+ Here is the caller graph for this function:

◆ getRate()

RealType fers_signal::RadarSignal::getRate ( ) const
noexcept

Gets the sample rate of the radar signal.

Returns
The sample rate of the radar signal.

Definition at line 192 of file radar_signal.h.

192{ return _signal->getRate(); }

Referenced by serial::Response::renderBinary().

+ Here is the caller graph for this function:

◆ getSignal()

const Signal * fers_signal::RadarSignal::getSignal ( ) const
noexcept

Gets the underlying signal object.

Returns
A const pointer to the Signal object.

Definition at line 205 of file radar_signal.h.

205{ return _signal.get(); }

Referenced by serial::xml_serializer_utils::serializeWaveform(), and fers_signal::to_json().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

RadarSignal & fers_signal::RadarSignal::operator= ( const RadarSignal )
deletenoexcept

◆ operator=() [2/2]

RadarSignal & fers_signal::RadarSignal::operator= ( RadarSignal &&  )
deletenoexcept

◆ render()

std::vector< ComplexType > fers_signal::RadarSignal::render ( const std::vector< interp::InterpPoint > &  points,
unsigned &  size,
RealType  fracWinDelay 
) const

Renders the radar signal.

Parameters
pointsA vector of interpolation points.
sizeReference to store the size of the rendered data.
fracWinDelayFractional window delay to apply during rendering.
Returns
A vector of rendered complex radar signal data.

Definition at line 47 of file radar_signal.cpp.

49 {
50 auto data = _signal->render(points, size, fracWinDelay);
51 const RealType scale = std::sqrt(_power);
52
53 std::ranges::for_each(data, [scale](auto& value) { value *= scale; });
54
55 return data;
56 }
double RealType
Type for real numbers.
Definition config.h:27

Referenced by serial::Response::renderBinary().

+ Here is the caller graph for this function:

◆ setFilename()

void fers_signal::RadarSignal::setFilename ( const std::string &  filename)
noexcept

Sets the filename associated with this signal.

Parameters
filenameThe source filename.

Definition at line 151 of file radar_signal.h.

151{ _filename = filename; }

The documentation for this class was generated from the following files: