USRP Hardware Driver and USRP Manual  Version: 4.6.0.0-7-gece7c4811
UHD and USRP Manual
uhd::rfnoc::fosphor_block_control Class Referenceabstract

#include <uhd/rfnoc/fosphor_block_control.hpp>

Inheritance diagram for uhd::rfnoc::fosphor_block_control:
uhd::rfnoc::noc_block_base uhd::rfnoc::node_t uhd::rfnoc::register_iface_holder

Public Member Functions

virtual void set_enable_histogram (const bool enable_histogram)=0
 
virtual bool get_enable_histogram () const =0
 
virtual void set_enable_waterfall (const bool enable_waterfall)=0
 
virtual bool get_enable_waterfall () const =0
 
virtual void clear_history ()=0
 
virtual void set_enable_dither (const bool enable_dither)=0
 
virtual bool get_enable_dither () const =0
 
virtual void set_enable_noise (const bool enable_noise)=0
 
virtual bool get_enable_noise () const =0
 
virtual void set_histogram_decimation (const uint16_t decimation)=0
 
virtual uint16_t get_histogram_decimation () const =0
 
virtual void set_histogram_offset (const uint16_t offset)=0
 
virtual uint16_t get_histogram_offset () const =0
 
virtual void set_histogram_scale (const uint16_t scale)=0
 
virtual uint16_t get_histogram_scale () const =0
 
virtual void set_histogram_rise_rate (const uint16_t rise_rate)=0
 
virtual uint16_t get_histogram_rise_rate () const =0
 
virtual void set_histogram_decay_rate (const uint16_t decay_rate)=0
 
virtual uint16_t get_histogram_decay_rate () const =0
 
virtual void set_spectrum_alpha (const uint16_t alpha)=0
 
virtual uint16_t get_spectrum_alpha () const =0
 
virtual void set_spectrum_max_hold_decay (const uint16_t epsilon)=0
 
virtual uint16_t get_spectrum_max_hold_decay () const =0
 
virtual void set_waterfall_predivision (const fosphor_waterfall_predivision_ratio waterfall_predivision)=0
 
virtual fosphor_waterfall_predivision_ratio get_waterfall_predivision () const =0
 
virtual void set_waterfall_mode (const fosphor_waterfall_mode waterfall_mode)=0
 
virtual fosphor_waterfall_mode get_waterfall_mode () const =0
 
virtual void set_waterfall_decimation (const uint16_t waterfall_decimation)=0
 
virtual uint16_t get_waterfall_decimation () const =0
 
- Public Member Functions inherited from uhd::rfnoc::noc_block_base
 ~noc_block_base () override
 
std::string get_unique_id () const override
 Unique ID for an RFNoC block is its block ID. More...
 
size_t get_num_input_ports () const override
 Number of input ports. Note: This gets passed into this block from the. More...
 
size_t get_num_output_ports () const override
 Number of output ports. Note: This gets passed outto this block from the. More...
 
noc_id_t get_noc_id () const
 
const block_id_tget_block_id () const
 
double get_tick_rate () const
 
size_t get_mtu (const res_source_info &edge)
 
size_t get_chdr_hdr_len (const bool account_for_ts=true) const
 
size_t get_max_payload_size (const res_source_info &edge, const bool account_for_ts=true)
 
uhd::device_addr_t get_block_args () const
 
uhd::property_tree::sptrget_tree () const
 Return a reference to this block's subtree. More...
 
uhd::property_tree::sptrget_tree ()
 Return a reference to this block's subtree (non-const version) More...
 
std::shared_ptr< mb_controllerget_mb_controller ()
 
- Public Member Functions inherited from uhd::rfnoc::node_t
 node_t ()
 
virtual ~node_t ()
 
std::vector< std::string > get_property_ids () const
 
template<typename prop_data_t >
void set_property (const std::string &id, const prop_data_t &val, const size_t instance=0)
 
void set_properties (const uhd::device_addr_t &props, const size_t instance=0)
 
template<typename prop_data_t >
const prop_data_t & get_property (const std::string &id, const size_t instance=0)
 
virtual void set_command_time (uhd::time_spec_t time, const size_t instance)
 
virtual uhd::time_spec_t get_command_time (const size_t instance) const
 
virtual void clear_command_time (const size_t instance)
 
- Public Member Functions inherited from uhd::rfnoc::register_iface_holder
 register_iface_holder (register_iface::sptr reg)
 
virtual ~register_iface_holder ()=default
 
