gnuradio.gr: Type Conversions

gnuradio.gr.bytes_to_syms() → gr_bytes_to_syms_sptr

Convert stream of bytes to stream of +/- 1 symbols

input: stream of bytes; output: stream of float.

This block is deprecated.

The combination of gr_packed_to_unpacked_bb followed by gr_chunks_to_symbols_bf or gr_chunks_to_symbols_bc handles the general case of mapping from a stream of bytes into arbitrary float or complex symbols.

gnuradio.gr.char_to_float(size_t vlen = 1, float scale = 1) → gr_char_to_float_sptr

Convert stream of chars to a stream of float.

Parameters:
  • vlen – vector length of data streams.
  • scale – a scalar divider to change the output signal scale.
gr_char_to_float_sptr.scale(self) → float

Get the scalar divider value.

gr_char_to_float_sptr.set_scale(self, float scale)

Set the scalar divider value.

gnuradio.gr.complex_to_interleaved_short() → gr_complex_to_interleaved_short_sptr

Convert stream of complex to a stream of interleaved shorts.

gnuradio.gr.complex_to_float(unsigned int vlen = 1) → gr_complex_to_float_sptr

convert a stream of gr_complex to 1 or 2 streams of float

Parameters:vlen – vector len (default 1)
gnuradio.gr.complex_to_real(unsigned int vlen = 1) → gr_complex_to_real_sptr

complex in, real out (float)

Parameters:vlen – vector len (default 1)
gnuradio.gr.complex_to_imag(unsigned int vlen = 1) → gr_complex_to_imag_sptr

complex in, imaginary out (float)

Parameters:vlen – vector len (default 1)
gnuradio.gr.complex_to_mag(unsigned int vlen = 1) → gr_complex_to_mag_sptr

complex in, magnitude out (float)

Parameters:vlen – vector len (default 1)
gnuradio.gr.complex_to_mag_squared(unsigned int vlen = 1) → gr_complex_to_mag_squared_sptr

complex in, magnitude squared out (float)

Parameters:vlen – vector len (default 1)
gnuradio.gr.complex_to_arg(unsigned int vlen = 1) → gr_complex_to_arg_sptr

complex in, angle out (float)

Parameters:vlen – vector len (default 1)
gnuradio.gr.float_to_char(size_t vlen = 1, float scale = 1) → gr_float_to_char_sptr

Convert stream of float to a stream of char.

Parameters:
  • vlen – vector length of data streams.
  • scale – a scalar multiplier to change the output signal scale.
gr_float_to_char_sptr.scale(self) → float

Get the scalar multiplier value.

gr_float_to_char_sptr.set_scale(self, float scale)

Set the scalar multiplier value.

gnuradio.gr.float_to_complex(size_t vlen = 1) → gr_float_to_complex_sptr

Convert 1 or 2 streams of float to a stream of gr_complex.

gnuradio.gr.float_to_short(size_t vlen = 1, float scale = 1) → gr_float_to_short_sptr

Convert stream of float to a stream of short.

Parameters:
  • vlen – vector length of data streams.
  • scale – a scalar multiplier to change the output signal scale.
gr_float_to_short_sptr.scale(self) → float

Get the scalar multiplier value.

gr_float_to_short_sptr.set_scale(self, float scale)

Set the scalar multiplier value.

gnuradio.gr.float_to_uchar() → gr_float_to_uchar_sptr

Convert stream of float to a stream of unsigned char.

gnuradio.gr.interleaved_short_to_complex() → gr_interleaved_short_to_complex_sptr

Convert stream of interleaved shorts to a stream of complex.

gnuradio.gr.short_to_float(size_t vlen = 1, float scale = 1) → gr_short_to_float_sptr

Convert stream of short to a stream of float.

Parameters:
  • vlen – vector length of data streams.
  • scale – a scalar divider to change the output signal scale.
gr_short_to_float_sptr.scale(self) → float

Get the scalar divider value.

gr_short_to_float_sptr.set_scale(self, float scale)

Set the scalar divider value.

gnuradio.gr.uchar_to_float() → gr_uchar_to_float_sptr

Convert stream of unsigned chars to a stream of float.

gnuradio.gr.unpack_k_bits_bb(int k) → gr_unpack_k_bits_bb_sptr

Converts a byte with k relevent bits to k output bytes with 1 bit in the LSB.

gnuradio.gr.chunks_to_symbols_bc(std::vector<(gr_complex, std::allocator<(gr_complex)>)> symbol_table, int D = 1) → gr_chunks_to_symbols_bc_sptr

Map a stream of symbol indexes (unpacked bytes or shorts) to stream of float or complex onstellation points.in dimensions ( = 1 by default)

input: stream of unsigned char; output: stream of gr_complex.

out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_XY handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gr_chunks_to_symbols_bc_sptr.D(self) → int
gr_chunks_to_symbols_bc_sptr.symbol_table(self) → std::vector<(gr_complex,std::allocator<(gr_complex)>)>
gnuradio.gr.chunks_to_symbols_bf(__dummy_4__ symbol_table, int D = 1) → gr_chunks_to_symbols_bf_sptr

Map a stream of symbol indexes (unpacked bytes or shorts) to stream of float or complex onstellation points.in dimensions ( = 1 by default)

input: stream of unsigned char; output: stream of float.

