Forum
Please or Register to create posts and topics.

Simplest way to capture synchronized samples from RX channels 1 and 2

This should be simple, but I have looked around at different examples on this forum and I can't find one that will do this simple task for me.  I want to capture blocks of IQ data (say 2 seconds long) and capture them into files I can read in Matlab.  The samples from the two channels need to be synchronized.  I've tried this with a pair of FileWriter blocks but the files always end up with different sizes and different time offsets.  I can't figure out how to find the samples times in order to synchronize them.

 

Replying to this request to see if I can get an answer.

I captured 2 files, one from RX channel 1 and the second from RX channel 2.  I examine them with the RTSATool:

RTSAFileTool info chan1_20231101142745_00000.rtsa
Reset Stream Clock
Reset Stream Clock
DSP to System time Offset: 9.77516e-06 sec
Number of Streams:1
Stream: #0
Start Time: Wednesday, November 1, 2023 2:27:45 PM PDT (1698874065.641688) End Time: Wednesday, November 1, 2023 2:27:48 PM PDT (1698874068.448627)

RTSAFileTool info chan2_20231101142745_00002.rtsa
Reset Stream Clock
Reset Stream Clock
DSP to System time Offset: 1.00136e-05 sec
Number of Streams:1
Stream: #0
Start Time: Wednesday, November 1, 2023 2:27:45 PM PDT (1698874065.641733) End Time: Wednesday, November 1, 2023 2:27:48 PM PDT (1698874068.448671)
Samples: 183,501,648 Payload Bytes: 1,468,013,184

 

The files have different Start Times and different values for "DSP to System time Offset".  I need synchronized samples from each channel.  Is it possible to determine from the two files exactly which sample in one file is captured at the same time in the second file?  How would I do this?

I've attached the mission file.

 

 

Uploaded files:

The file writer itself can't sync the time but the real capture time is within the file itself:

You can see the start time within the file and you know the sample rate so all you need to do is to skip some samples from one file till both time stamps perfectly match.

 

Since some more of you are asking for this we might add some automatic sync to the file writer. Working on it.

 

BTW: Both streams are perfect in sync (Rx1 = yellow, Rx2 = blue) so nothing to worry about from the data side:

Rx1 & Rx2 in perfect sync

 

Thanks.  This is very helpful.