Example Code

Resample Waveform to Preserve Shape using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI resamples a waveform in order to retain its shape. This may reduce or increase the number of samples depending on the highest dominant frequency. This VI is designed to be used as a subVI.

 

Description

This example VI resamples a waveform in order to retain its shape. This may reduce or increase the number of samples depending on the highest dominant frequency. There is a peak detector in the frequency domain used to find the highest frequency above the power average. The resample factor will be the number of samples divided by ten times the highest frequency.

If the signal repeats this may detect the repeatability and will output a short waveform resampled for the repetition. This may be useful for significantly reducing the amount of data sent. The short sample is most useful for continuous waveforms.

This has not been tested for noisy signals and may not work for signals larger then 1M samples. If the highest frequency detected is more than ten times the number of samples this will not be effective at reducing the number of samples.

 

Requirements

  • LabVIEW 2012 (or compatible)

 
Steps to Implement or Execute Code

1. Set the waveform in
2. Run VI

 

Additional Information or References

VI Block Diagram

 Resample for Shape LV2012 NI Verified.png

**This document has been updated to meet the current required format for the NI Code Exchange.**  

 

Vince M
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.