**2. Analyze with LabVIEW**

## **2.1 LabVIEW data analysis and math libraries**

LabVIEW presents the VIs and functions on the Functions palette using menus. When LabVIEW is installed, built-in menus appear on the Functions palette. Some of them do not contain functions by default. After installed certain modules, toolkits, and drivers, functions appear in the built-in categories. For example, Measurement I/O menu does not contain NI DAQmx by default. If you want to utilize its function, you must install NI DAQmx.

LabVIEW includes hundreds of built-in and add-ons functions for analysis. You can find a short list of analysis functions below [1].

**Measurement.** *Waveform-Based\*\*.* Averaged DC-rms. Cycle average and rms. Pulse transition (rise, slew, overshoot). Pulse width/period/duty. Pulse amplitude and levels. Signal noise and distortion (SINAD) analyzer. Harmonic distortion analyzer. Cross spectra Sine tone measurement. FFT spectrum. Frequency response function. Power spectrum. Power spectral density. *Array-Based.* AC and DC Estimator. Amp and frequency estimate. Amp and phase spectrum. Auto power spectrum. Cross power spectrum. Harmonic analyzer.

*Analyzing and Presenting Data with LabVIEW DOI: http://dx.doi.org/10.5772/intechopen.96130*

Impulse response. Network functions (avg). Power and frequency estimate. Power spectrum. Scaled time-domain window. Spectrum unit conversion. Transfer function. **Signal Monitoring/Triggering.** *Waveform-Based\*\*.* Basic level trigger detection. Limit testing. Limit specification. Limit specification by function. Waveform peak detection. *Array-Based.* Peak detection. Pulse parameters. Threshold peak detector. **Signal Generation. Windowing. Digital Filters.**

#### **2.2 Statistics**

interpolation, digital signal processing, and more. You can also reach more functions from additional modules. Unfortunately, some modules are not free.

allow you to visualize data in a very simple and effective manner.

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

**2. Analyze with LabVIEW**

**Figure 1.**

*Common steps in a VI.*

**Measurement.** *Waveform-Based\*\*.* Averaged DC-rms. Cycle average and rms.

FFT spectrum.

*Array-Based.*

**4**

Power spectrum. Power spectral density.

AC and DC Estimator. Amp and frequency estimate. Amp and phase spectrum. Auto power spectrum. Cross power spectrum. Harmonic analyzer.

**2.1 LabVIEW data analysis and math libraries**

utilize its function, you must install NI DAQmx.

Pulse transition (rise, slew, overshoot).

Cross spectra Sine tone measurement.

Signal noise and distortion (SINAD) analyzer.

Pulse width/period/duty. Pulse amplitude and levels.

Harmonic distortion analyzer.

Frequency response function.

can find a short list of analysis functions below [1].

**Present:** After you acquire and analyze data, you generally want to present your data. Data presentation means data visualization, report generation, data storage, Web publishing, database connectivity, data management, and more. The LabVIEW includes hundreds of functions and tools for data presentation. These

LabVIEW presents the VIs and functions on the Functions palette using menus. When LabVIEW is installed, built-in menus appear on the Functions palette. Some of them do not contain functions by default. After installed certain modules, toolkits, and drivers, functions appear in the built-in categories. For example, Measurement I/O menu does not contain NI DAQmx by default. If you want to

LabVIEW includes hundreds of built-in and add-ons functions for analysis. You

1D, 2D, and 3D ANOVA. Chi square distribution. Contingency table. erf(x) and erfc(x). F distribution. T distribution. General histogram. Histogram\*. Inverse chi square. Distribution. Inverse F distribution. Inverse normal distribution. Inverse T distribution. Mean\*. Median\*. Mode\*. Moment about mean. Mean squared error (MSE). Normal distribution. Polynomial interpolation. Rational interpolation. Root mean square (rms). Spline interpolant/interpolation. Standard deviation\*. Variance. **Signal Processing.** *Autocorrelation.* Convolution. Cross power.

