01-09-2019 10:23 AM
Hello everyone,
I know this question has been answered in different posts on this forum. but I don’t know how to start. I've attached the I've written thanks to the help from the good people on this forum. The images taken by the CCD camera for each scan should look like the attached sketch (see fig 1). For each spot on the sample, there are 5 scans of 20 each; I want to insert a peak detection VI that detects and save the positions of the maxima of the 3 tallest peaks for each scan in real time. I then want to average and save these positions over all the 100 scans before moving to the next spot. Your help will be very appreciated.
Petmar.
Solved! Go to Solution.
01-10-2019 11:40 AM
I do not see any peak finder in your posted VI. It looks like you CCD camera is only giving a line of values. This is one way to do it, but you need to verify.
Edge cases, assume 3 peaks A, B, and C
Example
mcduff
01-10-2019 02:08 PM
Hello mcduff,
The images I have attached are an interference fringes taken by a CCD line camera. Sometimes the peak positions and amplitudes vary; sometimes even the number of peaks vary when there is significant disturbance to the setup. I have a vibration isolation system so if there’s no significant disturbance and the laser remain fairly stable I should have the three peaks. You are right that the CCD is taking these images and giving out lines of values. What I want to do is that in the ideal situation where there are three peaks, that the peak finder detects and record the positions and amplitudes of the three tallest peaks shown by the CCD. The second step is to get the average position of each of the three peaks for each complete run (100 scans). When the conditions are not idea to permit three peaks I still want to continue with the scans but the data will be discarded. Please will what you suggested do this? Thank you.
Petmar.
01-10-2019 02:19 PM
Look at the peak finder VI and make sure you have it set correctly to identify your peaks. You will need to adjust the width and threshold. Depending on your data you may need to smooth it before using the peak finder VI. The peak finder VI returns the number of peaks found, if that value is less than 3, then you can discard the results.
Alternatively, you could write a function that fits your peaks to 3 Gaussian functions, (search the forums for Altenbach's posts he is really good at this), once you fit the peaks, use the fitted values for your position and amplitude.
mcduff
01-10-2019 02:25 PM
Okay. I'll do as you've suggested and get back to you. Thank you.
01-14-2019 10:58 AM
Hello mcduff,
This is what I did following what you posted. I have tried it but it doesn't detect any peak. Please see what I did wrong. Thank you.
Petmar.
01-14-2019 04:20 PM
Send some example data. In the plot on your VI there are no peaks. You also need to add the whole array, change your 3 element array such that it is using a shift register, not autoindexing.
mcduff
01-15-2019 09:43 AM
Hello,
Please pardon me for often responding late to your posts. I only have LabVIEW on the lab pc so I don't have access when I'm out; my student free trial time has elapsed. I have attached the data the VI is currently giving me, but it really don't understand it. What I want is for the VI to give the locations of the three peaks and their corresponding amplitudes and for each scan (and the average over all the 100 scans for each spot). Please see attached image. Thank you.
Petmar.
01-15-2019 10:56 AM
In LabVIEW make a plot of the data you want to fit, then save that data as default data. Then attach that VI to the forum. I do not know how to read your files.
mcduff
01-15-2019 11:48 AM
Here's it. Thank you.
Petmar.