Example Code

Calculate Phase Correlation 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.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview
This VI demonstrates calculation of the phase difference between two waveforms using the phase correlation method.

 
Description

There are many applications where it is important to get the phase correlation between two waveforms. The correlations test VI generates two sine waves with different phases and feed them into the time delay VI, and the time delay VI (subVI) will then compute the phase correlation and the time delay in number of samples between the two waveforms. Note that both waveforms must have the same number of samples in them. About phase correlation, see wikipedia article http://en.wikipedia.org/wiki/Phase_correlation


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached files and put them in the same folder.
  2. Open the correlations test VI. 
  3. Set up the phase for A and B waveform.
  4. Run the VI and see the phase correlation between the two waveforms on the front panel.

 

Additional Information or References
VI Snippet 

001a.png001b.png

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

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions

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

Comments
PhilG
Member
Member
on

So how about a version that we can open - I would imagine that no one outside of NI has LV 9 yet - I know it says LV8_2 but my LabVIEW 8.6 says it is LV 9 and won't open it.

Downloads:
Doug_L._Bear
Active Participant
Active Participant
on

Sorry about that, simple mistake on my part.  Thank you for bringing that to my attention Phil.

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions