Skip to content

DoA X440 (main) Block Information

Jreitmei edited this page Aug 18, 2025 · 5 revisions

GNU Radio DOA (Direction of Arrival) Blocks Documentation

This document provides comprehensive documentation for all blocks in the GNU Radio DOA module, including their functionality, parameters, and usage guidelines.

Table of Contents


Source Blocks

X440 USRP Source

Block ID: doa_x440_usrp_source

A specialized USRP source block optimized for X440 devices in DOA applications.

Functionality:
This block provides a wrapper around the standard USRP source block with X440-specific optimizations. It supports multiple synchronized channels essential for direction finding applications.

Parameters

  • Samp Rate (samp_rate): Sample rate in samples per second

    • Type: Float
    • Default: 200e3 Hz
    • Range: Depends on X440 capabilities
  • Center Freq (center_freq): RF center frequency in Hz

    • Type: Float
    • Default: 446031250 Hz
    • Usage: Set to the carrier frequency of the signal of interest
  • Num Channels (sources): Number of receive channels

    • Type: Integer
    • Default: 4
    • Range: 2-8 channels
    • Constraint: Must be > 1 and ≤ 8
  • Device Address (addresses): Network address of the USRP

    • Type: String
    • Default: "addr=192.168.40.2"
    • Format: Standard USRP addressing format
  • Device Args (device_args): Additional device configuration

    • Type: String
    • Default: "master_clock_rate=250e6"
    • Usage: Configure master clock and other device-specific settings

Outputs

  • out: Complex baseband samples
    • Type: Complex
    • Multiplicity: Equal to sources parameter
    • Each output represents one synchronized channel

Calibration Blocks

Calibrate Linear Array

Block ID: doa_calibrate_lin_array

Calibrates a uniform linear antenna array using a known pilot signal.

Functionality
This block performs array calibration by processing the sample correlation matrix from array elements when a pilot signal at a known angle is present. It compensates for gain and phase mismatches between array elements.

Parameters

  • Normalized Spacing (norm_spacing): Element spacing normalized by wavelength

    • Type: Float
    • Default: 0.5
    • Range: ≤ 0.5 (half wavelength maximum)
    • Calculation: d/λ where d = physical spacing, λ = wavelength
  • Num Ant Elements (num_ant_ele): Number of antenna array elements

    • Type: Integer
    • Default: 4
    • Constraint: Must be > 1
  • Pilot Angle (pilot_angle): Known angle of pilot transmitter in degrees

    • Type: Float
    • Default: 45.0°
    • Range: Typically 0° to +180°

Inputs/Outputs

  • Input: Sample correlation matrix (complex, vector length = num_ant_ele²)
  • Output: Calibrated array response (complex, vector length = num_ant_ele)

Phase Offset Estimation

Block ID: doa_phase_offset_est

Estimates phase offsets between multiple input streams.

Functionality
Computes phase differences between input channels relative to the first channel. Essential for correcting hardware-induced phase mismatches in multi-channel systems.

Parameters

  • Num. Inputs (num_inputs): Number of input streams

    • Type: Integer
    • Default: 4
    • Usage: Must match the number of antenna elements
  • Skip Ahead (n_skip_ahead): Samples to skip at stream beginning

    • Type: Integer
    • Default: 8192
    • Purpose: Allow streams to stabilize before estimation

Inputs/Outputs

  • Input: Complex data streams (multiplicity = num_inputs)
  • Output: Phase offset estimates (float, multiplicity = num_inputs-1)

Phase Correction Hierarchy

Block ID: doa_phase_correct_hier

Applies stored phase corrections to multiple input channels.

Functionality
Reads phase correction values from a configuration file and applies them to input streams to compensate for hardware phase mismatches.

Parameters

  • Num Ports (num_ports): Number of input/output ports

    • Type: Integer
    • Default: 2
  • Config File (config_filename): Path to phase correction file

    • Type: File path
    • Default: /tmp/phases.cfg
    • Format: Configuration file with phase corrections

Antenna Correction

