AirspyAlign

class AirspyAlign : public kotekan::Stage

Kotekan stage to measure the time-lag between two real input streams.

Consumes raw short samples from two airspy producers. On REST request the stage captures lag_window samples from each input, then in the callback performs zero-padded FFT cross-correlation to estimate the integer sample lag between A and B. The lag, and optionally the full correlation magnitudes, are returned as JSON.

Buffers

  • in_bufA Input kotekan buffer A.

    • Format: Array of short

    • Metadata: none

  • in_bufB Input kotekan buffer B.

    • Format: Array of short

    • Metadata: none

REST endpoints

  • GET <unique_name>/cal_lag — returns {"lag": int}

  • GET <unique_name>/get_correlation — returns {"lag": int, “corr_pos”: […], “corr_neg”: […]}

Author

Keith Vanderlinde

Param lag_window:

UInt (default: input frame size in samples). Number of samples to capture.

Public Functions

AirspyAlign(kotekan::Config &config, const std::string &unique_name, kotekan::bufferContainer &buffer_container)
~AirspyAlign() override
virtual void main_thread() override
void cal_lag_callback(kotekan::connectionInstance &conn)
void get_correlation_callback(kotekan::connectionInstance &conn)