register_ifaceregs ()
 

Static Public Attributes

static const uint32_t REG_ENABLE_ADDR
 
static const uint32_t REG_CLEAR_ADDR
 
static const uint32_t REG_RANDOM_ADDR
 
static const uint32_t REG_DECIM_ADDR
 
static const uint32_t REG_OFFSET_ADDR
 
static const uint32_t REG_SCALE_ADDR
 
static const uint32_t REG_TRISE_ADDR
 
static const uint32_t REG_TDECAY_ADDR
 
static const uint32_t REG_ALPHA_ADDR
 
static const uint32_t REG_EPSILON_ADDR
 
static const uint32_t REG_WF_CTRL_ADDR
 
static const uint32_t REG_WF_DECIM_ADDR
 
- Static Public Attributes inherited from uhd::rfnoc::node_t
static const size_t ANY_PORT = size_t(~0)
 

Additional Inherited Members

- Public Types inherited from uhd::rfnoc::noc_block_base
using sptr = std::shared_ptr< noc_block_base >
 
using make_args_ptr = std::unique_ptr< make_args_t >
 Opaque pointer to the constructor arguments. More...
 
- Public Types inherited from uhd::rfnoc::node_t
enum  forwarding_policy_t {
  forwarding_policy_t::ONE_TO_ONE, forwarding_policy_t::ONE_TO_FAN, forwarding_policy_t::ONE_TO_ALL_IN, forwarding_policy_t::ONE_TO_ALL_OUT,
  forwarding_policy_t::ONE_TO_ALL, forwarding_policy_t::DROP, forwarding_policy_t::USE_MAP
}
 Types of property/action forwarding for those not defined by the block itself. More...
 
using resolver_fn_t = std::function< void(void)>
 
using resolve_callback_t = std::function< void(void)>
 
using graph_mutex_callback_t = std::function< std::recursive_mutex &(void)>
 
using action_handler_t = std::function< void(const res_source_info &, action_info::sptr)>
 
using forwarding_map_t = std::unordered_map< res_source_info, std::vector< res_source_info > >
 
- Protected Types inherited from uhd::rfnoc::node_t
using prop_ptrs_t = std::vector< property_base_t * >
 
- Protected Member Functions inherited from uhd::rfnoc::noc_block_base
 noc_block_base (make_args_ptr make_args)
 
void set_num_input_ports (const size_t num_ports)
 Update number of input ports. More...
 
void set_num_output_ports (const size_t num_ports)
 Update number of output ports. More...
 
void set_tick_rate (const double tick_rate)
 
void set_mtu_forwarding_policy (const forwarding_policy_t policy)
 
void set_mtu (const res_source_info &edge, const size_t new_mtu)
 
property_base_tget_mtu_prop_ref (const res_source_info &edge)
 
virtual void deinit ()
 
- Protected Member Functions inherited from uhd::rfnoc::node_t
void register_property (property_base_t *prop, resolve_callback_t &&clean_callback=nullptr)
 
void add_property_resolver (prop_ptrs_t &&inputs, prop_ptrs_t &&outputs, resolver_fn_t &&resolver_fn)
 
void set_prop_forwarding_policy (forwarding_policy_t policy, const std::string &prop_id="")
 
void set_prop_forwarding_map (const forwarding_map_t &map)
 
template<typename prop_data_t >
void set_property (const std::string &id, const prop_data_t &val, const res_source_info &src_info)
 
template<typename prop_data_t >
const prop_data_t & get_property (const std::string &id, const res_source_info &src_info)
 
void register_action_handler (const std::string &id, action_handler_t &&handler)
 
void set_action_forwarding_policy (forwarding_policy_t policy, const std::string &action_key="")
 
void set_action_forwarding_map (const forwarding_map_t &map)
 
void post_action (const res_source_info &edge_info, action_info::sptr action)
 
virtual bool check_topology (const std::vector< size_t > &connected_inputs, const std::vector< size_t > &connected_outputs)
 
- Protected Member Functions inherited from uhd::rfnoc::register_iface_holder
void update_reg_iface (register_iface::sptr new_iface=nullptr)
 
- Static Protected Attributes inherited from uhd::rfnoc::node_t
static dirtifier_t ALWAYS_DIRTY
 A dirtifyer object, useful for properties that always need updating. More...
 

Detailed Description

Fosphor Control Class

The Fosphor Block is an RFNoC block that accepts FFT data as signed complex 16-bit data and produces two streams of eight-bit data, a stream of histogram data and a stream of waterfall data.