Cross correlation. Decimate. Deconvolution. Derivative x(t). Fast Hilbert transform. Fast Hartley transform. Integral x(t). FFT/Inverse FFT (Re + Im). Inverse fast Hilbert transform. Unwrap phase Y[i] = Clip{X[i]} Y[i] = X[i-n]. **Curve Fitting.** Exponential fit. General least squares linear fit. General polynomial fit. Linear fit. Nonlinear Lev-Mar fit. 1D and 2D linear evaluation\*. 1D and 2D polynomial evaluation\*. Numeric integration. Polar to rect/rect to polar. Scale 1D/2D. Find polynomial roots. **Mathematics/Numerical Methods. Digital Waveform Analysis.** Digital signal subset. Invert digital signal. Uncompress digital signal. Compress digital signal. Digital signal size. Search for digital pattern. Compare digital signals. Append digital signals. Append digital samples. Digital waveform to Boolean array. Boolean array to digital waveform. **Waveform Conditioning.** \*Denotes VIs that are shipped with the Base package of LabVIEW for Windows. \*\*Waveform VIs input a time-domain signal and output a scaled measurement.

We highly recommend that check the examples located in LabVIEW before starting to create a VI for analysis. You can access the examples from NI Example Finder **(Help>> Find Examples …** ). You can search the examples with keyword(s) in NI Example Finder. It also allows you to visit ni.com for more examples.

**Mathematics** palette also contains **Fitting** subpalette (**Figure 5**). This palette

contains the following fitting VIs.

*Mathematics palette and signal processing palette.*

*Analyzing and Presenting Data with LabVIEW DOI: http://dx.doi.org/10.5772/intechopen.96130*

• Linear Fit VI

**Figure 2.**

**7**

• Power Fit VI

• Exponential Fit VI

• Gaussian Peak Fit VI

• Logarithm Fit VI

We also recommend that if possible you should choose Express VIs for analysis. An Express VI is a VI, which can be configured interactively through a dialog box. Express VIs are user friendly. You can easily configure your analysis parameters. To access to the dialog box, double-click to corresponding Express VI.

For analysis, you will frequently use **Mathematics** palette and **Signal Processing** palette (**Figure 2**).

**Statistics** and **Histogram** Express VIs are located in **Probability & Statistics** subpalette of **Mathematics** palette (**Figure 3**).

In the following example, VI simulates a DC signal with noise (**Figure 4**). VI also generates a histogram and result of basic statistical analysis.

*Analyzing and Presenting Data with LabVIEW DOI: http://dx.doi.org/10.5772/intechopen.96130*

Cross correlation.

Decimate. Deconvolution. Derivative x(t). Fast Hilbert transform. Fast Hartley transform.

Integral x(t).

**Curve Fitting.** Exponential fit.

Linear fit.

Scale 1D/2D.

FFT/Inverse FFT (Re + Im). Inverse fast Hilbert transform.

General least squares linear fit.

General polynomial fit.

Nonlinear Lev-Mar fit. 1D and 2D linear evaluation\*. 1D and 2D polynomial evaluation\*.

Numeric integration. Polar to rect/rect to polar.

Find polynomial roots.

Digital signal subset. Invert digital signal. Uncompress digital signal. Compress digital signal. Digital signal size.

Search for digital pattern. Compare digital signals. Append digital signals. Append digital samples.

**Waveform Conditioning.**

**Processing** palette (**Figure 2**).

**6**

subpalette of **Mathematics** palette (**Figure 3**).

**Mathematics/Numerical Methods. Digital Waveform Analysis.**

Digital waveform to Boolean array. Boolean array to digital waveform.

\*Denotes VIs that are shipped with the Base package of LabVIEW for Windows. \*\*Waveform VIs input a time-domain signal and output a scaled measurement. We highly recommend that check the examples located in LabVIEW before starting to create a VI for analysis. You can access the examples from NI Example Finder **(Help>> Find Examples …** ). You can search the examples with keyword(s)

We also recommend that if possible you should choose Express VIs for analysis. An Express VI is a VI, which can be configured interactively through a dialog box. Express VIs are user friendly. You can easily configure your analysis parameters. To

**Statistics** and **Histogram** Express VIs are located in **Probability & Statistics**

In the following example, VI simulates a DC signal with noise (**Figure 4**). VI also

in NI Example Finder. It also allows you to visit ni.com for more examples.

For analysis, you will frequently use **Mathematics** palette and **Signal**

access to the dialog box, double-click to corresponding Express VI.

generates a histogram and result of basic statistical analysis.

Unwrap phase Y[i] = Clip{X[i]} Y[i] = X[i-n].

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

