Skip to main content

Data Types

Jia-YinLess than 1 minutecoursecomm

Data Types

  • Signal Data Types: GNU Radio Companion (GRC) supports a variety of data types including complex and simple floats and integers, unpacked bits, asynchronous messages, bus connections, and more. For details, visit Signal Data Typesopen in new window.
  • Converting Data Types: To change data types, use components in the Type Converters Group, such as Char To Float.

  • Packing Bits: Use Pack K Bits to combine bits into bytes and Unpack K Bits to separate bytes back into bits.

  • Streams and Vectors: Signals can be streams (one sample at a time) or vectors (multiple samples at a time).

Stream / Vector Conversion Example

System Block:

Parameters:

  • Signal Source 1: Default values
  • Signal Source 2: Frequency=2000, Amplitude=0.5
  • Streams to Vector: Number of Streams=2
  • Vector to Stream: Number of Items=2

Result:

Tip

Use the middle mouse button to access the settings panel.

If the amplitude of the second signal is set to 0, the result changes as shown:


Exercise 1

1. Create and simulate the system described above. 2. In the first example, higher frequency components appear. Can you explain why in simple terms? 3. In the second example, the system samples only the first signal, resulting in downsampling. Investigate further to explain the effect on the frequency spectrum.