Histogram

Each time the Fosphor block receives an FFT input packet, the power values in each of the N frequency bins are quantized into one of 64 power bins (X axis represents individual FFT frequency bins; Y axis represents the power bins):

63                                .
 :                              .   .
 :                  . .       .       .     . .
 0  . . . . . . . .     . . .           . .     . . . . . . .
    0 1 2 3 4 5 - - - - - - - - - - - - - - - - - - - - - - N-1

Each time an FFT power value is quantized to a bin, the bin count is increased by one (illustrated by a '+'):

63                                +
 :                              +   +
 :                  + +       +       +     + +
 0  + + + + + + + +     + + +           + +     + + + + + + +
    0 1 2 3 4 5 - - - - - - - - - - - - - - - - - - - - - - N-1

As more FFT packets are received, the counts in each bin accumulate. Over time, the count in the 'closest' power bin to each sample in the FFT accumulates at the highest rate. However, adjacent power bins' counts may increase due to quantization noise and variances in the input FFT signal (highest counts illustrated by '*', followed by '+' and '.'):

63                              . * +
 :          .       . .       + * . * +
 :  + + . . + + . + * * + + + * +     * + + * * . + . + + .
 0  * * * * * * * * + + * * * +       + * * + + * * * * * *
    0 1 2 3 4 5 - - - - - - - - - - - - - - - - - - - - - - N-1

The Fosphor block also calculates the average power level and maximum power level encountered in each FFT frequency bin. The rate at which the accumulated counts, average power level, and maximum power level values rise and fall over time is configurable.

An instance of histogram data output consists of 66 packets:

  • 64 packets, one per quantized power level, of N values, representing the accumulated count for each frequency bin for that particular quantized power level;
  • One packet of N values, representing the average power level in each frequency bin; and
  • One packet of N values, representing the maximum power level in each frequency bin.

Waterfall

The waterfall stream consists of history data of either the average or maximum power level values in each bin, depending on the selected waterfall mode. In max hold mode, each waterfall packet consists of N values, representing the maximum power level in each frequency bin. The rate that packets are produced relative to the number of input FFT packets is configurable via the waterfall decimation parameter.

In average mode, each waterfall packet consists of N values, representing the sum of the average power level in each frequency bin accumulated between packets. (Thus, if the decimation rate is increased, the values returned are higher than if the decimation rate is decreased.) The waterfall predivision ratio parameter can be used to scale the values prior to accumulation to counteract this effect.

These streams are intended to be inputs to the GNU Radio Fosphor display block, which renders the streams in a entertaining graphical format.

Member Function Documentation

◆ clear_history()

virtual void uhd::rfnoc::fosphor_block_control::clear_history ( )
pure virtual

Clear the Fosphor block's stored history

Clears the accumulated history in the Fosphor block, resetting average and max hold values.

◆ get_enable_dither()

virtual bool uhd::rfnoc::fosphor_block_control::get_enable_dither ( ) const
pure virtual

Get the dither enable flag

Returns the current dither enable value.

Returns
Dither enable/disable flag

◆ get_enable_histogram()

virtual bool uhd::rfnoc::fosphor_block_control::get_enable_histogram ( ) const
pure virtual

Get the histogram stream enable flag

Returns the current histogram enable value.

Returns
Histogram stream enable/disable flag

◆ get_enable_noise()

virtual bool uhd::rfnoc::fosphor_block_control::get_enable_noise ( ) const
pure virtual

Get the noise enable flag

Returns the current noise enable value.

Returns
Noise enable/disable flag

◆ get_enable_waterfall()

virtual bool uhd::rfnoc::fosphor_block_control::get_enable_waterfall ( ) const
pure virtual

Get the waterfall stream enable flag

Returns the current waterfall enable value.

Returns
Histogram stream enable/disable flag

◆ get_histogram_decay_rate()

virtual uint16_t uhd::rfnoc::fosphor_block_control::get_histogram_decay_rate ( ) const
pure virtual

Get the histogram decay rate factor

Returns the current histogram decay rate factor.

Returns
The histogram decay rate factor

◆ get_histogram_decimation()

virtual uint16_t uhd::rfnoc::fosphor_block_control::get_histogram_decimation ( ) const
pure virtual

Get the histogram decimation factor

Returns the current histogram decimation factor.

Returns
Histogram decimation factor

◆ get_histogram_offset()

