gnuradio.gr: Signal Sinks

gnuradio.gr.bin_statistics_f(unsigned int vlen, gr_msg_queue_sptr msgq, tune, size_t tune_delay, size_t dwell_delay) → gr_bin_statistics_f_sptr

control scanning and record frequency domain statistics

gnuradio.gr.check_counting_s(bool do_32bit = False) → gr_check_counting_s_sptr

sink that checks if its input stream consists of a counting sequence.

This sink is typically used to test the USRP “Counting Mode” or “Counting mode 32 bit”.

Parameters:do_32bit – expect an interleaved 32 bit counter in stead of 16 bit counter (default false)
gnuradio.gr.check_lfsr_32k_s() → gr_check_lfsr_32k_s_sptr

sink that checks if its input stream consists of a lfsr_32k sequence.

This sink is typically used along with gr_lfsr_32k_source_s to test the USRP using its digital loopback mode.

gr_check_lfsr_32k_s_sptr.nright(self) → long
gr_check_lfsr_32k_s_sptr.ntotal(self) → long
gr_check_lfsr_32k_s_sptr.runlength(self) → long
gnuradio.gr.framer_sink_1(gr_msg_queue_sptr target_queue) → gr_framer_sink_1_sptr

Given a stream of bits and access_code flags, assemble packets.

input: stream of bytes from gr_correlate_access_code_bb output: none. Pushes assembled packet into target queue.

The framer expects a fixed length header of 2 16-bit shorts containing the payload length, followed by the payload. If the 2 16-bit shorts are not identical, this packet is ignored. Better algs are welcome.

The input data consists of bytes that have two bits used. Bit 0, the LSB, contains the data bit. Bit 1 if set, indicates that the corresponding bit is the the first bit of the packet. That is, this bit is the first one after the access code.

gnuradio.gr.null_sink(size_t sizeof_stream_item) → gr_null_sink_sptr

Bit bucket.

gnuradio.gr.packet_sink(__dummy_0__ sync_vector, gr_msg_queue_sptr target_queue, int threshold = -1) → gr_packet_sink_sptr

process received bits looking for packet sync, header, and process bits into packet

gr_packet_sink_sptr.carrier_sensed(self) → bool

return true if we detect carrier

gnuradio.gr.probe_avg_mag_sqrd_c(double threshold_db, double alpha = 0.0001) → gr_probe_avg_mag_sqrd_c_sptr

compute avg magnitude squared.

input: gr_complex

Compute a running average of the magnitude squared of the the input. The level and indication as to whether the level exceeds threshold can be retrieved with the level and unmuted accessors.

gr_probe_avg_mag_sqrd_c_sptr.level(self) → double
gr_probe_avg_mag_sqrd_c_sptr.set_alpha(self, double alpha)
gr_probe_avg_mag_sqrd_c_sptr.set_threshold(self, double decibels)
gr_probe_avg_mag_sqrd_c_sptr.threshold(self) → double
gr_probe_avg_mag_sqrd_c_sptr.unmuted(self) → bool
gnuradio.gr.probe_avg_mag_sqrd_cf(double threshold_db, double alpha = 0.0001) → gr_probe_avg_mag_sqrd_cf_sptr

compute avg magnitude squared.

input: gr_complex output: gr_float

Compute a running average of the magnitude squared of the the input. The level and indication as to whether the level exceeds threshold can be retrieved with the level and unmuted accessors.

gr_probe_avg_mag_sqrd_cf_sptr.level(self) → double
gr_probe_avg_mag_sqrd_cf_sptr.set_alpha(self, double alpha)
gr_probe_avg_mag_sqrd_cf_sptr.set_threshold(self, double decibels)
gr_probe_avg_mag_sqrd_cf_sptr.threshold(self) → double
gr_probe_avg_mag_sqrd_cf_sptr.unmuted(self) → bool
gnuradio.gr.probe_avg_mag_sqrd_f(double threshold_db, double alpha = 0.0001) → gr_probe_avg_mag_sqrd_f_sptr

compute avg magnitude squared.

input: float

Compute a running average of the magnitude squared of the the input. The level and indication as to whether the level exceeds threshold can be retrieved with the level and unmuted accessors.

gr_probe_avg_mag_sqrd_f_sptr.level(self) → double
gr_probe_avg_mag_sqrd_f_sptr.set_alpha(self, double alpha)
gr_probe_avg_mag_sqrd_f_sptr.set_threshold(self, double decibels)
gr_probe_avg_mag_sqrd_f_sptr.threshold(self) → double
gr_probe_avg_mag_sqrd_f_sptr.unmuted(self) → bool
gnuradio.gr.probe_signal_f() → gr_probe_signal_f_sptr

Sink that allows a sample to be grabbed from Python.

gr_probe_signal_f_sptr.level(self) → float
gnuradio.gr.vector_sink_b(int vlen = 1) → gr_vector_sink_b_sptr

unsigned char sink that writes to a vector

gr_vector_sink_b_sptr.clear(self)
gr_vector_sink_b_sptr.data(self) → __dummy_0__
gr_vector_sink_b_sptr.reset(self)
gnuradio.gr.vector_sink_c(int vlen = 1) → gr_vector_sink_c_sptr

gr_complex sink that writes to a vector

gr_vector_sink_c_sptr.clear(self)
gr_vector_sink_c_sptr.data(self) → std::vector<(gr_complex,std::allocator<(gr_complex)>)>
gr_vector_sink_c_sptr.reset(self)
gnuradio.gr.vector_sink_f(int vlen = 1) → gr_vector_sink_f_sptr

float sink that writes to a vector