**Figure 2.**

*Mathematics palette and signal processing palette.*

**Mathematics** palette also contains **Fitting** subpalette (**Figure 5**). This palette contains the following fitting VIs.


**Figure 3.** *Probability & Statistics palette.*

You can use curve fitting for several reasons. For example, to reduce noise, to find mathematical relationships among variables, to estimate the variable value

The following simple VI plots data and Exponential fit (**Figure 6**). You can use

You can use the **Signal Processing** VIs for spectrum analysis, signal generation, digital filtering, and data windowing (**Figure 7**). It is located in **Functions** palette. In **Signal Processing** palette, **Waveform Measurements** palette contains **Tone**

The following example in **Figure 9**, **Tone Measurements** Express VI finds amplitude, frequency and phase of a signal which is generated by **Simulate Signal** Express VI. In this example, **Spectral Measurements** Express VI generates the

**Measurements** and **Spectral Measurements** Express VIs (**Figure 8**).

between data samples or out of data sample range.

the other fitting VIs with the same manner.

power spectrum of the signal.

**Figure 5.** *Fitting VIs.*

*Analyzing and Presenting Data with LabVIEW DOI: http://dx.doi.org/10.5772/intechopen.96130*

**Figure 6.** *Exponential fit.*

**9**

#### **Figure 4.**

*Statistics and histogram express VIs in a VI.*


*Analyzing and Presenting Data with LabVIEW DOI: http://dx.doi.org/10.5772/intechopen.96130*

**Figure 5.** *Fitting VIs.*

You can use curve fitting for several reasons. For example, to reduce noise, to find mathematical relationships among variables, to estimate the variable value between data samples or out of data sample range.

The following simple VI plots data and Exponential fit (**Figure 6**). You can use the other fitting VIs with the same manner.

You can use the **Signal Processing** VIs for spectrum analysis, signal generation, digital filtering, and data windowing (**Figure 7**). It is located in **Functions** palette.

In **Signal Processing** palette, **Waveform Measurements** palette contains **Tone Measurements** and **Spectral Measurements** Express VIs (**Figure 8**).

The following example in **Figure 9**, **Tone Measurements** Express VI finds amplitude, frequency and phase of a signal which is generated by **Simulate Signal** Express VI. In this example, **Spectral Measurements** Express VI generates the power spectrum of the signal.

• General Polynomial VI

*Statistics and histogram express VIs in a VI.*

**Figure 4.**

**8**

**Figure 3.**

*Probability & Statistics palette.*

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

• General Linear Fit VI

• Nonlinear Curve Fit VI

• Cubic Spline Fit VI

**Figure 7.** *Signal processing palette.*

**3. Present with LabVIEW**

*Tone measurements and spectral measurements express VIs.*

*Analyzing and Presenting Data with LabVIEW DOI: http://dx.doi.org/10.5772/intechopen.96130*

LabVIEW includes tools for charting and graphing, 2D and 3D visualization

LabVIEW has two ways to display data in 2D. These are Chart and Graph

A Waveform Chart remembers and displays a certain number of points by storing them in a buffer. Waveform Chart displays received data in addition to

A Waveform Graph accepts arrays of data in various forms, e.g. array, wave-

You can visualize more than one data source on a chart or graph. In the following example **DAQ Assistant** take data from two channels. You can see data from all

A multi-plot chart can be displayed as overlaid plot or stacked plot (**Figure 13**). To select **Stack Plots** or **Overlay Plots** right-click on the chart. **Overlay Plots** mode overlays all plots on the same y-axis. **Stack Plots** mode gives the each plot its own

To plot y values in a chart/graph you should wire only the y array data (y values) to the Waveform Chart or Waveform Graph. LabVIEW assumes that you sample y values at regular intervals, and thus creates x values at regular intervals. If you want

form, or dynamic data. It plots all the received points at once.

channels on a chart as shown in **Figure 12**.

**3.1 Visualize your data**

(**Figure 10**) [2].

already existing data.

(**Figure 11**).

**Figure 9.**

y-axis.

**11**

#### **Figure 8.**

*Waveform measurements palette.*

*Analyzing and Presenting Data with LabVIEW DOI: http://dx.doi.org/10.5772/intechopen.96130*

**Figure 9.** *Tone measurements and spectral measurements express VIs.*
