Skip navigation


Currently Being Moderated

MathScript MSCohere and Frequency Response Function in LabVIEW 8.6.1

Created on: May 27, 2009 8:13 AM by Pie56694 - Last Modified:  May 27, 2009 8:59 AM by Pie56694


Functional Description

This document shows how to get the coherence between signals X and Y using MathScript or LabVIEW functions.


The MathScript function MSCohere calculates the magnitude-squared coherence estimation of two signals.  LabVIEW Full, Professional or Developer Suite is required to program with the MathScript Node.


LabVIEW's Frequency Response Function (Mag-Phase) computes the frequency response and the coherence based on the input signals.  For more information on the mathematics behind this function, see DeveloperZone Tutorial The Fundamentals of FFT-Based Signal Analysis and Measurement in LabVIEW and LabWindows/CVI.


The implementation of MSCohere and Frequency Response Function is different.  A common question is, "Why is the coherence returned by the Frequency Response Function (Mag-Phase) always 1?"  The answer is suggested by KnowledgeBase   27BF0ABI.  This document demonstrates parallel behavior between MSCohere and , and Frequency Response Function (Mag-Phase).


Caveats and Additional Notes

The attached file is built in LabVIEW 8.6.


The MathScript node is used to generate input signals x and y, each signal is 16,384 samples long.  MSCohere options are used so that the signals are processed analogously to how the Frequency Response Function (Mag-Phase) processes its inputs.  The same x and y signals are passed both to the Frequency Response Function (Mag-Phase) and to Cross Spectrum and to FFT Power Spectrum for a piecewise calculation of the coherence.




Comments (1)