gr_vector_sink_f_sptr.clear(self)
gr_vector_sink_f_sptr.data(self) → __dummy_4__
gr_vector_sink_f_sptr.reset(self)
gnuradio.gr.vector_sink_i(int vlen = 1) → gr_vector_sink_i_sptr

int sink that writes to a vector

gr_vector_sink_i_sptr.clear(self)
gr_vector_sink_i_sptr.data(self) → __dummy_3__
gr_vector_sink_i_sptr.reset(self)
gnuradio.gr.vector_sink_s(int vlen = 1) → gr_vector_sink_s_sptr

short sink that writes to a vector

gr_vector_sink_s_sptr.clear(self)
gr_vector_sink_s_sptr.data(self) → __dummy_2__
gr_vector_sink_s_sptr.reset(self)
gnuradio.gr.file_descriptor_sink(size_t itemsize, int fd) → gr_file_descriptor_sink_sptr

Write stream to file descriptor.

gnuradio.gr.file_sink(size_t itemsize, char filename) → gr_file_sink_sptr

Write stream to file.

gr_file_sink_sptr.close(self)

Close current output file.

Closes current output file and ignores any output until open is called to connect to another file.

gr_file_sink_sptr.do_update(self)

if we’ve had an update, do it now.

gr_file_sink_sptr.open(self, char filename) → bool

Open filename and begin output to it.

gr_file_sink_sptr.set_unbuffered(self, bool unbuffered)

turn on unbuffered writes for slower outputs

gnuradio.gr.histo_sink_f(gr_msg_queue_sptr msgq) → gr_histo_sink_f_sptr

Histogram module.

gr_histo_sink_f_sptr.get_frame_size(self) → unsigned int
gr_histo_sink_f_sptr.get_num_bins(self) → unsigned int
gr_histo_sink_f_sptr.set_frame_size(self, unsigned int frame_size)
gr_histo_sink_f_sptr.set_num_bins(self, unsigned int num_bins)
gnuradio.gr.message_sink(size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block) → gr_message_sink_sptr

Gather received items into messages and insert into msgq.

gnuradio.gr.oscope_sink_f(double sample_rate, gr_msg_queue_sptr msgq) → gr_oscope_sink_f_sptr

Building block for python oscilloscope module.

Accepts multiple float streams.

gr_oscope_sink_f_sptr.get_decimation_count(self) → int
gr_oscope_sink_f_sptr.get_samples_per_output_record(self) → int
gr_oscope_sink_f_sptr.get_trigger_channel(self) → int
gr_oscope_sink_f_sptr.get_trigger_level(self) → double
gr_oscope_sink_f_sptr.get_trigger_mode(self) → gr_trigger_mode
gr_oscope_sink_f_sptr.get_trigger_slope(self) → gr_trigger_slope
gr_oscope_sink_f_sptr.num_channels(self) → int
gr_oscope_sink_f_sptr.sample_rate(self) → double
gr_oscope_sink_f_sptr.set_decimation_count(self, int decimation_count) → bool
gr_oscope_sink_f_sptr.set_sample_rate(self, double sample_rate) → bool
gr_oscope_sink_f_sptr.set_trigger_channel(self, int channel) → bool
gr_oscope_sink_f_sptr.set_trigger_level(self, double trigger_level) → bool
gr_oscope_sink_f_sptr.set_trigger_level_auto(self) → bool
gr_oscope_sink_f_sptr.set_trigger_mode(self, gr_trigger_mode mode) → bool
gr_oscope_sink_f_sptr.set_trigger_slope(self, gr_trigger_slope slope) → bool
gr_oscope_sink_f_sptr.set_update_rate(self, double update_rate) → bool
gr_oscope_sink_f_sptr.update_rate(self) → double
gnuradio.gr.udp_sink(size_t itemsize, char host, unsigned short port, int payload_size = 1472, bool eof = True) → gr_udp_sink_sptr

Write stream to an UDP socket.

Parameters:
  • itemsize – The size (in bytes) of the item datatype
  • host – The name or IP address of the receiving host; use NULL or None for no connection
  • port – Destination port to connect to on receiving host
  • payload_size – UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header))
  • eof – Send zero-length packet on disconnect
gr_udp_sink_sptr.connect(self, char host, unsigned short port)

Change the connection to a new destination.

Calls disconnect() to terminate any current connection first.

gr_udp_sink_sptr.disconnect(self)

Send zero-length packet (if eof is requested) then stop sending.

Zero-byte packets can be interpreted as EOF by gr_udp_source. Note that disconnect occurs automatically when the sink is destroyed, but not when its top_block stops.

gr_udp_sink_sptr.payload_size(self) → int

return the PAYLOAD_SIZE of the socket

gnuradio.gr.wavfile_sink(char filename, int n_channels, unsigned int sample_rate, int bits_per_sample = 16) → gr_wavfile_sink_sptr

Write stream to a Microsoft PCM (.wav) file.

Values must be floats within [-1;1]. Check gr_make_wavfile_sink() for extra info.

gr_wavfile_sink_sptr.close(self)

Closes the currently active file and completes the WAV header. Thread-safe.

gr_wavfile_sink_sptr.open(self, char filename) → bool

Opens a new file and writes a WAV header. Thread-safe.

gr_wavfile_sink_sptr.set_bits_per_sample(self, int bits_per_sample)

Set bits per sample. This will not affect the WAV file currently opened (see set_sample_rate()). If the value is neither 8 nor 16, the call is ignored and the current value is kept.

gr_wavfile_sink_sptr.set_sample_rate(self, unsigned int sample_rate)

Set the sample rate. This will not affect the WAV file currently opened. Any following open() calls will use this new sample rate.

Previous topic

gnuradio.gr: Modulation

Next topic

gnuradio.gr: Slicing and Dicing Streams

This Page