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:
Triggers a single-shot capture on the
triggered_sampler_xsworker.Waits briefly (10 ms) for the capture to complete.
Reads the FFT output buffer from the external
outport.Performs an FFT-shift (swaps the two halves so DC is centered).
Computes log-power in dB for each bin:
dB = 10 * log10(I² + Q²) − 115.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:
The DRC RX port to the
triggered_sampler_xsinput.The triggered sampler output to the
windower_xs_4k_proxy(Blackman-Harris window).The windower output to the
xilinx_fftworker.The FFT output to the external
outport.
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 |
Hardware Portability
This application is designed to run on the following platforms:
Hardware |
RCC Platform |
HDL Platform |
|---|---|---|
ADALM-PLUTOSDR |
|
|
LibreSDR |
|
|
Xilinx ZC706 |
|
|
Xilinx ZCU102 |
|
|
Execution
Prerequisites
Build the project for the target RCC and HDL platforms.
Deploy the bitstream and application artifacts to the target hardware.
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 |
|---|---|---|
|
|
IP address to receive spectrum JSON datagrams |
|
|
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 5005or 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_ipargument 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.