gr::filter::pfb_arb_resampler_fff
gr::block
gnuradio/filter/pfb_arb_resampler_fff.h
std::shared_ptr< pfb_arb_resampler_fff > std::shared_ptr<pfb_arb_resampler_fff> gr::filter::pfb_arb_resampler_fff::sptr sptr gr::filter::pfb_arb_resampler_fff::sptr
sptr static sptr gr::filter::pfb_arb_resampler_fff::make (float rate, const std::vector< float > &taps, unsigned int filter_size=32) make gr::filter::pfb_arb_resampler_fff::make float rate const std::vector< float > & taps unsigned int filter_size 32

Build the polyphase filterbank arbitrary resampler. rate

(float) Specifies the resampling rate to use

taps

(vector/list of floats) The prototype filter to populate the filterbank. The taps should be generated at the filter_size sampling rate.

filter_size

(unsigned int) The number of filters in the filter bank. This is directly related to quantization noise introduced during the resampling. Defaults to 32 filters.

void virtual void gr::filter::pfb_arb_resampler_fff::set_taps (const std::vector< float > &taps)=0 set_taps gr::filter::pfb_arb_resampler_fff::set_taps const std::vector< float > & taps

Resets the filterbank's filter taps with the new prototype filter taps

(vector/list of floats) The prototype filter to populate the filterbank.

std::vector< std::vector< float > > virtual std::vector< std::vector< float > > gr::filter::pfb_arb_resampler_fff::taps () const =0 taps gr::filter::pfb_arb_resampler_fff::taps

Return a vector<vector<>> of the filterbank taps

void virtual void gr::filter::pfb_arb_resampler_fff::print_taps ()=0 print_taps gr::filter::pfb_arb_resampler_fff::print_taps

Print all of the filterbank taps to screen.

void virtual void gr::filter::pfb_arb_resampler_fff::set_rate (float rate)=0 set_rate gr::filter::pfb_arb_resampler_fff::set_rate float rate

Sets the resampling rate of the block.

void virtual void gr::filter::pfb_arb_resampler_fff::set_phase (float ph)=0 set_phase gr::filter::pfb_arb_resampler_fff::set_phase float ph

Sets the current phase offset in radians (0 to 2pi).

float virtual float gr::filter::pfb_arb_resampler_fff::phase () const =0 phase gr::filter::pfb_arb_resampler_fff::phase

Gets the current phase of the resampler in radians (2 to 2pi).

unsigned int virtual unsigned int gr::filter::pfb_arb_resampler_fff::taps_per_filter () const =0 taps_per_filter gr::filter::pfb_arb_resampler_fff::taps_per_filter

Gets the number of taps per filter.

unsigned int virtual unsigned int gr::filter::pfb_arb_resampler_fff::interpolation_rate () const =0 interpolation_rate gr::filter::pfb_arb_resampler_fff::interpolation_rate

Gets the interpolation rate of the filter.

unsigned int virtual unsigned int gr::filter::pfb_arb_resampler_fff::decimation_rate () const =0 decimation_rate gr::filter::pfb_arb_resampler_fff::decimation_rate

Gets the decimation rate of the filter.

float virtual float gr::filter::pfb_arb_resampler_fff::fractional_rate () const =0 fractional_rate gr::filter::pfb_arb_resampler_fff::fractional_rate

Gets the fractional rate of the filter.

int virtual int gr::filter::pfb_arb_resampler_fff::group_delay () const =0 group_delay gr::filter::pfb_arb_resampler_fff::group_delay

Get the group delay of the filter.

float virtual float gr::filter::pfb_arb_resampler_fff::phase_offset (float freq, float fs)=0 phase_offset gr::filter::pfb_arb_resampler_fff::phase_offset float freq float fs

Calculates the phase offset expected by a sine wave of frequency `freq` and sampling rate `fs` (assuming input sine wave has 0 degree phase).

Polyphase filterbank arbitrary resampler with float input, float output and float taps.

This block takes in a signal stream and performs arbitrary resampling. The resampling rate can be any real number r. The resampling is done by constructing N filters where N is the interpolation rate. We then calculate D where D = floor(N/r).

Using N and D, we can perform rational resampling where N/D is a rational number close to the input rate r where we have N filters and we cycle through them as a polyphase filterbank with a stride of D so that i+1 = (i + D) % N.

To get the arbitrary rate, we want to interpolate between two points. For each value out, we take an output from the current filter, i, and the next filter i+1 and then linearly interpolate between the two based on the real resampling rate we want.

