gnuradio.gr: Signal Sources

gnuradio.gr.glfsr_source_b(int degree, bool repeat = True, int mask = 0, int seed = 1) → gr_glfsr_source_b_sptr

Galois LFSR pseudo-random source.

gr_glfsr_source_b_sptr.mask(self) → int
gr_glfsr_source_b_sptr.period(self) → unsigned int
gnuradio.gr.glfsr_source_f(int degree, bool repeat = True, int mask = 0, int seed = 1) → gr_glfsr_source_f_sptr

Galois LFSR pseudo-random source generating float outputs -1.0 - 1.0.

gr_glfsr_source_f_sptr.mask(self) → int
gr_glfsr_source_f_sptr.period(self) → unsigned int
gnuradio.gr.lfsr_32k_source_s() → gr_lfsr_32k_source_s_sptr

LFSR pseudo-random source with period of 2^15 bits (2^11 shorts)

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

gnuradio.gr.null_source(size_t sizeof_stream_item) → gr_null_source_sptr

A source of zeros.

gnuradio.gr.noise_source_c(gr_noise_type_t type, float ampl, long seed = 0) → gr_noise_source_c_sptr

Random number source.

Generate random values from different distributions. Currently, only Gaussian and uniform are enabled.

Make a noise source.

Parameters:
  • type – the random distribution to use (see gr_noise_type.h)
  • ampl – a scaling factor for the output
  • seed – seed for random generators. Note that for uniform and Gaussian distributions, this should be a negative number.
gr_noise_source_c_sptr.amplitude(self) → float
gr_noise_source_c_sptr.set_amplitude(self, float ampl)
gr_noise_source_c_sptr.set_type(self, gr_noise_type_t type)
gr_noise_source_c_sptr.type(self) → gr_noise_type_t
gnuradio.gr.noise_source_f(gr_noise_type_t type, float ampl, long seed = 0) → gr_noise_source_f_sptr

Random number source.

Generate random values from different distributions. Currently, only Gaussian and uniform are enabled.

Make a noise source.

Parameters:
  • type – the random distribution to use (see gr_noise_type.h)
  • ampl – a scaling factor for the output
  • seed – seed for random generators. Note that for uniform and Gaussian distributions, this should be a negative number.
gr_noise_source_f_sptr.amplitude(self) → float
gr_noise_source_f_sptr.set_amplitude(self, float ampl)
gr_noise_source_f_sptr.set_type(self, gr_noise_type_t type)
gr_noise_source_f_sptr.type(self) → gr_noise_type_t
gnuradio.gr.noise_source_i(gr_noise_type_t type, float ampl, long seed = 0) → gr_noise_source_i_sptr

Random number source.

Generate random values from different distributions. Currently, only Gaussian and uniform are enabled.

Make a noise source.

Parameters:
  • type – the random distribution to use (see gr_noise_type.h)
  • ampl – a scaling factor for the output
  • seed – seed for random generators. Note that for uniform and Gaussian distributions, this should be a negative number.
gr_noise_source_i_sptr.amplitude(self) → float
gr_noise_source_i_sptr.set_amplitude(self, float ampl)
gr_noise_source_i_sptr.set_type(self, gr_noise_type_t type)
gr_noise_source_i_sptr.type(self) → gr_noise_type_t
gnuradio.gr.noise_source_s(gr_noise_type_t type, float ampl, long seed = 0) → gr_noise_source_s_sptr

Random number source.

Generate random values from different distributions. Currently, only Gaussian and uniform are enabled.

Make a noise source.

Parameters:
  • type – the random distribution to use (see gr_noise_type.h)
  • ampl – a scaling factor for the output
  • seed – seed for random generators. Note that for uniform and Gaussian distributions, this should be a negative number.
gr_noise_source_s_sptr.amplitude(self) → float
gr_noise_source_s_sptr.set_amplitude(self, float ampl)
gr_noise_source_s_sptr.set_type(self, gr_noise_type_t type)
gr_noise_source_s_sptr.type(self) → gr_noise_type_t
gnuradio.gr.sig_source_c(double sampling_freq, gr_waveform_t waveform, double wave_freq, double ampl, gr_complex offset = 0) → gr_sig_source_c_sptr

signal generator with gr_complex output.

gr_sig_source_c_sptr.amplitude(self) → double
gr_sig_source_c_sptr.frequency(self) → double
gr_sig_source_c_sptr.offset(self) → gr_complex
gr_sig_source_c_sptr.sampling_freq(self) → double
gr_sig_source_c_sptr.set_amplitude(self, double ampl)
gr_sig_source_c_sptr.set_frequency(self, double frequency)
gr_sig_source_c_sptr.set_offset(self, gr_complex offset)
gr_sig_source_c_sptr.set_sampling_freq(self, double sampling_freq)
gr_sig_source_c_sptr.set_waveform(self, gr_waveform_t waveform)
gr_sig_source_c_sptr.waveform(self) → gr_waveform_t
gnuradio.gr.sig_source_f(double sampling_freq, gr_waveform_t waveform, double wave_freq, double ampl, float offset = 0) → gr_sig_source_f_sptr

signal generator with float output.

gr_sig_source_f_sptr.amplitude(self) → double
gr_sig_source_f_sptr.frequency(self) → double
gr_sig_source_f_sptr.offset(self) → float
gr_sig_source_f_sptr.sampling_freq(self) → double
gr_sig_source_f_sptr.set_amplitude(self, double ampl)
gr_sig_source_f_sptr.set_frequency(self, double frequency)
gr_sig_source_f_sptr.set_offset(self, float offset)
gr_sig_source_f_sptr.set_sampling_freq(self, double sampling_freq)
gr_sig_source_f_sptr.set_waveform(self, gr_waveform_t waveform)
gr_sig_source_f_sptr.waveform(self) → gr_waveform_t
gnuradio.gr.sig_source_i(double sampling_freq, gr_waveform_t waveform, double wave_freq, double ampl, int offset = 0) → gr_sig_source_i_sptr