out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_XY handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gr_chunks_to_symbols_bf_sptr.D(self) → int
gr_chunks_to_symbols_bf_sptr.symbol_table(self) → __dummy_4__
gnuradio.gr.chunks_to_symbols_ic(std::vector<(gr_complex, std::allocator<(gr_complex)>)> symbol_table, int D = 1) → gr_chunks_to_symbols_ic_sptr

Map a stream of symbol indexes (unpacked bytes or shorts) to stream of float or complex onstellation points.in dimensions ( = 1 by default)

input: stream of int; output: stream of gr_complex.

out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_XY handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gr_chunks_to_symbols_ic_sptr.D(self) → int
gr_chunks_to_symbols_ic_sptr.symbol_table(self) → std::vector<(gr_complex,std::allocator<(gr_complex)>)>
gnuradio.gr.chunks_to_symbols_if(__dummy_4__ symbol_table, int D = 1) → gr_chunks_to_symbols_if_sptr

Map a stream of symbol indexes (unpacked bytes or shorts) to stream of float or complex onstellation points.in dimensions ( = 1 by default)

input: stream of int; output: stream of float.

out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_XY handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gr_chunks_to_symbols_if_sptr.D(self) → int
gr_chunks_to_symbols_if_sptr.symbol_table(self) → __dummy_4__
gnuradio.gr.chunks_to_symbols_sc(std::vector<(gr_complex, std::allocator<(gr_complex)>)> symbol_table, int D = 1) → gr_chunks_to_symbols_sc_sptr

Map a stream of symbol indexes (unpacked bytes or shorts) to stream of float or complex onstellation points.in dimensions ( = 1 by default)

input: stream of short; output: stream of gr_complex.

out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_XY handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gr_chunks_to_symbols_sc_sptr.D(self) → int
gr_chunks_to_symbols_sc_sptr.symbol_table(self) → std::vector<(gr_complex,std::allocator<(gr_complex)>)>
gnuradio.gr.chunks_to_symbols_sf(__dummy_4__ symbol_table, int D = 1) → gr_chunks_to_symbols_sf_sptr

Map a stream of symbol indexes (unpacked bytes or shorts) to stream of float or complex onstellation points.in dimensions ( = 1 by default)

input: stream of short; output: stream of float.

out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_XY handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gr_chunks_to_symbols_sf_sptr.D(self) → int
gr_chunks_to_symbols_sf_sptr.symbol_table(self) → __dummy_4__
gnuradio.gr.packed_to_unpacked_bb(unsigned int bits_per_chunk, gr_endianness_t endianness) → gr_packed_to_unpacked_bb_sptr

Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts.

input: stream of unsigned char; output: stream of unsigned char.

This is the inverse of gr_unpacked_to_packed_XX.

The bits in the bytes or shorts input stream are grouped into chunks of bits and each resulting chunk is written right- justified to the output stream of bytes or shorts. All b or 16 bits of the each input bytes or short are processed. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr_packed_to_unpacked_XX_ followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gnuradio.gr.packed_to_unpacked_ii(unsigned int bits_per_chunk, gr_endianness_t endianness) → gr_packed_to_unpacked_ii_sptr

Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts.

input: stream of int; output: stream of int.

This is the inverse of gr_unpacked_to_packed_XX.

The bits in the bytes or shorts input stream are grouped into chunks of bits and each resulting chunk is written right- justified to the output stream of bytes or shorts. All b or 16 bits of the each input bytes or short are processed. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr_packed_to_unpacked_XX_ followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gnuradio.gr.packed_to_unpacked_ss(unsigned int bits_per_chunk, gr_endianness_t endianness) → gr_packed_to_unpacked_ss_sptr

Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts.

input: stream of short; output: stream of short.

This is the inverse of gr_unpacked_to_packed_XX.

The bits in the bytes or shorts input stream are grouped into chunks of bits and each resulting chunk is written right- justified to the output stream of bytes or shorts. All b or 16 bits of the each input bytes or short are processed. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr_packed_to_unpacked_XX_ followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gnuradio.gr.unpacked_to_packed_bb(unsigned int bits_per_chunk, gr_endianness_t endianness) → gr_unpacked_to_packed_bb_sptr

Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts.

input: stream of unsigned char; output: stream of unsigned char.

This is the inverse of gr_packed_to_unpacked_XX.

The low bits are extracted from each input byte or short. These bits are then packed densely into the output bytes or shorts, such that all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gnuradio.gr.unpacked_to_packed_ii(unsigned int bits_per_chunk, gr_endianness_t endianness) → gr_unpacked_to_packed_ii_sptr

Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts.

input: stream of int; output: stream of int.

This is the inverse of gr_packed_to_unpacked_XX.

The low bits are extracted from each input byte or short. These bits are then packed densely into the output bytes or shorts, such that all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

gnuradio.gr.unpacked_to_packed_ss(unsigned int bits_per_chunk, gr_endianness_t endianness) → gr_unpacked_to_packed_ss_sptr

Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts.

input: stream of short; output: stream of short.

This is the inverse of gr_packed_to_unpacked_XX.

The low bits are extracted from each input byte or short. These bits are then packed densely into the output bytes or shorts, such that all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr_packed_to_unpacked_XX followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

Previous topic

gnuradio.gr: Information Coding and Decoding

Next topic

gnuradio.gr: Demodulation

This Page