virtual uint16_t uhd::rfnoc::fosphor_block_control::get_histogram_offset ( ) const
pure virtual

Get the histogram offset factor

Returns the current histogram offset factor.

Returns
The histogram offset factor

◆ get_histogram_rise_rate()

virtual uint16_t uhd::rfnoc::fosphor_block_control::get_histogram_rise_rate ( ) const
pure virtual

Get the histogram rise rate factor

Returns the current histogram rise rate factor.

Returns
The histogram rise rate factor

◆ get_histogram_scale()

virtual uint16_t uhd::rfnoc::fosphor_block_control::get_histogram_scale ( ) const
pure virtual

Get the history scale factor

Returns the current histogram scale factor.

Returns
The histogram scale factor

◆ get_spectrum_alpha()

virtual uint16_t uhd::rfnoc::fosphor_block_control::get_spectrum_alpha ( ) const
pure virtual

Get the power level moving average weighting

Returns the weighting that is applied to older samples when calculating the average power level for each FFT frequency bin.

Returns
The power level moving average weighting

◆ get_spectrum_max_hold_decay()

virtual uint16_t uhd::rfnoc::fosphor_block_control::get_spectrum_max_hold_decay ( ) const
pure virtual

Get the maximum hold decay rate

Returns the rate at which the maximum value for each FFT frequency bin decays.

Returns
The maximum hold decay rate

◆ get_waterfall_decimation()

virtual uint16_t uhd::rfnoc::fosphor_block_control::get_waterfall_decimation ( ) const
pure virtual

Get the histogram decimation factor

Returns the current waterfall decimation factor.

Returns
The waterfall decimation factor

◆ get_waterfall_mode()

virtual fosphor_waterfall_mode uhd::rfnoc::fosphor_block_control::get_waterfall_mode ( ) const
pure virtual

Get the waterfall mode setting

Returns the current waterfall mode setting.

Returns
The waterfall mode setting

◆ get_waterfall_predivision()

virtual fosphor_waterfall_predivision_ratio uhd::rfnoc::fosphor_block_control::get_waterfall_predivision ( ) const
pure virtual

Get the waterfall predivision ratio

Returns the current waterfall predivision ratio.

Returns
The waterfall predivision ratio

◆ set_enable_dither()

virtual void uhd::rfnoc::fosphor_block_control::set_enable_dither ( const bool  enable_dither)
pure virtual

Set the dither enable flag

Enables or disables dithering. Dithering adds quantization error to the incoming signal.

Parameters
enable_ditherDither enable/disable flag

◆ set_enable_histogram()

virtual void uhd::rfnoc::fosphor_block_control::set_enable_histogram ( const bool  enable_histogram)
pure virtual

Set the histogram stream enable flag

Enables or disables the stream of histogram data from the block.

Parameters
enable_histogramHistogram stream enable/disable flag

◆ set_enable_noise()

virtual void uhd::rfnoc::fosphor_block_control::set_enable_noise ( const bool  enable_noise)
pure virtual

Set the noise enable flag

Enables or disables the addition of random noise to the incoming signal.

Parameters
enable_noiseNoise enable/disable flag

◆ set_enable_waterfall()

virtual void uhd::rfnoc::fosphor_block_control::set_enable_waterfall ( const bool  enable_waterfall)
pure virtual

Set the waterfall stream enable flag

Enables or disables the stream of waterfall data from the block.

Parameters
enable_waterfallHistogram stream enable/disable flag

◆ set_histogram_decay_rate()

virtual void uhd::rfnoc::fosphor_block_control::set_histogram_decay_rate ( const uint16_t  decay_rate)
pure virtual

Set the histogram decay rate factor

Sets the rate at which the hit count in each frequency and power bin decreases when not accumulating (i.e., there are no hits in the particular bin). The lower the value, the more slowly the values decrease, leading to a phosphorescent-like effect on the Fosphor display similar to the gradual fading of a CRT display when the electron beam is extinguished.

Parameters
decay_rateThe histogram decay rate factor to apply

◆ set_histogram_decimation()

virtual void uhd::rfnoc::fosphor_block_control::set_histogram_decimation ( const uint16_t  decimation)
pure virtual

Set the histogram decimation factor

Sets the ratio of histogram outputs to FFT packet inputs. For every decimation FFT input packets, one histogram output cluster (64 histogram packets, plus a maximum and average values packet) is produced. The minimum value for decimation is 2.

Parameters
decimationHistogram decimation factor