Block ID: doa_antenna_correction

Applies gain and phase corrections to antenna array elements.

Functionality
Uses stored calibration data to normalize the response of antenna array elements, ensuring uniform gain and phase response across the array.

Parameters

  • Num Antenna Elements (num_ant_ele): Number of array elements

    • Type: Integer
  • Config File (config_filename): Calibration data file

    • Type: File path
    • Default: /tmp/antenna.cfg

DOA Algorithm Blocks

MUSIC Linear Array

Block ID: doa_MUSIC_lin_array

Implements the MUSIC (Multiple Signal Classification) algorithm for DOA estimation.

Functionality
The MUSIC algorithm exploits the orthogonality between signal and noise subspaces to estimate direction of arrival. It produces a pseudo-spectrum where peaks indicate DOA angles.

Parameters

  • Normalized Spacing (norm_spacing): Element spacing / wavelength

    • Type: Float
    • Default: 0.5
    • Constraint: ≤ 0.5 to avoid spatial aliasing
  • Num Targets (num_targets): Number of signal sources

    • Type: Integer
    • Default: 1
    • Constraint: Must be < number of antenna elements
  • Num Ant Elements (inputs): Number of array elements

    • Type: Integer
    • Default: 4
    • Constraint: Must be > num_targets
  • P-Spectrum Length (pspectrum_len): Output spectrum resolution

    • Type: Integer
    • Default: 20
    • Usage: Higher values provide finer angular resolution

Theory MUSIC algorithm steps:

  1. Eigendecomposition of correlation matrix
  2. Separation of signal and noise subspaces
  3. Computation of MUSIC pseudo-spectrum
  4. Peak detection for DOA estimation

Root-MUSIC Linear Array

Block ID: doa_rootMUSIC_linear_array

Implements the Root-MUSIC algorithm for improved DOA estimation.

Functionality
Root-MUSIC is a polynomial-rooting version of MUSIC that provides more accurate DOA estimates and avoids the need for spectrum peak searching.

Parameters

  • Normalized Spacing (norm_spacing): Element spacing / wavelength

    • Type: Float
    • Default: 0.5
    • Constraint: ≤ 0.5
  • Num Targets (num_targets): Number of signal sources

    • Type: Integer
    • Default: 1
  • Num Inputs (num_ant_ele): Number of array elements

    • Type: Integer
    • Default: 4
    • Constraint: Must be > num_targets

Advantages over MUSIC

  • No spectral peak search required
  • Higher accuracy near endfire directions
  • Computationally more efficient for small arrays

Utility Blocks

Autocorrelate

Block ID: doa_autocorrelate

Computes sample correlation matrices from input data streams.

Functionality
Generates correlation matrices essential for DOA algorithms by computing E[x(t)x^H(t)] where x(t) is the array snapshot vector.

Parameters

  • Num Inputs (inputs): Number of input channels

    • Type: Integer
    • Default: 1
  • Snapshot Size (snapshot_size): Samples per correlation estimate

    • Type: Integer
    • Default: 2048
    • Trade-off: Larger values improve statistical accuracy but reduce time resolution
  • Overlap Size (overlap_size): Overlap between consecutive snapshots

    • Type: Integer
    • Default: 512
    • Constraint: Must be < snapshot_size
  • Averaging Method (avg_method): Correlation matrix averaging technique

    • Options: 'Forward', 'Forward-Backward'
    • Forward-Backward: Improves estimation by utilizing conjugate symmetry

Find Local Maximum

Block ID: doa_find_local_max

Locates peaks in input vectors (e.g., MUSIC pseudo-spectra).

Functionality
Identifies local maxima in input data and converts peak locations to angle estimates. Essential for extracting DOA information from algorithm outputs.

Parameters

  • Num. Max. Values (num_max_vals): Number of peaks to find

    • Type: Integer
    • Default: 1
  • Vector Len. (vector_len): Input vector length

    • Type: Integer
    • Default: 512
  • X min (x_min): Minimum angle value

    • Type: Float
    • Default: 0.0°
  • X max (x_max): Maximum angle value

    • Type: Float
    • Default: 180.0°

