Source that streams unsigned char items based on the input vector.
This block produces a stream of samples based on an input vector. In C++, this is a std::vector<unsigned char>, and in Python, this is either a list or tuple. The data can repeat infinitely until the flowgraph is terminated by some other event or, the default, run the data once and stop.
The vector source can also produce stream tags with the data. Pass in a vector of gr::tag_t objects and they will be emitted based on the specified offset of the tag.
GNU Radio provides a utility Python module in gr.tag_utils to convert between tags and Python objects: gr.tag_utils.python_to_tag.
We can create tags as Python lists (or tuples) using the list structure [int offset, pmt key, pmt value, pmt srcid]. It is important to define the list/tuple with the values in the correct order and with the correct data type. A python dictionary can also be used using the keys: “offset”, “key”, “value”, and “srcid” with the same data types as for the lists.
When given a list of tags, the vector source will emit the tags repeatedly by updating the offset relative to the vector stream length. That is, if the vector has 500 items and a tag has an offset of 0, that tag will be placed on item 0, 500, 1000, 1500, etc.
Constructor Specific Documentation:
Parameters: |
|
---|
declare_sample_delay(vector_source_b_sptr self, unsigned int delay)
pc_input_buffers_full_avg(vector_source_b_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(vector_source_b_sptr self) -> pmt_vector_float
Source that streams gr_complex items based on the input vector.
This block produces a stream of samples based on an input vector. In C++, this is a std::vector<gr_complex>, and in Python, this is either a list or tuple. The data can repeat infinitely until the flowgraph is terminated by some other event or, the default, run the data once and stop.
The vector source can also produce stream tags with the data. Pass in a vector of gr::tag_t objects and they will be emitted based on the specified offset of the tag.
GNU Radio provides a utility Python module in gr.tag_utils to convert between tags and Python objects: gr.tag_utils.python_to_tag.
We can create tags as Python lists (or tuples) using the list structure [int offset, pmt key, pmt value, pmt srcid]. It is important to define the list/tuple with the values in the correct order and with the correct data type. A python dictionary can also be used using the keys: “offset”, “key”, “value”, and “srcid” with the same data types as for the lists.
When given a list of tags, the vector source will emit the tags repeatedly by updating the offset relative to the vector stream length. That is, if the vector has 500 items and a tag has an offset of 0, that tag will be placed on item 0, 500, 1000, 1500, etc.
Constructor Specific Documentation:
Parameters: |
|
---|
declare_sample_delay(vector_source_c_sptr self, unsigned int delay)
pc_input_buffers_full_avg(vector_source_c_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(vector_source_c_sptr self) -> pmt_vector_float
Source that streams float items based on the input vector.
This block produces a stream of samples based on an input vector. In C++, this is a std::vector<float>, and in Python, this is either a list or tuple. The data can repeat infinitely until the flowgraph is terminated by some other event or, the default, run the data once and stop.
The vector source can also produce stream tags with the data. Pass in a vector of gr::tag_t objects and they will be emitted based on the specified offset of the tag.
GNU Radio provides a utility Python module in gr.tag_utils to convert between tags and Python objects: gr.tag_utils.python_to_tag.
We can create tags as Python lists (or tuples) using the list structure [int offset, pmt key, pmt value, pmt srcid]. It is important to define the list/tuple with the values in the correct order and with the correct data type. A python dictionary can also be used using the keys: “offset”, “key”, “value”, and “srcid” with the same data types as for the lists.
When given a list of tags, the vector source will emit the tags repeatedly by updating the offset relative to the vector stream length. That is, if the vector has 500 items and a tag has an offset of 0, that tag will be placed on item 0, 500, 1000, 1500, etc.
Constructor Specific Documentation:
Parameters: |
|
---|
declare_sample_delay(vector_source_f_sptr self, unsigned int delay)
pc_input_buffers_full_avg(vector_source_f_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(vector_source_f_sptr self) -> pmt_vector_float
Source that streams int items based on the input vector.
This block produces a stream of samples based on an input vector. In C++, this is a std::vector<int>, and in Python, this is either a list or tuple. The data can repeat infinitely until the flowgraph is terminated by some other event or, the default, run the data once and stop.
The vector source can also produce stream tags with the data. Pass in a vector of gr::tag_t objects and they will be emitted based on the specified offset of the tag.
GNU Radio provides a utility Python module in gr.tag_utils to convert between tags and Python objects: gr.tag_utils.python_to_tag.
We can create tags as Python lists (or tuples) using the list structure [int offset, pmt key, pmt value, pmt srcid]. It is important to define the list/tuple with the values in the correct order and with the correct data type. A python dictionary can also be used using the keys: “offset”, “key”, “value”, and “srcid” with the same data types as for the lists.
When given a list of tags, the vector source will emit the tags repeatedly by updating the offset relative to the vector stream length. That is, if the vector has 500 items and a tag has an offset of 0, that tag will be placed on item 0, 500, 1000, 1500, etc.
Constructor Specific Documentation:
Parameters: |
|
---|
declare_sample_delay(vector_source_i_sptr self, unsigned int delay)
pc_input_buffers_full_avg(vector_source_i_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(vector_source_i_sptr self) -> pmt_vector_float
Source that streams short items based on the input vector.
This block produces a stream of samples based on an input vector. In C++, this is a std::vector<short>, and in Python, this is either a list or tuple. The data can repeat infinitely until the flowgraph is terminated by some other event or, the default, run the data once and stop.
The vector source can also produce stream tags with the data. Pass in a vector of gr::tag_t objects and they will be emitted based on the specified offset of the tag.
GNU Radio provides a utility Python module in gr.tag_utils to convert between tags and Python objects: gr.tag_utils.python_to_tag.
We can create tags as Python lists (or tuples) using the list structure [int offset, pmt key, pmt value, pmt srcid]. It is important to define the list/tuple with the values in the correct order and with the correct data type. A python dictionary can also be used using the keys: “offset”, “key”, “value”, and “srcid” with the same data types as for the lists.
When given a list of tags, the vector source will emit the tags repeatedly by updating the offset relative to the vector stream length. That is, if the vector has 500 items and a tag has an offset of 0, that tag will be placed on item 0, 500, 1000, 1500, etc.
Constructor Specific Documentation:
Parameters: |
|
---|
declare_sample_delay(vector_source_s_sptr self, unsigned int delay)
pc_input_buffers_full_avg(vector_source_s_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(vector_source_s_sptr self) -> pmt_vector_float
control scanning and record frequency domain statistics
Constructor Specific Documentation:
Build a bin statistics block. See qa_bin_statistics.py and gr-uhd/examples/python/usrp_spectrum_sense.py for examples of its use, specifically how to use the callback function.
Parameters: |
|
---|
declare_sample_delay(bin_statistics_f_sptr self, unsigned int delay)
pc_input_buffers_full_avg(bin_statistics_f_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(bin_statistics_f_sptr self) -> pmt_vector_float
sink that checks if its input stream consists of a lfsr_32k sequence.
This sink is typically used along with gr::blocks::lfsr_32k_source_s to test the USRP using its digital loopback mode.
Constructor Specific Documentation:
declare_sample_delay(check_lfsr_32k_s_sptr self, unsigned int delay)
pc_input_buffers_full_avg(check_lfsr_32k_s_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(check_lfsr_32k_s_sptr self) -> pmt_vector_float
output[i] = input[i]
When enabled (default), this block copies its input to its output. When disabled, this block drops its input on the floor.
Message Ports:
Constructor Specific Documentation:
Parameters: | itemsize – |
---|
declare_sample_delay(copy_sptr self, unsigned int delay)
pc_input_buffers_full_avg(copy_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(copy_sptr self) -> pmt_vector_float
delay the input by a certain number of samples
Positive delays insert zero items at the beginning of the stream. Negative delays discard items from the stream.
You cannot initialize this block with a negative delay, however. That leads to a causality issue with the buffers when they are initialized. If you need to negetively delay one path, then put the positive delay on the other path instead.
Constructor Specific Documentation:
Make a delay block.
Parameters: |
|
---|
declare_sample_delay(delay_sptr self, unsigned int delay)
pc_input_buffers_full_avg(delay_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(delay_sptr self) -> pmt_vector_float
Reset the delay.
copies the first N items to the output then signals done
Useful for building test cases
Constructor Specific Documentation:
Parameters: |
|
---|
declare_sample_delay(head_sptr self, unsigned int delay)
pc_input_buffers_full_avg(head_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(head_sptr self) -> pmt_vector_float
LFSR pseudo-random source with period of 2^15 bits (2^11 shorts)
This source is typically used along with gr::blocks::check_lfsr_32k_s to test the USRP using its digital loopback mode.
Constructor Specific Documentation:
Make a LFSR 32k source block.
declare_sample_delay(lfsr_32k_source_s_sptr self, unsigned int delay)
pc_input_buffers_full_avg(lfsr_32k_source_s_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(lfsr_32k_source_s_sptr self) -> pmt_vector_float
Does nothing. Used for testing only.
Constructor Specific Documentation:
Build a nop block.
Parameters: | sizeof_stream_item – size of the stream items in bytes. |
---|
declare_sample_delay(nop_sptr self, unsigned int delay)
pc_input_buffers_full_avg(nop_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(nop_sptr self) -> pmt_vector_float
Bit bucket. Use as a termination point when a sink is required and we don’t want to do anything real.
Constructor Specific Documentation:
Build a null sink block.
Parameters: | sizeof_stream_item – size of the stream items in bytes. |
---|
declare_sample_delay(null_sink_sptr self, unsigned int delay)
pc_input_buffers_full_avg(null_sink_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(null_sink_sptr self) -> pmt_vector_float
A source of zeros used mainly for testing.
Constructor Specific Documentation:
Build a null source block.
Parameters: | sizeof_stream_item – size of the stream items in bytes. |
---|
declare_sample_delay(null_source_sptr self, unsigned int delay)
pc_input_buffers_full_avg(null_source_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(null_source_sptr self) -> pmt_vector_float
skips the first N items, from then on copies items to the output
Useful for building test cases and sources which have metadata or junk at the start
Constructor Specific Documentation:
Parameters: |
|
---|
declare_sample_delay(skiphead_sptr self, unsigned int delay)
pc_input_buffers_full_avg(skiphead_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(skiphead_sptr self) -> pmt_vector_float
throttle flow of samples such that the average rate does not exceed samples_per_sec.
input: one stream of itemsize; output: one stream of itemsize
N.B. this should only be used in GUI apps where there is no other rate limiting block. It is not intended nor effective at precisely controlling the rate of samples. That should be controlled by a source or sink tied to sample clock. E.g., a USRP or audio card.
Constructor Specific Documentation:
Parameters: |
|
---|
declare_sample_delay(throttle_sptr self, unsigned int delay)
pc_input_buffers_full_avg(throttle_sptr self) -> pmt_vector_float
pc_output_buffers_full_avg(throttle_sptr self) -> pmt_vector_float
Get the sample rate in samples per second.
Sets the sample rate in samples per second.