The linear interpolation only provides us with an approximation to the real sampling rate specified. The error is a quantization error between the two filters we used as our interpolation points. To this end, the number of filters, N, used determines the quantization error; the larger N, the smaller the noise. You can design for a specified noise floor by setting the filter size (parameters filter_size). The size defaults to 32 filters, which is about as good as most implementations need.

The trick with designing this filter is in how to specify the taps of the prototype filter. Like the PFB interpolator, the taps are specified using the interpolated filter rate. In this case, that rate is the input sample rate multiplied by the number of filters in the filterbank, which is also the interpolation rate. All other values should be relative to this rate.

For example, for a 32-filter arbitrary resampler and using the GNU Radio's firdes utility to build the filter, we build a low-pass filter with a sampling rate of fs, a 3-dB bandwidth of BW and a transition bandwidth of TB. We can also specify the out-of-band attenuation to use, ATT, and the filter window function (a Blackman-harris window in this case). The first input is the gain of the filter, which we specify here as the interpolation rate (32).

self._taps = filter.firdes.low_pass_2(32, 32*fs, BW, TB, attenuation_dB=ATT, window=fft.window.WIN_BLACKMAN_hARRIS)

The theory behind this block can be found in Chapter 7.5 of the following book:

f. harris, "Multirate Signal Processing for Communication Systems", Upper Saddle River, NJ: Prentice Hall, Inc. 2004.

gr::basic_block
gr::block
gr::filter::pfb_arb_resampler_fff
gr::messages::msg_accepter
gr::msg_accepter
std::enable_shared_from_this< basic_block >
T
gr::basic_block
d_name
d_symbol_alias
d_symbol_name
d_input_signature
d_output_signature
d_debug_logger
d_logger
msg_queue
d_rpc_vars
d_message_subscribers
gr::block
d_max_output_buffer
d_min_output_buffer
d_pmt_done
d_system_port
gr::filter::pfb_arb_resampler_fff
gr::io_signature
gr::messages::msg_accepter
gr::msg_accepter
std::basic_string< Char >
std::deque< T >
elements
std::enable_shared_from_this< basic_block >
std::map< pmt::pmt_t, msg_queue_t, msg_queue_comparator >
keys
elements
std::shared_ptr< T >
ptr
std::shared_ptr< io_signature >
ptr
std::shared_ptr< logger >
std::shared_ptr< pmt_base >
std::string
std::vector< long >
std::vector< rpcbasic_sptr >
elements
p
- gr::filter::pfb_arb_resampler_fff
  _post
- gr::filter::pfb_arb_resampler_fff
  active_thread_priority
- gr::filter::pfb_arb_resampler_fff
  add_item_tag
- gr::filter::pfb_arb_resampler_fff
  add_item_tag
- gr::filter::pfb_arb_resampler_fff
  alias
- gr::filter::pfb_arb_resampler_fff
  alias_pmt
- gr::filter::pfb_arb_resampler_fff
  alias_set
- gr::filter::pfb_arb_resampler_fff
  alignment
- gr::filter::pfb_arb_resampler_fff
  allocate_buffer
- gr::filter::pfb_arb_resampler_fff
  allocate_detail
- gr::filter::pfb_arb_resampler_fff
  basic_block
- gr::filter::pfb_arb_resampler_fff
  basic_block
- gr::filter::pfb_arb_resampler_fff
  BLACK
- gr::filter::pfb_arb_resampler_fff
  blkd_input_timer_value
- gr::filter::pfb_arb_resampler_fff
  block
- gr::filter::pfb_arb_resampler_fff
  block
- gr::filter::pfb_arb_resampler_fff
  check_topology
- gr::filter::pfb_arb_resampler_fff
  clear_finished
- gr::filter::pfb_arb_resampler_fff
  color
- gr::filter::pfb_arb_resampler_fff
  consume
- gr::filter::pfb_arb_resampler_fff
  consume_each
- gr::filter::pfb_arb_resampler_fff
  d_blkd_input_timer_value
- gr::filter::pfb_arb_resampler_fff
  d_color
- gr::filter::pfb_arb_resampler_fff
  d_debug_logger
- gr::filter::pfb_arb_resampler_fff
  d_input_signature
- gr::filter::pfb_arb_resampler_fff
  d_logger
- gr::filter::pfb_arb_resampler_fff
  d_max_output_buffer
- gr::filter::pfb_arb_resampler_fff
  d_message_subscribers
