Simplest way to capture synchronized samples from RX channels 1 and 2
Quote from hansencj on 17/10/2023, 01:09This 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.
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.
Quote from hansencj on 01/11/2023, 23:24Replying 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.
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:
Quote from AdminTC on 02/11/2023, 08:41The 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.
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.
Quote from AdminTC on 02/11/2023, 16:23BTW: Both streams are perfect in sync (Rx1 = yellow, Rx2 = blue) so nothing to worry about from the data side:
BTW: Both streams are perfect in sync (Rx1 = yellow, Rx2 = blue) so nothing to worry about from the data side: