#include <uhd/rfnoc/fosphor_block_control.hpp>
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_t & | get_block_id () const |
double | get_tick_rate () const |
size_t | get_mtu (const res_source_info &edge) |
uhd::device_addr_t | get_block_args () const |
uhd::property_tree::sptr & | get_tree () const |
Return a reference to this block's subtree. More... | |
uhd::property_tree::sptr & | get_tree () |
Return a reference to this block's subtree (non-const version) More... | |
Public Member Functions inherited from uhd::rfnoc::node_t | |
node_t () | |
virtual | ~node_t () |
virtual std::string | get_unique_id () const |
Return a unique identifier string for this node. In every RFNoC graph,. More... | |
virtual size_t | get_num_input_ports () const =0 |
virtual size_t | get_num_output_ports () const =0 |
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_iface & | regs () |
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 class | forwarding_policy_t { ONE_TO_ONE , ONE_TO_FAN , ONE_TO_ALL_IN , ONE_TO_ALL_OUT , ONE_TO_ALL , DROP , 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 | 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::unordered_set< 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_t * | get_mtu_prop_ref (const res_source_info &edge) |
std::shared_ptr< mb_controller > | get_mb_controller () |
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) |
virtual void | shutdown () |
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... | |
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.
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:
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.
|
pure virtual |
Clear the Fosphor block's stored history
Clears the accumulated history in the Fosphor block, resetting average and max hold values.
|
pure virtual |
Get the dither enable flag
Returns the current dither enable value.
|
pure virtual |
Get the histogram stream enable flag
Returns the current histogram enable value.
|
pure virtual |
Get the noise enable flag
Returns the current noise enable value.
|
pure virtual |
Get the waterfall stream enable flag
Returns the current waterfall enable value.
|
pure virtual |
Get the histogram decay rate factor
Returns the current histogram decay rate factor.
|
pure virtual |
Get the histogram decimation factor
Returns the current histogram decimation factor.
|
pure virtual |
Get the histogram offset factor
Returns the current histogram offset factor.
|
pure virtual |
Get the histogram rise rate factor
Returns the current histogram rise rate factor.
|
pure virtual |
Get the history scale factor
Returns the current histogram scale factor.
|
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.
|
pure virtual |
Get the maximum hold decay rate
Returns the rate at which the maximum value for each FFT frequency bin decays.
|
pure virtual |
Get the histogram decimation factor
Returns the current waterfall decimation factor.
|
pure virtual |
Get the waterfall mode setting
Returns the current waterfall mode setting.
|
pure virtual |
Get the waterfall predivision ratio
Returns the current waterfall predivision ratio.
|
pure virtual |
Set the dither enable flag
Enables or disables dithering. Dithering adds quantization error to the incoming signal.
enable_dither | Dither enable/disable flag |
|
pure virtual |
Set the histogram stream enable flag
Enables or disables the stream of histogram data from the block.
enable_histogram | Histogram stream enable/disable flag |
|
pure virtual |
Set the noise enable flag
Enables or disables the addition of random noise to the incoming signal.
enable_noise | Noise enable/disable flag |
|
pure virtual |
Set the waterfall stream enable flag
Enables or disables the stream of waterfall data from the block.
enable_waterfall | Histogram stream enable/disable flag |
|
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.
decay_rate | The histogram decay rate factor to apply |
|
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.
decimation | Histogram decimation factor |
|
pure virtual |
Set the histogram offset factor
Sets the offset factor to apply to FFT power levels before determining the appropriate histogram bin.
offset | The histogram offset factor to apply |
|
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.
rise_rate | The histogram rise rate factor to apply |
|
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.
scale | The histogram scale factor to apply |
|
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).
alpha | The power level moving average weighting to apply |
|
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.
epsilon | The histogram scale factor to apply |
|
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.
waterfall_decimation | The waterfall decimation factor to apply |
|
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.
waterfall_mode | The waterfall mode setting |
|
pure virtual |
Set the waterfall predivision ratio
Sets the scaling factor applied to waterfall values.
waterfall_predivision | The waterfall predivision ratio to apply |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |