Appending Complex Waveforms on LabVIEW

Updated Jul 5, 2022

Environment

Software

  • LabVIEW

Driver

  • NI-RFSA

Other

  • NI-RFSA (Optional)

While working with NI-RFSA, you will encounter complex waveforms being generated as a cluster of three elements, one of which is a complex array which acts as the data of the generated waveform, whereas t0 the starting time and dt the difference of time between each element of the array are just as any other waveform.
You may then need to append the generated waveforms in order to have the whole data generated in a single waveform to use later in your application.
The "append waveform" function provided by LabVIEW won't work in this case due to it being made to work with waveform that have Real values as data.
Therefore, in order to append the complex waveforms onto one another, please follow the steps below.

  1. Make a cluster of three elements: two doubles and an array of complex values. This cluster will serve as the initial complex waveform.
  2. Bundle the reciprocal of the sample rate into the waveform. The reciprocal of the sample rate is the dt of the waveform. If the starting time is different than 0, bundle the t0 into the initialized cluster as well.
  3. Add the part of the code that will generate the complex waveform into a while loop, for example: NI RFSA Fetch IQ.
  4. Unbundle the data value Y from both the initialized waveform and the generated waveform.
  5. Make a new array with the value from the initialized cluster serving as the starting array. Insert the generated waveform's data into this array using the Insert into Array function
  6. The output from step 5 will serve as the data value of the final waveform of this iteration. Bundle this array into the initialized waveform.
  7. Use a shift register for the initialized waveform to update it every iteration.

Following these steps will result in the following VI which will use the NI-RFSA fetch IQ function to generate a waveform which we keep appending to the waveform from the previous iteration. The output of the while loop will be the final waveform that contains all the data from all the iterations of the while loop.
Complex Waveform.png
Note: In order to use this snippet, download this image, and then drag and drop it on your LabVIEW block diagram.