11-04-2015 10:49 AM - edited 11-04-2015 10:51 AM
@DougFerguson wrote:
I have basically a Gaussian peak that I need to take the 2nd derivative of. The polynomial solution doesn't fit well.
If you know you have a Gausian peak, then you should fit the raw data to a Gaussian. You would reduce the data to three parameters (area, position, width)
Why do you need the second derivative?
Once you have the best fit paramters, you can generate the second derivative noise-free and perfectly.
11-04-2015 11:05 AM
Using the 2nd derivate of a Gaussian peak is a technique used to identify peaks in a noisy signals typical in HPLC, GC, and TLC speration methods.
Thats what I am investigating now. The peak shape is a puesdo Gaussian. Due to the physical method of pushing the sample through a column, the leading edge is steeper than Gaussian and the trailing edge is shallower. I am suspecting that perhaps I need to adjust the raw data to fit a true gaussian peak then take the 2nd derivative, but worry that doing so would aryficially shift the peak identification and thus the alter the calculated area under that curve.
11-04-2015 11:14 AM
@DougFerguson wrote:
Using the 2nd derivate of a Gaussian peak is a technique used to identify peaks in a noisy signals typical in HPLC, GC, and TLC speration methods.
Do you have some references that describe the method? (If you have a noisy signal, the second derivative will be even noisier!)
@DougFerguson wrote:
Thats what I am investigating now. The peak shape is a puesdo Gaussian. Due to the physical method of pushing the sample through a column, the leading edge is steeper than Gaussian and the trailing edge is shallower. I am suspecting that perhaps I need to adjust the raw data to fit a true gaussian peak then take the 2nd derivative, but worry that doing so would aryficially shift the peak identification and thus the alter the calculated area under that curve.
If you have a mathematical model for the pseudo-Gaussian, you can still fit, but maybe you need one or two additional parameters for the asymmetry.
As Gerd already mentioned, it would really help to see some typical data. How many points do you have covering the peak? (a dozen? a million?)
I also assume that your data is spaced equally in x. This thread originally was for unevenly spaced data so you should probably have started a new thread instead.
11-04-2015 11:22 AM - edited 11-04-2015 11:26 AM
Methods for using the 2nd derivate as it relays to HPLC techniques aren't overly forthcoming. Typically it is either industry confidential or buried in Journals for chromatography. I don't have access to those journals first hand and have been working through our radiochemist.
Here is an example of a Gaussian peak. http://research.stowers-institute.org/efg/R/Statistics/MixturesOfDistributions/
But as I said my peaks aren't quite Gaussian, so I am currently working to rehsape them to see if I can reproduce the expected shape of the 2nd derivative.
I have attached a smaple data set
11-04-2015 11:34 AM
Hi Doug,
Its kind of insulting to assume I did not.
Is it insulting to ask for sample data when the OP and the other follower both offered data they want to get fitted - but you didn't?
As you now follow my advice: There are 4 peaks in your data set. Do you want to fit them all?
(And I would recommend to use a format like "%.3e" for saving the data instead of "%.3f".)
11-04-2015 12:35 PM
Ok, I refitted data to be a best fit Gaussian and then took the 1st and 2nd derivatives. The plot looks as expected to publications. As I suspected, the puesdo gaussian shape distores the result of the 2nd derivative to be less conclusive. I guess if I want to pursue the use of this method to identify the peaks then I will need to refit the data to a gaussian peak.
11-04-2015 01:11 PM
If it is not a gaussian, then you need to fit to a distorted Gaussian.
As Gerd mentioned, you need to save with more significant digits. Currently, the data is quantized to three decimal digits, which seems below the noise.
How many bits does the detector produce?
You have plenty of data across the peak and the current noise is below the resolution of the saved data.
I assume you are interested in the central peak. Are you?. I think taking an accurate second derivate should be possible directly. Adjacent points are highly correlated, so you can apply significant filtering. Can you show us what you tried?
11-04-2015 01:28 PM
I simply use the Write to Spreadsheet file.vi to upload data here. By default the format is %.3f. The actual raw data is in a larger data set being sent back from the device and I didn't feel it was super important to the gist of the question asked to present the data in its raw format.
As I have explained, the unexpected behavior in the 2nd derivative is due to the peak not actually being a Gaussian peak. Once I fit the original peak to a Gaussian fit the method works well to identify the peak, start and end. I suspect that users of this method heavily fit the peaks to handle this. However with a single resolved peak this is quite over kill. This method do becomes pretty useful when two adjacent peaks don't resolve.
11-04-2015 01:58 PM
Even with the noise, you see all main features in the raw second derivative. Isn't that sufficient?
11-04-2015 02:32 PM - edited 11-04-2015 02:33 PM
After convoluting with a 25 point wide cosine peak (or similar), the derivatives seems quite nice, even the third derivative looks quite good.
(Sorrry, using my own tools. Cannot attach, but the above information should be sufficient).