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)
 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.
 
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 120 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 
)

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)), _power(power), _carrierfreq(carrierfreq), _length(length), _signal(std::move(signal))
39 {
40 if (!_signal)
41 {
42 throw std::runtime_error("Signal is empty");
43 }
44 }

◆ ~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 170 of file radar_signal.h.

170{ return _carrierfreq; }

Referenced by simulation::calculateDirectPathContribution(), simulation::calculateReflectedPathContribution(), 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 156 of file radar_signal.h.

156{ return _filename; }

Referenced by fers_signal::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 191 of file radar_signal.h.

191{ 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 177 of file radar_signal.h.

177{ return _name; }

Referenced by fers_signal::to_json(), and radar::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 163 of file radar_signal.h.

163{ return _power; }

Referenced by simulation::calculatePreviewLinks(), 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 184 of file radar_signal.h.

184{ 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 197 of file radar_signal.h.

197{ return _signal.get(); }

Referenced by 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 46 of file radar_signal.cpp.

48 {
49 auto data = _signal->render(points, size, fracWinDelay);
50 const RealType scale = std::sqrt(_power);
51
52 std::ranges::for_each(data, [scale](auto& value) { value *= scale; });
53
54 return data;
55 }
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 150 of file radar_signal.h.

150{ _filename = filename; }

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