Answers.Body: <p>The zero-fill function is experimental and not guaranteed to be accurate.</p>
  <p>Sampling gaps occur due to memory card latency i.e. sometimes the memory cannot keep up with the data stream - we buffer data in RAM, but eventually we may run out of RAM at which point samples will be dropped, thereby producing a sampling gap. The zero-fill function looks for gaps in sampling and attempts to fill them with zeros in order to preserve timing. The 'CumulativeSamplingGap' parameter is supposed to be the sum of all sampling gaps. However it is a poor measure as it is subject to cumulative errors which add up over the course of the recording. Better news is that this shouldn’t impact the accuracy of the zero fill mechanism. You should find that concatenated recordings have time accuracy within quartz spec - presumably you can confirm this against your audible sync signal.</p>
  <p>As I said as the start - we can't guarantee the zero-fill function will perform as expected, so advise using it with caution. Better news is that we hope to do more work on the zero fill function in the near future. Meanwhile we recommend our ST640 multichannel recorders for coherent array applications.</p>
  <p>I hope this helps</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-09T20:40:26.047Z
Answers.LastActivityDate: 2024-04-10T10:13:31.037Z
Answers.LastEditDate: 2024-04-10T10:13:31.037Z
Answers.UserDisplayName: John Atkins
Body: <p>We set the OceanInstuments SoundTrap ST600 (Firmware 4.0.0.7, Offloader 1.52, MSP 1.36) to record continuously, with 30 min. files every 30 min. When downloading the data, we selected the &quot;Zero Fill Dropouts&quot; options. Extracted WAV files come with associated XML files that contain the following information:</p>
  <p>'SamplingStartTimeUTC': '2023-11-20T08:00:01'<br />
  'SamplingStartTimeSubS': '349411 us'<br />
  'SamplingTimePeriod': '1798941789 us'<br />
  'CumulativeSamplingGap': '23156 us'<br />
  'SampleCount': '345402320'</p>
  <p>The SampleCount matches the actual number of samples in the WAV file. However, taking the samplerate (192000) into account, the file length (1798970416 us) does not match the SamplingTimePeriod. The difference (28627 us) does not match the CumulativeSampleGap. When computing the time difference of the StartTimes of two consecutive files, one gets yet another file length, but not any difference matches CumulativeSampleGap. (3 different file lengths computed, none difference matches CumulativeSampleGap).</p>
  <p>I could not find any documentation. The clock drift should be better than 5ppm. The sample clock and the real time clock are derived from the same quartz. Therefore timing should be easy and consistent by just counting samples.</p>
  <p>We deployed several SoundTraps and want to use them as an coherent array. We have precisely located the SoundTraps on the sea bottom and synchronized the recordings with external sounds every day. We need an accurate relation between sample number and time and therefore would need a gapless recording or at least know precisely about the gaps.</p>
  <p>Does anyone have experience with concatenating files from ST600? Should we concatenate the files and ignore the timestamps? Or, should we fill the gaps in order to make the timestamps fit? What are these mysterious SampleGaps and how are they filled with zeros?</p>
  
Tags: <soundtrap><data><time-align><time-stamps><realtime>
Title: How to concatenate files from SoundTrap ST600?
ThreadText: # How to concatenate files from SoundTrap ST600?
  
  (Asked by: username_0 on 2024-04-08)
  
  We set the OceanInstuments SoundTrap ST600 (Firmware 4.0.0.7, Offloader 1.52, MSP 1.36) to record continuously, with 30 min. files every 30 min. When downloading the data, we selected the "Zero Fill Dropouts" options. Extracted WAV files come with associated XML files that contain the following information:
  
  'SamplingStartTimeUTC': '2023-11-20T08:00:01'  
  'SamplingStartTimeSubS': '349411 us'  
  'SamplingTimePeriod': '1798941789 us'  
  'CumulativeSamplingGap': '23156 us'  
  'SampleCount': '345402320'
  
  The SampleCount matches the actual number of samples in the WAV file. However, taking the samplerate (192000) into account, the file length (1798970416 us) does not match the SamplingTimePeriod. The difference (28627 us) does not match the CumulativeSampleGap. When computing the time difference of the StartTimes of two consecutive files, one gets yet another file length, but not any difference matches CumulativeSampleGap. (3 different file lengths computed, none difference matches CumulativeSampleGap).
  
  I could not find any documentation. The clock drift should be better than 5ppm. The sample clock and the real time clock are derived from the same quartz. Therefore timing should be easy and consistent by just counting samples.
  
  We deployed several SoundTraps and want to use them as an coherent array. We have precisely located the SoundTraps on the sea bottom and synchronized the recordings with external sounds every day. We need an accurate relation between sample number and time and therefore would need a gapless recording or at least know precisely about the gaps.
  
  Does anyone have experience with concatenating files from ST600? Should we concatenate the files and ignore the timestamps? Or, should we fill the gaps in order to make the timestamps fit? What are these mysterious SampleGaps and how are they filled with zeros?
  
  **Tags:** soundtrap, data, time-align, time-stamps, realtime
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-04-09. Score: 2
  
  The zero-fill function is experimental and not guaranteed to be accurate.
  
  Sampling gaps occur due to memory card latency i.e. sometimes the memory cannot keep up with the data stream - we buffer data in RAM, but eventually we may run out of RAM at which point samples will be dropped, thereby producing a sampling gap. The zero-fill function looks for gaps in sampling and attempts to fill them with zeros in order to preserve timing. The 'CumulativeSamplingGap' parameter is supposed to be the sum of all sampling gaps. However it is a poor measure as it is subject to cumulative errors which add up over the course of the recording. Better news is that this shouldn’t impact the accuracy of the zero fill mechanism. You should find that concatenated recordings have time accuracy within quartz spec - presumably you can confirm this against your audible sync signal.
  
  As I said as the start - we can't guarantee the zero-fill function will perform as expected, so advise using it with caution. Better news is that we hope to do more work on the zero fill function in the near future. Meanwhile we recommend our ST640 multichannel recorders for coherent array applications.
  
  I hope this helps
  
  
  ---
  
  