◆ set_histogram_offset()

virtual void uhd::rfnoc::fosphor_block_control::set_histogram_offset ( const uint16_t  offset)
pure virtual

Set the histogram offset factor

Sets the offset factor to apply to FFT power levels before determining the appropriate histogram bin.

Parameters
offsetThe histogram offset factor to apply

◆ set_histogram_rise_rate()

virtual void uhd::rfnoc::fosphor_block_control::set_histogram_rise_rate ( const uint16_t  rise_rate)
pure virtual

Set the histogram rise rate factor

Sets the rate at which the hit count in each frequency and power bin increases when accumulating (i.e., there are hits in the particular bin). The higher the value, the more quickly the values increase, leading to a phosphorescent-like effect on the Fosphor display similar to the gradual illumination of a CRT display in the area where the electron beam is pointing.

Parameters
rise_rateThe histogram rise rate factor to apply

◆ set_histogram_scale()

virtual void uhd::rfnoc::fosphor_block_control::set_histogram_scale ( const uint16_t  scale)
pure virtual

Set the histogram scale factor

Sets the scale factor to apply to FFT power levels before determining the appropriate histogram bin. The scaling factor is scale / 256.

Parameters
scaleThe histogram scale factor to apply

◆ set_spectrum_alpha()

virtual void uhd::rfnoc::fosphor_block_control::set_spectrum_alpha ( const uint16_t  alpha)
pure virtual

Set the power level moving average weighting

Sets the weighing to be applied to the average power level value for each FFT frequency bin. The higher the value, the higher the weight is given to older samples (and thus the more slowly the average values change over time in each bin).

Parameters
alphaThe power level moving average weighting to apply

◆ set_spectrum_max_hold_decay()

virtual void uhd::rfnoc::fosphor_block_control::set_spectrum_max_hold_decay ( const uint16_t  epsilon)
pure virtual

Set the maximum hold decay rate

Sets the rate at which the maximum value for each FFT frequency bin decays. The higher the value, the faster the decay rate. A value of 0 retains the maximum values indefinitely.

Parameters
epsilonThe histogram scale factor to apply

◆ set_waterfall_decimation()

virtual void uhd::rfnoc::fosphor_block_control::set_waterfall_decimation ( const uint16_t  waterfall_decimation)
pure virtual

Set the waterfall decimation factor

Sets the ratio of waterfall outputs to FFT packet inputs. For every waterfall_decimation FFT input packets, one waterfall output packet is produced. The minimum value for waterfall_decimation is 2.

Parameters
waterfall_decimationThe waterfall decimation factor to apply

◆ set_waterfall_mode()

virtual void uhd::rfnoc::fosphor_block_control::set_waterfall_mode ( const fosphor_waterfall_mode  waterfall_mode)
pure virtual

Set the waterfall mode setting

Sets the source of the waterfall history data. When waterfall_mode is set to MAX_HOLD, the waterfall data is comprised of the max power values from each FFT frequency bin. When waterfall_mode is set to AVERAGE, the waterfall data is comprised of the accumulated average value from each FFT frequency bin between waterfall output packets.

Parameters
waterfall_modeThe waterfall mode setting

◆ set_waterfall_predivision()

virtual void uhd::rfnoc::fosphor_block_control::set_waterfall_predivision ( const fosphor_waterfall_predivision_ratio  waterfall_predivision)
pure virtual

Set the waterfall predivision ratio

Sets the scaling factor applied to waterfall values.

Parameters
waterfall_predivisionThe waterfall predivision ratio to apply

Member Data Documentation

◆ REG_ALPHA_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_ALPHA_ADDR
static

◆ REG_CLEAR_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_CLEAR_ADDR
static

◆ REG_DECIM_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_DECIM_ADDR
static

◆ REG_ENABLE_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_ENABLE_ADDR
static

◆ REG_EPSILON_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_EPSILON_ADDR
static

◆ REG_OFFSET_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_OFFSET_ADDR
static

◆ REG_RANDOM_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_RANDOM_ADDR
static

◆ REG_SCALE_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_SCALE_ADDR
static

◆ REG_TDECAY_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_TDECAY_ADDR
static

◆ REG_TRISE_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_TRISE_ADDR
static

◆ REG_WF_CTRL_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_WF_CTRL_ADDR
static

◆ REG_WF_DECIM_ADDR

const uint32_t uhd::rfnoc::fosphor_block_control::REG_WF_DECIM_ADDR
static

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