- gr::filter::pfb_arb_resampler_fff
  d_min_output_buffer
- gr::filter::pfb_arb_resampler_fff
  d_name
- gr::filter::pfb_arb_resampler_fff
  d_output_signature
- gr::filter::pfb_arb_resampler_fff
  d_pmt_done
- gr::filter::pfb_arb_resampler_fff
  d_rpc_set
- gr::filter::pfb_arb_resampler_fff
  d_rpc_vars
- gr::filter::pfb_arb_resampler_fff
  d_setlock
- gr::filter::pfb_arb_resampler_fff
  d_symbol_alias
- gr::filter::pfb_arb_resampler_fff
  d_symbol_name
- gr::filter::pfb_arb_resampler_fff
  d_symbolic_id
- gr::filter::pfb_arb_resampler_fff
  d_system_port
- gr::filter::pfb_arb_resampler_fff
  d_unique_id
- gr::filter::pfb_arb_resampler_fff
  decimation_rate
- gr::filter::pfb_arb_resampler_fff
  declare_sample_delay
- gr::filter::pfb_arb_resampler_fff
  declare_sample_delay
- gr::filter::pfb_arb_resampler_fff
  delete_head_nowait
- gr::filter::pfb_arb_resampler_fff
  detail
- gr::filter::pfb_arb_resampler_fff
  dispatch_msg
- gr::filter::pfb_arb_resampler_fff
  empty_handled_p
- gr::filter::pfb_arb_resampler_fff
  empty_handled_p
- gr::filter::pfb_arb_resampler_fff
  empty_p
- gr::filter::pfb_arb_resampler_fff
  empty_p
- gr::filter::pfb_arb_resampler_fff
  enable_update_rate
- gr::filter::pfb_arb_resampler_fff
  erase_msg
- gr::filter::pfb_arb_resampler_fff
  expand_minmax_buffer
- gr::filter::pfb_arb_resampler_fff
  finished
- gr::filter::pfb_arb_resampler_fff
  fixed_rate
- gr::filter::pfb_arb_resampler_fff
  fixed_rate_ninput_to_noutput
- gr::filter::pfb_arb_resampler_fff
  fixed_rate_noutput_to_ninput
- gr::filter::pfb_arb_resampler_fff
  forecast
- gr::filter::pfb_arb_resampler_fff
  fractional_rate
- gr::filter::pfb_arb_resampler_fff
  general_work
- gr::filter::pfb_arb_resampler_fff
  get_iterator
- gr::filter::pfb_arb_resampler_fff
  get_msg_map
- gr::filter::pfb_arb_resampler_fff
  get_tags_in_range
- gr::filter::pfb_arb_resampler_fff
  get_tags_in_range
- gr::filter::pfb_arb_resampler_fff
  get_tags_in_window
- gr::filter::pfb_arb_resampler_fff
  get_tags_in_window
- gr::filter::pfb_arb_resampler_fff
  GREY
- gr::filter::pfb_arb_resampler_fff
  group_delay
- gr::filter::pfb_arb_resampler_fff
  has_msg_handler
- gr::filter::pfb_arb_resampler_fff
  has_msg_port
- gr::filter::pfb_arb_resampler_fff
  history
- gr::filter::pfb_arb_resampler_fff
  identifier
- gr::filter::pfb_arb_resampler_fff
  input_signature
- gr::filter::pfb_arb_resampler_fff
  insert_tail
- gr::filter::pfb_arb_resampler_fff
  interpolation_rate
- gr::filter::pfb_arb_resampler_fff
  is_pc_rpc_set
- gr::filter::pfb_arb_resampler_fff
  is_rpc_set
- gr::filter::pfb_arb_resampler_fff
  is_set_max_noutput_items
- gr::filter::pfb_arb_resampler_fff
  is_unaligned
- gr::filter::pfb_arb_resampler_fff
  log_level
- gr::filter::pfb_arb_resampler_fff
  make
- gr::filter::pfb_arb_resampler_fff
  max_noutput_items
- gr::filter::pfb_arb_resampler_fff
  max_output_buffer
- gr::filter::pfb_arb_resampler_fff
  message_port_is_hier
- gr::filter::pfb_arb_resampler_fff
  message_port_is_hier_in
- gr::filter::pfb_arb_resampler_fff
  message_port_is_hier_out
- gr::filter::pfb_arb_resampler_fff
  message_port_pub
- gr::filter::pfb_arb_resampler_fff
  message_port_register_in
- gr::filter::pfb_arb_resampler_fff
  message_port_register_out
