From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to smooth a XY graph using Labview 6i ?

Solved!
Go to solution

Hello,

My main Vi captures data I sent to a XY graph

 

1.JPG

 

I would like to smooth the curve before and after ("not ok" on picture) the main Peak ("ok" on picture)

I searched on ni board and didn't find anything I could use with Labview 6i

Does anyone have a solution ?

 

Thanks in advance

 

see attached simple vi with data and graph

 

 

 

0 Kudos
Message 1 of 3
(7,182 Views)
Solution
Accepted by topic author drxl

There are several options:

  1. Use the filters in the Signal Processing palette to smooth the data.
  2. Use fourier filtering techniques to smooth the data.  Fourier transforms are also in the Signal Processing palette. 
  3. Use almost any standard smoothing technique.  See the online version of Numerical Recipes for many methods.  You will need to translate from C to LabVIEW, but this is pretty easy.  Savitzky-Golay smoothing is especially good for this type of problem.

You will need to convert your data from XY to waveform to get any of these to work.  If you data are evenly spaced, this is pretty easy.  If they are not, you will need to do some sort of interpolation.  Or you can simply ignore the fact that you have unevenly sampled data, convert to a waveform, smooth, then convert back.

 

A word of caution.  The "not OK" portion of your waveform appears to have significant features.  Putting on my physicist hat for a moment, are you sure you want those peaks gone?  This is also true of the myriad of small peaks around the main one.  Be careful.  A better approach might be removing the gain differences so you have a flat background (region about 1060nm - 1080nm), then trying to model the peaks of interest.  You could also take several data runs and average them to get rid of some of your noise, provided your X-scale is stable.  But there really does not appear to be a lot of noise on that data.  Most of it appears to be significant.

0 Kudos
Message 2 of 3
(7,171 Views)

Thanks for you reply

It's gonna be a hard work for me but I will give a try

0 Kudos
Message 3 of 3
(7,162 Views)