FERS 0.1.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
simulation::CwPhaseNoiseBuffer Struct Reference

Sampled phase-noise buffer for one timing source. More...

#include "channel_model.h"

Public Member Functions

RealType sampleAt (RealType time) const noexcept
 Returns the interpolated phase-noise sample at the specified time.
 

Public Attributes

RealType start_time {}
 First sample time in seconds.
 
RealType dt {}
 Time spacing between phase-noise samples in seconds.
 
std::vector< RealTypesamples
 Phase-noise samples in radians.
 

Detailed Description

Sampled phase-noise buffer for one timing source.

Definition at line 64 of file channel_model.h.

Member Function Documentation

◆ sampleAt()

RealType simulation::CwPhaseNoiseBuffer::sampleAt ( RealType  time) const
noexcept

Returns the interpolated phase-noise sample at the specified time.

Definition at line 517 of file channel_model.cpp.

518 {
519 if (samples.empty())
520 {
521 return 0.0;
522 }
523 if ((time <= start_time) || (samples.size() == 1) || (dt <= 0.0))
524 {
525 return samples.front();
526 }
527
528 const RealType position = (time - start_time) / dt;
529 const auto last_index = static_cast<RealType>(samples.size() - 1);
530 if (position >= last_index)
531 {
532 return samples.back();
533 }
534
535 const auto lower_index = static_cast<std::size_t>(position);
536 const RealType fraction = position - static_cast<RealType>(lower_index);
538 }
Vec3 position
double RealType
Type for real numbers.
Definition config.h:27
math::Vec3 max
RealType start_time
First sample time in seconds.
std::vector< RealType > samples
Phase-noise samples in radians.
RealType dt
Time spacing between phase-noise samples in seconds.

References max, and position.

Member Data Documentation

◆ dt

RealType simulation::CwPhaseNoiseBuffer::dt {}

Time spacing between phase-noise samples in seconds.

Definition at line 67 of file channel_model.h.

67{}; ///< Time spacing between phase-noise samples in seconds.

◆ samples

std::vector<RealType> simulation::CwPhaseNoiseBuffer::samples

Phase-noise samples in radians.

Definition at line 68 of file channel_model.h.

◆ start_time

RealType simulation::CwPhaseNoiseBuffer::start_time {}

First sample time in seconds.

Definition at line 66 of file channel_model.h.

66{}; ///< First sample time in seconds.

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