- gr::filter::pfb_arb_resampler_fff
  message_port_sub
- gr::filter::pfb_arb_resampler_fff
  message_port_unsub
- gr::filter::pfb_arb_resampler_fff
  message_ports_in
- gr::filter::pfb_arb_resampler_fff
  message_ports_out
- gr::filter::pfb_arb_resampler_fff
  message_subscribers
- gr::filter::pfb_arb_resampler_fff
  min_noutput_items
- gr::filter::pfb_arb_resampler_fff
  min_output_buffer
- gr::filter::pfb_arb_resampler_fff
  mp_relative_rate
- gr::filter::pfb_arb_resampler_fff
  msg_accepter
- gr::filter::pfb_arb_resampler_fff
  msg_queue
- gr::filter::pfb_arb_resampler_fff
  name
- gr::filter::pfb_arb_resampler_fff
  nitems_read
- gr::filter::pfb_arb_resampler_fff
  nitems_written
- gr::filter::pfb_arb_resampler_fff
  nmsgs
- gr::filter::pfb_arb_resampler_fff
  no_pc_rpc
- gr::filter::pfb_arb_resampler_fff
  notify_msg_neighbors
- gr::filter::pfb_arb_resampler_fff
  output_multiple
- gr::filter::pfb_arb_resampler_fff
  output_multiple_set
- gr::filter::pfb_arb_resampler_fff
  output_signature
- gr::filter::pfb_arb_resampler_fff
  pc_input_buffers_full
- gr::filter::pfb_arb_resampler_fff
  pc_input_buffers_full
- gr::filter::pfb_arb_resampler_fff
  pc_input_buffers_full_avg
- gr::filter::pfb_arb_resampler_fff
  pc_input_buffers_full_avg
- gr::filter::pfb_arb_resampler_fff
  pc_input_buffers_full_var
- gr::filter::pfb_arb_resampler_fff
  pc_input_buffers_full_var
- gr::filter::pfb_arb_resampler_fff
  pc_noutput_items
- gr::filter::pfb_arb_resampler_fff
  pc_noutput_items_avg
- gr::filter::pfb_arb_resampler_fff
  pc_noutput_items_var
- gr::filter::pfb_arb_resampler_fff
  pc_nproduced
- gr::filter::pfb_arb_resampler_fff
  pc_nproduced_avg
- gr::filter::pfb_arb_resampler_fff
  pc_nproduced_var
- gr::filter::pfb_arb_resampler_fff
  pc_output_buffers_full
- gr::filter::pfb_arb_resampler_fff
  pc_output_buffers_full
- gr::filter::pfb_arb_resampler_fff
  pc_output_buffers_full_avg
- gr::filter::pfb_arb_resampler_fff
  pc_output_buffers_full_avg
- gr::filter::pfb_arb_resampler_fff
  pc_output_buffers_full_var
- gr::filter::pfb_arb_resampler_fff
  pc_output_buffers_full_var
- gr::filter::pfb_arb_resampler_fff
  pc_throughput_avg
- gr::filter::pfb_arb_resampler_fff
  pc_work_time
- gr::filter::pfb_arb_resampler_fff
  pc_work_time_avg
- gr::filter::pfb_arb_resampler_fff
  pc_work_time_total
- gr::filter::pfb_arb_resampler_fff
  pc_work_time_var
- gr::filter::pfb_arb_resampler_fff
  phase
- gr::filter::pfb_arb_resampler_fff
  phase_offset
- gr::filter::pfb_arb_resampler_fff
  post
- gr::filter::pfb_arb_resampler_fff
  print_taps
- gr::filter::pfb_arb_resampler_fff
  processor_affinity
- gr::filter::pfb_arb_resampler_fff
  produce
- gr::filter::pfb_arb_resampler_fff
  relative_rate
- gr::filter::pfb_arb_resampler_fff
  relative_rate_d
- gr::filter::pfb_arb_resampler_fff
  relative_rate_i
- gr::filter::pfb_arb_resampler_fff
  remove_item_tag
- gr::filter::pfb_arb_resampler_fff
  remove_item_tag
- gr::filter::pfb_arb_resampler_fff
  replace_buffer
- gr::filter::pfb_arb_resampler_fff
  reset_perf_counters
- gr::filter::pfb_arb_resampler_fff
  rpc_set
- gr::filter::pfb_arb_resampler_fff
  sample_delay
- gr::filter::pfb_arb_resampler_fff
  set_alignment
