Removing Gaps During Acquisition With LabVIEW Sound and Vibration Toolkit

Updated Oct 31, 2023

Reported In

Software

  • LabVIEW
  • LabVIEW Sound and Vibration Toolkit

Issue Details

I'm acquiring a sound signal using LabVIEW Sound and Vibration toolkit. When I configure the number of samples/ch in Sound Input Read.vi less than number of samples/ch in Sound Input Configure.vi the obtained waveform presents some gaps as shown in the figure below. How can I fix this issue? There are some examples that solve these gaps?

Solution

In order to remove the gaps shown in your graph or in your log data with timestamps you have to implement a code that at the second iteration of while loop the starting t0 is the last t0 read by Sound Input Read.vi as show in the following snipped vi. This because LabVIEW approximates the initial time that the first sample was read because the sound file does not contain this data as described in the context help.

In this example you do the following steps:
  1. Set the parameters in Sound Input Configure.vi.
  2. Set the while loop for the continuos acquisition.
  3. Set the parameters in Sound Input Read.vi.
  4. Get the first t0 timestamps with Get Date/Time in Second function.
  5. Perform a t0 correction multiplying the waveform dt with the number of samples/ch setted in Sound Input Read.vi adding it to the initial t0.
  6. Make sure you are using shift register in the dt correction in order to use it for each iteration.

Additional Information

When you acquire data in a continuous acquisition, you can use the t0 in the waveform datatype to ensure there are no gaps between successive blocks of waveforms returned by sequential calls to the Sound Input Read.vi
The waveform datatype is integral for testing time continuity in the Sound and Vibration Toolkit. If you read data from a file or simulate a signal using one of the VIs in the Signal Generation palette, wire a t0 that meets the continuous timestamp condition to the waveform datatype connected to the measurement analysis VIs. This action prevents unexpected resets of the measurement analysis due to detected discontinuities in the input signal.