Log-Power FFT UDP Viewer (log_power_fft_udp_app)

Capture RF spectrum snapshots from an FPGA-based FFT and stream them as JSON over UDP.

Description

log_power_fft_udp_app is a receive-only spectrum viewer. It configures the Digital Radio Controller (DRC) receive channel, captures 4096-point FFT snapshots from the FPGA, converts them to log-power (dB), and sends the result as JSON UDP datagrams to a configurable destination.

The application uses a single-thread architecture with a capture loop that:

  1. Triggers a single-shot capture on the triggered_sampler_xs worker.

  2. Waits briefly (10 ms) for the capture to complete.

  3. Reads the FFT output buffer from the external out port.

  4. Performs an FFT-shift (swaps the two halves so DC is centered).

  5. Computes log-power in dB for each bin: dB = 10 * log10(I² + Q²) − 115.

  6. Serialises the spectrum as a JSON object {"s": [dB, dB, …]} and sends it as a UDP datagram.

The FPGA application (log_power_fft_udp_app.xml) connects:

  1. The DRC RX port to the triggered_sampler_xs input.

  2. The triggered sampler output to the windower_xs_4k_proxy (Blackman-Harris window).

  3. The windower output to the xilinx_fft worker.

  4. The FFT output to the external out port.

DRC RX configuration (log_power_fft_udp_app.xml):

Parameter

Value

Center frequency

98.5 MHz

Bandwidth

20 MHz

Sample rate

20 MSPS

Gain

60 dB (auto)

TX

Disabled

FFT parameters:

Parameter

Value

FFT size

4096 points

Window function

Blackman-Harris

Capture mode

Single-shot (triggered every ~10 ms)

Output format

JSON object {"s": [dB, dB, …]} sent as UDP

Hardware Portability

This application is designed to run on the following platforms:

Hardware

RCC Platform

HDL Platform

ADALM-PLUTOSDR

adi_plutosdr0_39

plutosdr

LibreSDR

xilinx24_1_aarch32

libresdr

Xilinx ZC706

xilinx24_1_aarch32

zc706

Xilinx ZCU102

xilinx24_1_aarch64

zcu102

Execution

Prerequisites

  1. Build the project for the target RCC and HDL platforms.

  2. Deploy the bitstream and application artifacts to the target hardware.

  3. Ensure the OpenCPI runtime is available on the target.

Command(s)

Run the application on the target hardware:

./log_power_fft_udp_app [dest_ip [dest_port]]

Argument

Default

Description

dest_ip

127.0.0.1

IP address to receive spectrum JSON datagrams

dest_port

5005

UDP port for spectrum data

Example — send spectrum data to a remote host:

./log_power_fft_udp_app 192.168.1.100 5005

Verification

  • The application prints Sending UDP to <ip>:<port> on startup, confirming the destination.

  • A UDP listener (e.g. nc -lu 5005 or a custom viewer) on the destination host should receive JSON objects containing the log-power spectrum array once per capture cycle.

  • The JSON payload has the form {"s": [-40.2, -38.7, …]} with one entry per FFT bin (4096 values).

Troubleshooting

  • Failed to create UDP socket — the system could not create a UDP socket; check that networking is available on the target.

  • Invalid destination address — the dest_ip argument is not a valid IPv4 address.

  • app failed: … — an OpenCPI runtime error occurred (bitstream not loaded, DRC initialization failure, etc.). Check that the correct bitstream is programmed and that the DRC worker is available for the target platform.

  • No UDP packets received — verify the DRC RX channel is receiving signal, confirm the destination IP/port are correct, and check that no firewall is blocking UDP traffic.