- gr::filter::pfb_arb_resampler_fff
  set_blkd_input_timer_value
- gr::filter::pfb_arb_resampler_fff
  set_block_alias
- gr::filter::pfb_arb_resampler_fff
  set_color
- gr::filter::pfb_arb_resampler_fff
  set_detail
- gr::filter::pfb_arb_resampler_fff
  set_fixed_rate
- gr::filter::pfb_arb_resampler_fff
  set_history
- gr::filter::pfb_arb_resampler_fff
  set_input_signature
- gr::filter::pfb_arb_resampler_fff
  set_inverse_relative_rate
- gr::filter::pfb_arb_resampler_fff
  set_is_unaligned
- gr::filter::pfb_arb_resampler_fff
  set_log_level
- gr::filter::pfb_arb_resampler_fff
  set_max_noutput_items
- gr::filter::pfb_arb_resampler_fff
  set_max_output_buffer
- gr::filter::pfb_arb_resampler_fff
  set_max_output_buffer
- gr::filter::pfb_arb_resampler_fff
  set_min_noutput_items
- gr::filter::pfb_arb_resampler_fff
  set_min_output_buffer
- gr::filter::pfb_arb_resampler_fff
  set_min_output_buffer
- gr::filter::pfb_arb_resampler_fff
  set_msg_handler
- gr::filter::pfb_arb_resampler_fff
  set_output_multiple
- gr::filter::pfb_arb_resampler_fff
  set_output_signature
- gr::filter::pfb_arb_resampler_fff
  set_phase
- gr::filter::pfb_arb_resampler_fff
  set_processor_affinity
- gr::filter::pfb_arb_resampler_fff
  set_rate
- gr::filter::pfb_arb_resampler_fff
  set_relative_rate
- gr::filter::pfb_arb_resampler_fff
  set_relative_rate
- gr::filter::pfb_arb_resampler_fff
  set_tag_propagation_policy
- gr::filter::pfb_arb_resampler_fff
  set_taps
- gr::filter::pfb_arb_resampler_fff
  set_thread_priority
- gr::filter::pfb_arb_resampler_fff
  set_unaligned
- gr::filter::pfb_arb_resampler_fff
  setup_pc_rpc
- gr::filter::pfb_arb_resampler_fff
  setup_rpc
- gr::filter::pfb_arb_resampler_fff
  shared_from_base
- gr::filter::pfb_arb_resampler_fff
  sptr
- gr::filter::pfb_arb_resampler_fff
  start
- gr::filter::pfb_arb_resampler_fff
  stop
- gr::filter::pfb_arb_resampler_fff
  symbol_name
- gr::filter::pfb_arb_resampler_fff
  symbolic_id
- gr::filter::pfb_arb_resampler_fff
  system_handler
- gr::filter::pfb_arb_resampler_fff
  tag_propagation_policy
- gr::filter::pfb_arb_resampler_fff
  tag_propagation_policy_t
- gr::filter::pfb_arb_resampler_fff
  taps
- gr::filter::pfb_arb_resampler_fff
  taps_per_filter
- gr::filter::pfb_arb_resampler_fff
  thread_priority
- gr::filter::pfb_arb_resampler_fff
  to_basic_block
- gr::filter::pfb_arb_resampler_fff
  TPP_ALL_TO_ALL
- gr::filter::pfb_arb_resampler_fff
  TPP_CUSTOM
- gr::filter::pfb_arb_resampler_fff
  TPP_DONT
- gr::filter::pfb_arb_resampler_fff
  TPP_ONE_TO_ONE
- gr::filter::pfb_arb_resampler_fff
  unaligned
- gr::filter::pfb_arb_resampler_fff
  unique_id
- gr::filter::pfb_arb_resampler_fff
  unset_max_noutput_items
- gr::filter::pfb_arb_resampler_fff
  unset_processor_affinity
- gr::filter::pfb_arb_resampler_fff
  update_rate
- gr::filter::pfb_arb_resampler_fff
  vcolor
- gr::filter::pfb_arb_resampler_fff
  WHITE
- gr::filter::pfb_arb_resampler_fff
  WORK_CALLED_PRODUCE
- gr::filter::pfb_arb_resampler_fff
  WORK_DONE
- gr::filter::pfb_arb_resampler_fff
  work_return_t
- gr::filter::pfb_arb_resampler_fff
  ~basic_block
- gr::filter::pfb_arb_resampler_fff
  ~block
- gr::filter::pfb_arb_resampler_fff
  ~msg_accepter