Outputs

  • max: Peak values
  • arg-max: Peak locations (angles)

Output Blocks

Serial Connection

Block ID: doa_serial_connection

Transmits DOA results via serial interface for servo control.

Functionality
Converts GNU Radio float data to serial commands for controlling servo motors based on DOA estimates. Useful for implementing tracking systems.

Parameters

  • Serial Port (port): Device path

    • Type: String
    • Default: "/dev/ttyUSB0"
    • Platform: Linux/Unix format
  • Baud Rate (baudrate): Communication speed

    • Type: Integer
    • Default: 115200
    • Options: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600
  • Dimensions (num_max): Expected number of Dimentions (relevant for actuator) i.e. does the actuator only act in the plane or up down as well.

    • Type: Integer
    • Default: 1
  • Debug Output (debug): Enable console debugging

    • Type: Boolean
    • Default: False
  • enable_video (enable_video): Enable Video Overlay

    • Type: Boolean
    • Default: False

Save Antenna Calibration

Block ID: doa_save_antenna_calib

Stores calibration results to configuration files.

Functionality
Averages calibration estimates over multiple samples and saves gain and phase corrections for later use.

Parameters

  • Num Inputs (num_inputs): Number of antenna elements
  • Samples To Average (samples_to_average): Averaging window size
  • Config Filename (config_filename): Output file path

Average and Save

Block ID: doa_average_and_save

Averages input streams and stores results.

Parameters

  • Num Inputs (num_inputs): Number of input streams
  • Samples To Average (samples_to_average): Averaging window
  • Config File (config_filename): Output file path

Find Maximum and Save

Block ID: doa_findmax_and_save

Finds maximum values in input streams and saves results.

Parameters

  • Num Inputs (num_inputs): Number of input streams
  • Samples To Find Max. (samples_to_findmax): Sample window for maximum search
  • Config File (config_filename): Output file path

Usage Guidelines

Typical DOA Processing Chain

  1. Signal Acquisition: Use X440 USRP Source with synchronized channels
  2. Calibration: Apply phase corrections and antenna calibration
  3. Correlation: Generate correlation matrices using Autocorrelate block
  4. DOA Estimation: Apply MUSIC or Root-MUSIC algorithms
  5. Peak Detection: Use Find Local Max to extract angle estimates
  6. Output: Send results via Serial Connection or save to file

Parameter Selection Guidelines

Array Spacing

  • Use d = λ/2 (norm_spacing = 0.5) for optimal performance
  • Smaller spacing reduces spatial aliasing but may decrease resolution
  • Larger spacing (>λ/2) causes ambiguities

Snapshot Size

  • Larger snapshots improve statistical accuracy
  • Trade-off with processing latency and tracking speed
  • Typical range: 512-4096 samples

Number of Elements vs. Targets

  • Always ensure: num_ant_elements > num_targets
  • More elements improve resolution and accuracy
  • Minimum: 3 elements for 2D DOA estimation

Performance Considerations

  • Computational Complexity: MUSIC O(N³), Root-MUSIC O(N²) where N = array elements
  • Memory Usage: Correlation matrices require N² complex storage
  • Accuracy: Improves with SNR, snapshot length, and array aperture
  • Resolution: Limited by array geometry and algorithm choice

Troubleshooting

Common Issues

  1. Poor DOA Accuracy

    • Check array calibration
    • Verify element spacing
    • Increase snapshot size
    • Ensure sufficient SNR
  2. Ambiguous Results

    • Reduce element spacing
    • Check for spatial aliasing
    • Verify target count parameter
  3. Calibration Problems

    • Ensure pilot source is at known angle
    • Check phase stability
    • Verify timing synchronization

Error Messages

  • "num_ant_ele must be > num_targets": Increase array elements or reduce target count
  • "norm_spacing must be ≤ 0.5": Reduce element spacing or increase frequency
  • "overlap_size must be < snapshot_size": Adjust overlap parameter
Clone this wiki locally