packed_to_unpacked 块在 GNU RADIO 中有什么作用?

What do packed_to_unpacked blocks do in GNU RADIO?

有人可以给我一个这个块做什么的例子(例如输入->输出)吗?解释也表示赞赏。

来自the official documentation(如果您的 GNU Radio 构建完好无损,您还可以从 GRC 中的块属性的文档选项卡访问):

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::blocks::unpacked_to_packed_XX.

The bits in the bytes or shorts input stream are grouped into chunks of bits_per_chunk 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::blocks::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.

所以,你得到一个由 8 位组成的字节,然后你生成字节,每个字节都根据输入设置 bits_per_chunk 位。示例(设 bits_per_chunk=1,MSB 在前):

in 0b11110000
out 0b00000001 0b00000001 0b00000001 0b00000001 0b00000000 0b00000000 0b00000000 0b00000000