FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
noise::FAlphaBranch Class Reference

Class responsible for generating fractional and integer noise components. More...

#include "falpha_branch.h"

Public Member Functions

 FAlphaBranch (std::mt19937 &rngEngine, RealType ffrac, unsigned fint, std::unique_ptr< FAlphaBranch > pre, bool last)
 Constructor for FAlphaBranch.
 
 ~FAlphaBranch ()=default
 
 FAlphaBranch (const FAlphaBranch &)=delete
 
FAlphaBranchoperator= (const FAlphaBranch &)=delete
 
 FAlphaBranch (FAlphaBranch &&)=delete
 
FAlphaBranchoperator= (FAlphaBranch &&)=delete
 
RealType getSample () noexcept
 Retrieves the current noise sample.
 
void flush (RealType scale)
 Flushes the branch with a new scaling factor.
 
FAlphaBranchgetPre () const noexcept
 Retrieves the previous branch in the chain.
 

Detailed Description

Class responsible for generating fractional and integer noise components.

The FAlphaBranch class generates noise by applying a fractional integrator filter. It uses a series of filters and upsamplers to process and shape the noise signal.

Definition at line 32 of file falpha_branch.h.

Constructor & Destructor Documentation

◆ FAlphaBranch() [1/3]

noise::FAlphaBranch::FAlphaBranch ( std::mt19937 &  rngEngine,
RealType  ffrac,
unsigned  fint,
std::unique_ptr< FAlphaBranch pre,
bool  last 
)

Constructor for FAlphaBranch.

Parameters
rngEngineThe random number generator engine to use.
ffracFractional part of the noise generation (e.g., 0.5 for 1/f noise).
fintInteger part of the noise generation (e.g., 1 for integration).
prePrevious stage of the FAlphaBranch for recursive noise processing.
lastSpecifies if this is the last branch in the chain of processing.

Definition at line 30 of file falpha_branch.cpp.

31 :
32 _rng_engine_ref(rngEngine), _normal_dist{0.0, 1.0}, _pre(std::move(pre)), _buffer(10), _ffrac(ffrac),
33 _fint(fint), _last(last)
34 {
35 LOG(Level::TRACE, "Creating FAlphaBranch: ffrac={} fint={}", ffrac, fint);
36 _upsample_scale = std::pow(10, ffrac + fint + 0.5);
37 init();
38
39 if (!_last)
40 {
41 refill();
42 }
43 }
#define LOG(level,...)
Definition logging.h:19

References LOG.

◆ ~FAlphaBranch()

noise::FAlphaBranch::~FAlphaBranch ( )
default

◆ FAlphaBranch() [2/3]

noise::FAlphaBranch::FAlphaBranch ( const FAlphaBranch )
delete

◆ FAlphaBranch() [3/3]

noise::FAlphaBranch::FAlphaBranch ( FAlphaBranch &&  )
delete

Member Function Documentation

◆ flush()

void noise::FAlphaBranch::flush ( RealType  scale)

Flushes the branch with a new scaling factor.

Parameters
scaleNew scale factor to apply to the previous stage.

Definition at line 168 of file falpha_branch.cpp.

169 {
170 init();
171 _pre_scale = scale;
172 }

Referenced by noise::MultirateGenerator::reset().

+ Here is the caller graph for this function:

◆ getPre()

FAlphaBranch * noise::FAlphaBranch::getPre ( ) const
noexcept

Retrieves the previous branch in the chain.

Returns
Pointer to the previous FAlphaBranch, or nullptr if none exists.

Definition at line 76 of file falpha_branch.h.

76{ return _pre.get(); }

Referenced by noise::MultirateGenerator::reset(), and noise::MultirateGenerator::skipSamples().

+ Here is the caller graph for this function:

◆ getSample()

RealType noise::FAlphaBranch::getSample ( )
noexcept

Retrieves the current noise sample.

Returns
The current noise sample.

Definition at line 109 of file falpha_branch.cpp.

110 {
111 if (!_last)
112 {
113 const RealType ret = _buffer[_buffer_samples++];
114 if (_buffer_samples == 10)
115 {
116 refill();
117 }
118 return ret;
119 }
120 return calcSample() + _offset_sample * _upsample_scale;
121 }
double RealType
Type for real numbers.
Definition config.h:27

Referenced by noise::MultirateGenerator::skipSamples().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

FAlphaBranch & noise::FAlphaBranch::operator= ( const FAlphaBranch )
delete

◆ operator=() [2/2]

FAlphaBranch & noise::FAlphaBranch::operator= ( FAlphaBranch &&  )
delete

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