Skip to main content

ZeroMQ-GNURadio

Jia-YinAbout 1 mincoursecomm

This section introduces the functionality of the ZeroMQ module in GNU Radio, and using ZeroMQ communication for transmitting and receiving AM modulated messages.

ZeroMQ Module in GNU Radio

In GNU Radio, ZeroMQ is divided into 6 Source Blocks and 6 Sink Blocks, which can be used to handle streaming data and message data. Each Source Block has a corresponding Sink Block. Source Blocks are used to provide data streams to GNU Radio, while Sink Blocks are used to send out data streams. The following are the 12 ZeroMQ modules:

  • ZMQ PUB Message Sink / ZMQ SUB Message Source
  • ZMQ PUB Sink / ZMQ SUB Source
  • ZMQ REQ Message Sink / ZMQ REP Message Source
  • ZMQ REQ Sink / ZMQ REP Source
  • ZMQ PUSH Message Sink / ZMQ PULL Message Source
  • ZMQ PUSH Sink / ZMQ PULL Source

When using TCP binding (Bind), tcp://0.0.0.0:<port> should be used to listen on all network interfaces; or replace 0.0.0.0 with a specific IP address of the computer. Here <port> is the specified port number. When using TCP connection (Connect), specify the remote endpoint to connect to, which can be an IP address or a resolvable DNS name.

Multiple IPs

One computer can have multiple network cards and multiple IP addresses, and the number of network cards may not necessarily match the number of IP addresses.

AM Modulation and Demodulation

Modulation

Set up the following AM modulation system:

Parameters used:

  • samp_rate: 200e3
  • Signal Source: Amplitude=0.6
  • Signal Source (Carrier): Frequency=50e3
  • ZMQ PUB Sink: Address=tcp://127.0.0.1:50001

Simulation result:

Demodulation

Set up the following AM demodulation system:

Parameters used:

  • samp_rate: 200e3
  • ZMQ SUB Source: Address=tcp://127.0.0.1:50001
  • Signal Source (Carrier): Frequency=50e3
  • Low Pass Filter: Cutoff Freq=13e3, Transition Width=1000
  • GUI Range (gain): Default Value=2, Start=0, Stop=20, Step=0.1

Simulation result, where the red signal is the demodulated result:

Exercise 3

  1. In the above simulation, modulation and demodulation are performed on the same computer. Please separate them and perform on two different computers.
  2. Change the input signal to microphone input and use a speaker for output.