LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel graph smoothing

Solved!
Go to solution

Hi everyone, 

 

 

I'm looking to import data from a number of Excel files (20 seperate files) and have LabVIEW give me a smooth plot for each set of points. I then need LabVIEW to give me the cooridnates of the peak of each of these smoothed plots, and if possible plot the peaks on a graph, with the number of the file along the x-axis and the y-axis value of the peak on the y-axis. If this isn't possbile I'd be more than happy just to have a VI that gives me a smoothed data plot with a value for the maximum, but as I have very little knowledge of LabVIEW outside the realm of fairly simple DAQ reading I'm pretty clueless here

 

 

Thanks in advance for any help,

 

Ben

0 Kudos
Message 1 of 14
(6,547 Views)

Ben,

What version of LV are you using and what does your data look like - single or multi-peak data?  I might be able to help better if I had some more info.  You can fetch data from an excel workbook if you use ActiveX to "connect" to excel and manipulate the object model.  Look at the ActiveX menu on the Connectivity pallet.  Otherwise, it might be easier to save your data in a .CSV file and import using the read from spreadsheet file.vi on file pallet.  You can find peaks in a curve using the peak detector.vi (signal processing...point by point...signal operation ptbypt pallet).  I would be glad to look at some sample data if you want.

-cb

0 Kudos
Message 2 of 14
(6,526 Views)

Hi 10Degree,

 

I'm using 8.5.1 and the data (on Excel) essentially looks like two separate curves as the data I've converted was mapping a pretty noisy signal from a spectrometer. I've attached one of my Excel files so you can see what I mean

 

I also have the files saved as ACS files and .sif (the formal the spectrometer software saves in) though I doubt the later will be of any use

 

Thanks,

 

 

Ben

0 Kudos
Message 3 of 14
(6,507 Views)

Sorry, realised after posting there that I've not given the best example of what I'm experiencing with my data. The file attached to this reply should illustrate more clearly

 

Also, incase I didn't clarify earlier, I should be looking at a single peak broadband spectrum, but because of the amount of noise in the signal it looks like a high number of peaks forming a curve

0 Kudos
Message 4 of 14
(6,500 Views)

I will look at this new data.  I looked at the first batch you sent and it looks like a spline interpolation will give a nice smooth curve.  You are right, lots of noise in this data!  Is this near IR measured with a spectrometer, with column A indicating wavelength?  I will take a look at the new data and see if I can give you an example.  I think the spline will more closely pick the peak - some polynomial fits I used did not look close.  You really need to smooth this or it will pick the peak all over the place based on the noise in the signal.  I am off to a meeting but will look at this when I get back.  Interesting data.

-cb

0 Kudos
Message 5 of 14
(6,487 Views)
Solution
Accepted by topic author bencarrick

Ben,

 

I attached a VI that will show you how to use the spline to generate a smooth fit to your data. It will also compute the spline's peak using two methods, and allow you to copy the resulting spline data to the clipboard to paste into excel.  You still need to deal with the issue of collecting your data - these types of data analysis / workflow things are always a bit hard to work through.  You can copy your 2-column data from an excel workbook and paste it into the string constant on the block diagram to analyze another curve.  Take a look at the attached vi and see if it gets you pointed in the right direction.

 

-cb

Message 6 of 14
(6,475 Views)

Thanks 10Degree, that's exactly what I needed. Sadly there's nothing I can really do about the standard of our data, we have a highly sensitive detector paired with a very tempremantal spectrometer whichg leads to all kinds of problems!

 

Thanks again for your help, it would have taken me weeks to work this out myself!

0 Kudos
Message 7 of 14
(6,450 Views)
Hey 10Degree, can you also save this VI in 8.2? Thanks in advance.
0 Kudos
Message 8 of 14
(6,245 Views)
Eunsal, see if this works.  -cb
0 Kudos
Message 9 of 14
(6,204 Views)

10Degree (or whoever), would you mind if possible posting the above vi in version 7.0 or a screencapture of the block diagram?  I found this post while doing a search and I believe your vi could assist me in something I am working on or at least be close to what I need with smoothing (and Excel).

 

I just don't have a newer version of LV to open what has been posted.

 

Thanks.

 

 

Using Labview 7.0 and 2010 SP1 with Windows XP and 7.
0 Kudos
Message 10 of 14
(5,763 Views)