pavel-demin / red-pitaya-notes

Notes on the Red Pitaya Open Source Instrument
http://pavel-demin.github.io/red-pitaya-notes/
MIT License
337 stars 209 forks source link

SDR Transceiver App - Analog Input Synchronization? #840

Closed alandong93 closed 5 years ago

alandong93 commented 5 years ago

Description of the setup:

Description of the problem:

The two analog inputs do not seem to be synchronized. I tested this by connecting a waveform generator to both inputs and outputting a PWM pulse with 1 us duration. When I plot the signals from both inputs, there appears to be a time delay between samples from the two inputs. At first, I thought this would be easily compensated by adding a delay block or by offline post-processing, but the time delay changes every time I change the center frequency in GRC. The time delay also changes when I rerun the flowgraph with a different sampling rate. I have observed many different delays, such as 90 samples @ 20k samp/sec (= 4.5 ms) and 775 samples @ 500k samp/sec (= 1.5 ms). I tried many different combinations of center frequency and sampling rate and generally get between 1 and 5 ms. I tried with two different STEMLab 125-14 devices and both exhibited similar behavior. I noticed that IN1 was always ahead of IN2. Is this expected behavior?

I have attached two plots from different RPs below:

image RP#1: IN1 ahead by 362 samp @ 250 kSps (= 1.45 ms)

image RP#2: IN1 ahead by 90 samp @ 20 kSps (= 4.5 ms)

Steps to reproduce the problem:

  1. Run sdr-transceiver app on RP.
  2. Connect waveform generator (can also use OUT1 or OUT2 on RP) and output short pulse.
  3. Plot both signals on the same scope plot or file sink both signals and plot offline.

Thanks for all your help!

-Alan

pavel-demin commented 5 years ago

The analog inputs in the SDR transceiver application aren't synchronized by design. The two receivers and two transmitters are designed to be completely independent.

As a workaround, I'd suggest to try SDR transceiver compatible with HPSDR or SDR receiver compatible with HPSDR. They have synchronized inputs and they can be used with gr-hpsdr.