signal generator with int output.

gr_sig_source_i_sptr.amplitude(self) → double
gr_sig_source_i_sptr.frequency(self) → double
gr_sig_source_i_sptr.offset(self) → int
gr_sig_source_i_sptr.sampling_freq(self) → double
gr_sig_source_i_sptr.set_amplitude(self, double ampl)
gr_sig_source_i_sptr.set_frequency(self, double frequency)
gr_sig_source_i_sptr.set_offset(self, int offset)
gr_sig_source_i_sptr.set_sampling_freq(self, double sampling_freq)
gr_sig_source_i_sptr.set_waveform(self, gr_waveform_t waveform)
gr_sig_source_i_sptr.waveform(self) → gr_waveform_t
gnuradio.gr.sig_source_s(double sampling_freq, gr_waveform_t waveform, double wave_freq, double ampl, short offset = 0) → gr_sig_source_s_sptr

signal generator with short output.

gr_sig_source_s_sptr.amplitude(self) → double
gr_sig_source_s_sptr.frequency(self) → double
gr_sig_source_s_sptr.offset(self) → short
gr_sig_source_s_sptr.sampling_freq(self) → double
gr_sig_source_s_sptr.set_amplitude(self, double ampl)
gr_sig_source_s_sptr.set_frequency(self, double frequency)
gr_sig_source_s_sptr.set_offset(self, short offset)
gr_sig_source_s_sptr.set_sampling_freq(self, double sampling_freq)
gr_sig_source_s_sptr.set_waveform(self, gr_waveform_t waveform)
gr_sig_source_s_sptr.waveform(self) → gr_waveform_t
gnuradio.gr.vector_source_b(__dummy_0__ data, bool repeat = False, int vlen = 1) → gr_vector_source_b_sptr

source of unsigned char’s that gets its data from a vector

gr_vector_source_b_sptr.rewind(self)
gnuradio.gr.vector_source_c(std::vector<(gr_complex, std::allocator<(gr_complex)>)> data, bool repeat = False, int vlen = 1) → gr_vector_source_c_sptr

source of gr_complex’s that gets its data from a vector

gr_vector_source_c_sptr.rewind(self)
gnuradio.gr.vector_source_f(__dummy_4__ data, bool repeat = False, int vlen = 1) → gr_vector_source_f_sptr

source of float’s that gets its data from a vector

gr_vector_source_f_sptr.rewind(self)
gnuradio.gr.vector_source_i(__dummy_3__ data, bool repeat = False, int vlen = 1) → gr_vector_source_i_sptr

source of int’s that gets its data from a vector

gr_vector_source_i_sptr.rewind(self)
gnuradio.gr.vector_source_s(__dummy_2__ data, bool repeat = False, int vlen = 1) → gr_vector_source_s_sptr

source of short’s that gets its data from a vector

gr_vector_source_s_sptr.rewind(self)
gnuradio.gr.file_descriptor_source(size_t itemsize, int fd, bool repeat = False) → gr_file_descriptor_source_sptr

Read stream from file descriptor.

gnuradio.gr.file_source(size_t itemsize, char filename, bool repeat = False) → gr_file_source_sptr

Read stream from file.

gr_file_source_sptr.seek(self, long seek_point, int whence) → bool

seek file to relative to

gnuradio.gr.message_source(size_t itemsize, int msgq_limit = 0) → gr_message_source_sptr

message_source(size_t itemsize, gr_msg_queue_sptr msgq) -> gr_message_source_sptr

Turn received messages into a stream.

gr_message_source_sptr.msgq(self) → gr_msg_queue_sptr
gnuradio.gr.udp_source(size_t itemsize, char host, unsigned short port, int payload_size = 1472, bool eof = True, bool wait = True) → gr_udp_source_sptr

Read stream from an UDP socket.

Parameters:
  • itemsize – The size (in bytes) of the item datatype
  • host – The name or IP address of the receiving host; can be NULL, None, or “0.0.0.0” to allow reading from any interface on the host
  • port – The port number on which to receive data; use 0 to have the system assign an unused port number
  • payload_size – UDP payload size by default set to 1472 = (1500 MTU - (8 byte UDP header) - (20 byte IP header))
  • eof – Interpret zero-length packet as EOF (default: true)
  • wait – Wait for data if not immediately available (default: true)
gr_udp_source_sptr.get_port(self) → int

return the port number of the socket

gr_udp_source_sptr.payload_size(self) → int

return the PAYLOAD_SIZE of the socket

gnuradio.gr.wavfile_source(char filename, bool repeat = False) → gr_wavfile_source_sptr

Read stream from a Microsoft PCM (.wav) file, output floats.

Unless otherwise called, values are within [-1;1]. Check gr_make_wavfile_source() for extra info.

gr_wavfile_source_sptr.bits_per_sample(self) → int

Return the number of bits per sample as specified in the wav file header. Only 8 or 16 bit are supported here.

gr_wavfile_source_sptr.channels(self) → int

Return the number of channels in the wav file as specified in the wav file header. This is also the max number of outputs you can have.

gr_wavfile_source_sptr.sample_rate(self) → unsigned int

Read the sample rate as specified in the wav file header.

Previous topic

gnuradio.gr: Slicing and Dicing Streams

Next topic

gnuradio.gr: Synchronization

This Page