george seifert Posted October 14, 2009 Report Share Posted October 14, 2009 Could someone else please run the attached VI (LV 2009) and see what results you get? This is a VI where I'm generating a waveform so that I can test some detection methods. I was very surprised to see the values that the Waveform Peak Detection VI returned. It should return 3 peaks at 1.0, 1.3 and 1.1 since that's what I generated. It returns 1.1, 1.43 and 1.21. What the heck's going on? test cap charge detect.vi George Quote Link to comment
smenjoulet Posted October 14, 2009 Report Share Posted October 14, 2009 What the heck's going on? George, It is interpolating the data. From the detailed help for the Waveform Peak Detection.vi: Locations contains the index locations of all peaks or valleys detected in the current block of data. Because the peak detection algorithm uses a quadratic fit to find the peaks, it actually interpolates between the data points. Therefore, the indexes are not integers. In other words, the peaks found are not necessarily actual points in the input data but may be at fractions of an index and at amplitudes not found in the input array. To view the locations in terms of time, use the following equation. Time Locations = t0 + dt*Locations Amplitudes contains the amplitudes of peaks/valleys found in the current block of data. What's wrong with the Threshold Peak Detector that you also have dropped on your diagram? That should give you the correct results. -Scott Quote Link to comment
george seifert Posted October 14, 2009 Author Report Share Posted October 14, 2009 (edited) George, It is interpolating the data. From the detailed help for the Waveform Peak Detection.vi: Locations contains the index locations of all peaks or valleys detected in the current block of data. Because the peak detection algorithm uses a quadratic fit to find the peaks, it actually interpolates between the data points. Therefore, the indexes are not integers. In other words, the peaks found are not necessarily actual points in the input data but may be at fractions of an index and at amplitudes not found in the input array. What's wrong with the Threshold Peak Detector that you also have dropped on your diagram? That should give you the correct results. -Scott I can understand if found a point that was actually within the data set, but the peaks it found are all greater than actual points in the data set. The max value in the data is 1.3, but it returned 1.43 as the max. How could an interpolation come up with that value? The Threshold Peak Detector I have doesn't return the same data as the Waveform Peak Detector. The Threshold Peak Detector returns values at the start of the ramp whereas the the Waveform Peak Detector returns the peak (or in my case - values beyond the peak). I also noticed that the locations given of two of the peaks are way off. One is way beyond the peak. I thought maybe I could use the location to give me the peak amplitude instead of using the interpolated amplitude, but that method gives even worse values. This VI is totally worthless. George Edited October 14, 2009 by george seifert Quote Link to comment
smenjoulet Posted October 14, 2009 Report Share Posted October 14, 2009 I can understand if found a point that was actually within the data set, but the peaks it found are all greater than actual points in the data set. The max value in the data is 1.3, but it returned 1.43 as the max. How could an interpolation come up with that value? It's doing a quadratic fit on the data first and then doing the interpolation on the fit. With your sawtooth, I guess the fit isn't very good, so you get values way beyond your peaks. It's probably better used for continuos data, than discontinous data like a sawtooth. Still the locations are pretty close, so I think you can use those in some fashion to get your actual peaks. Take a look at my modification. I haven't used the Threshold Peak detector in awhile, so my memory of it was incorrect. -Scott test_cap_charge_detect_2.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.