Multiple Gaussian Peak Fit for Wavelength Spectrum
Hello.....
First, let me confess to being a relative noob..... So please be gentle.
I am trying to create a vi to analyse an optical spectrum of the form: Intensity vs. Wavelength. This vi would need to do the following:
1: Read the input data file.
2: Set a noise floor, below which all data will be ignored.
3: Scan the spectrum and identify the amplitude, width, and center of any peaks that are above the noise floor. There will be multiple peaks present (as many as thirty or so).
5: Fit a gaussian to each peak.
6: Sum the gaussians and create a new data file from this sum.
So..... I know what I want to do, just not the best way to do it. Is there a vi already in labview that will do this for me? The Gaussian fit vi seems only really useful if you want to fit a curve to a single peak. If I need to build this from the ground up, which is fine since I need the practice anyway, what would be the best way to start?
Thanks in advance for any help.
nia
Hello Nia,
There are many ways to approach this problem. By chance, do you have access to the sound and vibration toolkit for labVIEW (http://sine.ni.com/nips/cds/view/p/lang/en/nid/209056)? That toolkit will make performing the signal processing tools which will make creating this VI much easier. The following links may also be helpful for getting started with your issue
http://zone.ni.com/reference/en-XX/help/371361J-01/glang/file_vis_and_functions/
http://zone.ni.com/devzone/cda/epd/p/id/5742
http://zone.ni.com/reference/en-XX/help/371361J-01/lvanls/signal_processing_vis/
https://decibel.ni.com/content/docs/DOC-4475
https://decibel.ni.com/content/docs/DOC-17986
http://zone.ni.com/reference/en-XX/help/371361H-01/gmath/gaussian_peak_fit/
Thanks
Doug W
Applications Engineer
Applications Engineer
National Instruments
Similar Messages
-
Multiple gaussian peak fitting
I have LabVIEW 7.5 How do I fit multiple gaussian peak (amplitude) with Labview. Is there a package to do this or do I have to start from scratch.
ThanksI don't think there is a LabVIEW 7.5.
Fitting multiple peaks is necessarily ambiguous because there will always be multiple solutions (e.g. swap all parameters of two peaks and you'get an equally good fit). It will be important to have good initial guesses.
An amplitude alone does not define a gaussian peak, each peak also has a position and width so you'll have to fit three parameters per peak. Is the number of peaks fixed or can it be variable? Do all have the same width?
The nonlinear fitting VIs have been extensively revised with LabVIEW 8.0. Doing the same in LabVIEW 7.x would involve quite a bit more work. LAbVIEW 8.0+ even includes an example that demonstrates fitting a function that is the sum of three gaussian peaks plus an offset. That example would be a good starting point for you.
LabVIEW Champion . Do more with less code and in less time . -
Gaussian Peak Fit and Nonlinear Curve Fit on small data differ from Origin Peak fit
Hi all,
I am developing a program in which I have to fit Gaussian curve on only 4 or 5 data points. When I am using Gaussian Peak Fit or Nonlinear Curve fit, it linearly connects all the points while other fitting software like Origin is fitting Gaussian curve on the same set of data I have attached two images One is from Labview with Gaussian Peak Fit and NonLinear Fit and other is from Origin.
Data is
X Y
799.09857 257
912.25256 641
1026.00366 1516
1137.92871 1118
1253.43713 329
Labview user
Solved!
Go to Solution.
Attachments:
Origin_Fit.PNG 21 KB
Labview_fit.PNG 15 KBThat looks like a plot of the input data.
When I run it with your data I get a Gaussian curve which looks much like your Origin plot.
The Plot 2 curve is from 128 points equally spaced along X and Y calculated from the Gaussian formula in the LV help using the output parameters from the fit. Plot 1 is the Best Gaussian Fit output from the fit VI. It only has five points.
I used default values for everything except X and Y.
Lynn -
Does anyone know how LabView determines standard deviation on their Gaussian Peak Fit VI?
The VI reports standard deviation that is quite high. I am wondering if they go out to 5-sigma or something along those lines.
If anyone has had this same issue, please let me know
Thanks in advance!Interesting you mention the robustness of the algorithm. I have heard in the past that it is not very good. In fact, the data you feed into it must be VERY Gaussian otherwise the fit is just garbage. Luckily for me, my data is quite clean, see the attached picture.
You also mention Levenberg-Marquardt. Is a VI available somewhere or would I need to write my own?
Thanks for your prompt reply!
Attachments:
GaussFitAttachment.docx 26 KB -
How to fit multiple guassian peaks ?
Hi,
I have a two column data set (x,y) that contain large number of Gaussian peaks ( several hundredes infact). You can think of it more like a wavelength spectrum. The number of spectral peaks is not known exactly. There is no problem in detecting the peaks as they are of same amplitude. Eventually I want to fit a Gaussian funtion to each of these spectral peak and obtain the the parameters such as amplitude, line-center and sigma. This seems a somewhat tricky in LabVIEW. There is an example ( Sum of 3 Gaussian with offset) that comes bundled with LabVIEW. This example VI however uses a static refrence to a model function which is sum of three gaussian curves. This works well for few number of peaks in the data. If we have large number of peaks ( e.g spectroscopy data) then creating such a model function for a large number of peaks is nealy impractical. Is there a better way to handle such peak-fitting problems in LabVIEW? Would greatly appreciate if someone could point out any existing LV code/library function.
Regards,
RK
Solved!
Go to Solution.Many Thanks Altenbach. That was something I was after. I've attached an example data file of the sep...
Regards,
RK
Attachments:
multi-peak-spectra.txt 1128 KB -
Gaussian and Lorentzian peak detection for spectroscopy
I am trying to automate some data analysis for a large number of Raman
spectra, and would like the option of using a Gaussian or Lorentzian peak
fit (the included VI is some sort of a parabolic fitting algorithm). Is
there a way to do this with any of the VIs in the full development system
(or has anyone already made such a VI), or am I going to need to just write
some C code and use the code interface node?Scott Williams wrote:
>
> I am trying to automate some data analysis for a large number of Raman
> spectra, and would like the option of using a Gaussian or Lorentzian peak
> fit (the included VI is some sort of a parabolic fitting algorithm). Is
> there a way to do this with any of the VIs in the full development system
> (or has anyone already made such a VI), or am I going to need to just write
> some C code and use the code interface node?
On my web site you can download a routine that makes a fit to a
Gaussian peak. It first estimates the width, offset, amp., etc, so that
the non-linear fit has a chance to converge. You may be able to
generalize this to do a Lorentzian as well.
Go to www.originalcode.com, then click on Example Code, Utilities,
and Downloads.
Dave
David Thomson 303-499-1973 (voice and fax)
Original Code Consulting [email protected]
www.originalcode.com
National Instruments Alliance Program Member
Research Scientist 303-497-3470 (voice)
NOAA Aeronomy Laboratory 303-497-5373 (fax)
Boulder, Colorado [email protected] -
How do I print multiple PDFs AND fit them to my paper size?
Hi,
I'm using a 24 inch wide plotter with roll paper. I want to be able to print multiple PDFs AND fit them to a specified paper size. I can print one page and fit it to the paper, but I can't do it with multiple PDFs.
For example, I have two PDFs that are only 8x8 inches. I want to print them side by side on a 24 inch x 12 inch page size and fit them to size and then FIT them to the page size so the end result will be 2 PDFs printing at 12 x 12 side by side.
I can't seem to be able to do this. I'm sure I was able to do this using earlier versions. As it is, I have to print one at a time and waste half of my roll paper size.
Any help?
Adobe Acrobat Pro, Windows 7 Proffesional, HP Designjet 111 roll fed plotter.
ThanksNote this illustration is Based on Mac version of HP Print Driver standard inkjet. However Control should be smilar Layouts and titles may be different:
Adjust items shown according to pages desired -
Getting errors in Guassian Peak fitting
Hi all,
I am trying to fit Guassian curve on following data
Index
Value
12
237
13
214
14
214
15
218
16
254
17
236
18
271
19
243
20
278
21
282
22
272
23
296
24
309
25
312
26
337
27
342
28
344
29
344
30
358
31
373
32
425
33
432
34
436
35
466
36
508
37
553
38
596
39
613
40
663
41
701
42
744
43
808
44
859
45
924
46
988
47
1059
48
1188
49
1299
50
1415
51
1542
52
1631
53
1775
54
1929
55
2018
56
2225
57
2458
58
2679
59
2956
60
3229
61
3408
62
3666
105
3546
106
3286
107
3023
108
2789
109
2598
110
2385
111
2187
112
1986
113
1841
114
1701
115
1616
116
1485
117
1356
118
1271
119
1165
120
1084
121
1013
122
945
123
884
124
827
125
785
126
721
127
660
128
620
129
606
130
581
131
535
132
519
133
500
134
462
135
438
136
449
137
426
138
381
139
375
140
366
141
338
142
342
143
335
144
302
145
313
146
293
147
291
148
282
149
276
150
275
151
280
152
269
153
255
154
250
155
252
156
248
157
252
158
255
159
242
But Guassian peak fit vi is fitting curve only for one side lobe. result is attached. Can anyone tell me how to avoid this problem
Labview user
Attachments:
Fit.png 25 KB
data.xls 21 KBTry specifying an initial guess. I used:
initial amplitude = 6000
initial center = 80
initial standard deviation = 10
initial offset = 200
-Jim -
Highest peak rates for replicated DVD-9 or DVD-5?
Which is the highest peak rate that is most commonly used for replicated discs for all the data streams, and for video? I've tested some well authored popular mass production music dvds with DGIndex and often found video peak rates to go over 8.5 or even 9.
Still quite often it's said for example here http://www.createspace.com/Special/AuthoringNightmares/03/BitsAndBytes.jsp?cfxwasredirect ed=true
that for replicated discs you shouldn't go over 8Mbps rates for video.
I'm having one subtitle track and, 2.0 Dolby Digital and 5.1 Dolby Digital audio tracks in my project, but if the spec says the peak limit for all the assets in DVD-video is around 10Mbps, 9.8Mbps (as I think Neil referred in his alternate bit budgeting guide: http://www.adobeforums.com/webx/.3bb7dccd ) or as 9.6 (as I think Neil referred in: http://www.adobeforums.com/webx/.3bc2e248/0 ) why the video peak rate needs to be that much under what would be possible to be used with subtitles, 2.0 and 5.1 audios? There is like 0.448 Mbps for 5.1audio, 0.256Mbps for 2.0audio, 0.04 Mbps for subtitle, it would leave at least 8.5 Mbps for video? So, it is a little bit confusing what really is the usable DVD peak for replicated DVDs (DVD-5 or DVD-9)? Is it ok in my project to use 8.6Mbps for video if it fits the 9.6Mbps or what ever is the exact scope?HI David - if going to replication on DLT then you can max out the bit rate if you wish to... however you need to think about whether you need to.
There is a law of diminishing returns here - anything above about 8mbps and I doubt anyone except a well trained 'eye' could see any difference in the quality. All you'll be doing is increasing the file size. Also, it's worth remembering that there are still players which have trouble reading higher rates off a replicated disc (check the DVD FAQ - section 1.41 makes for interesting reading, although not all of these are down to high bit rates, of course).
I tend to encode at various rates with short samples of material and look for the differences. Where I can't see any, I opt for the lower rate. So far this has served me well!
Don't forget that a duplicated disc is using a very different material for the reflective layer and it is far less reflective than a replicated disc. This is largely why you need to keep the duplicated disc bit rate low - players struggle to read the higher bit rates from the less reflective surface and so stutter on playback.
Personally, if you can't see any difference between 7mbps and 9.8mbps I'd advise staying at 7. If there is a difference for your footage then try again with 8mbps, but don't be lulled into a false sense of security over the fact that a replicated disc should be able to have 10.08mbps combined bitrate... the quality of the player is really the issue. Whilst most will, some won't, though all should! -
How many drive replacements before computer considered not fit for purpose
My Optical drive on my £2500 MacBook Pro has failed for the 3rd time and whilst I am sure my local Mac centre will fix it again I am beginning to feel that my Macbook Pro isn't fit for purpose.
Has anyone else managed to have one replaced for repeated Optical Drive Failures?
Cheers
NIckI had multiple fails but also some other problems - I'm not sure if that helps, but they did swap the machine, so it is possible. But you need some luck in finding the right person to help you in the Apple Store.
I bought a Macbook Pro in 2007... put simply, it was a total lemon. 2 superdrive failures, the screen went, logic board, keyboard, plus RAM problems. And Apple would simply not replace it. Repair after repair. Back and forward to the Apple Store, wasting days of my life - and getting that "scratched record" response that they wouldn't replace it was so frustrating.
In the end, I just got the right employee at the right time, and I'm afraid its as arbitrary as that.The guy worked in the Regent Street store, and he had dealt with me a few times. He instructed me to come back with all my repair paperwork (so make sure you keep all yours). So I came in with 6 repair documents and they swapped the machine. It was a final Superdrive failure that triggered the eventual swap.
Alas the next machine did not fare much better - TWO MORE Superdrive failures, a keyboard, case and two screens. Rubbish.
I just bought (reluctantly) a new i7 MacBook Pro - and guess what - Yep, the optical drive DOESN'T READ CDs!!! Spits them out. Straight out of the box and AppleCare are telling me to take it into a store to get it fixed.
Seems that quality has dropped through the floor. I hope you get sorted out. -
HT204053 can you have multiple apple id's for the family but we all use the same iCloud?
Can you have multiple apple id's for the family members but we all us the same iCloud account?
You'll have to have an ID you all share in order to have a shared iCloud account. It would be sensible for each person to have their own ID and their own iCloud account for email and their own data (each would be on their own computer/iOS device or user account on a Mac) and then have a common account which everyone would sign into in System Preferences>Mail, Contacts and Calendars to access shared data.
You don't want to be all using the email in a common account - if people are using email aliases remember these can't be detached from the account and transferred to another one. Having all your emails mixed up together can be somewhat impracticable. -
Multiple TYPEELIM property values for an account
I am trying to set automatic adjustment business rules and need to assign multiple multiple TYPEELIM property values for an account. Any idea how to achieve this?
Here is my example. Letu2019s assume there are 2 eliminations I need to do.
Elimination 1: Account A, B, C going to Account Y
Elimination 2: Account A, B, D going to Account Z
For elimination 1, to group source accounts (A,B,C), I want to assign u201CELIM1u201D for TYPEELIM property to all source account (A,B,C).
For elimination 2, to group source accounts (A,B,D), I want to assign u201CELIM2u201D for TYPEELIM property to all source account (A,B,D).
As you see, accounts A and B are repeated in both cases. I am not sure how I can assign both ELIM1 and ELIM2 property for these two accounts.
Options I have thought of:
1. Include automatic adjustment line by line: But since I have many accounts, this will be very lengthy and not good from maintenance point of view.
2. Include one ELIM1 in TYPEELIM and ELIM2 in Dimlist: But my real case is more than just two elims as mentioned above. What if there are 4 elim and includes same account?
Any idea on this?
Thanks in advance.Hi,
http://help.sap.com/saphelp_bpc75/helpdata/en/5A/69200C88AA40C9B18844A25259F147/frameset.htm
Administration->Business Calculation->Business Rule Management->Automatic Adjustment->Automatic Adjustment Detail
This is for 7.5, but majority of contents are not changed from 7.0.
Regards,
YH Seo -
How to configure multiple listeners to listen for the same instance.
Hello everyone,
I am running oracle database 11g and I want information regarding how to configure multiple listeners to listen for the same database instance. Actually I know how to configure more than one listener but the main thing that I am confused about is when we create listener.ora file, do we have to statically register the database instance with both the listeners or the instance will register itself with both the listeners.
According to my knowledge the instance will register with the listener specified by LOCAL_LISTENER parameter and we cannot have more than one value for this parameter.
Please only give detailed answers with example as I am tired of simple answers with details that I already know.Hello,
Yes, it can make sense to have several listener for one Oracle instance. For instance you may have one listener for the applications another listener for DBA administration tasks as well as one listener dedicated to dataguard broker. It is not possible to have several listeners listening on the same IP and Port.
By default the database try to automatically register to a listener on port 1521. To instruct the instance to register to a specifc list of listeners you can add in the init.ora the local_listener parameter with an alias definition:
i.e
local_listener=MY_SET_OFF_LISTENERS
in your tnsname.ora add an entry called:
MY_SET_OFF_LISTENERS_LOCAL= (ADDRESS_LIST=
(ADRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1530))
(ADRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1531))
(ADRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1532))
In this sample your instance will register to three listeners listening on respectively port 1530, 1531 and 1532
If you want your clients can be balanced over the 3 listeners -
How do I add multiple rows in Numbers for iPad?
how do I add multiple rows in Numbers for iPad?
Hi James,
On the iPod I can only insert what is on the clipboard but I can insert however many rows I have there. Is it working differently for you? Benjoon seemed to think that he could not do this in Numbers. He was ruling Numbers out because of it. He doesn't need to do that because of this issue.
If I was needing to insert multiple blank rows often I might keep a table of blank rows or just some blank rows at the end of the working table that I could copy/paste. This is no different than Numbers on the Mac.
quinn -
I have a brand new macbook pro 15" with latest Lion. Can anyone tell me why, when I open word or preview etc that multiple files open?For eg if I open a word doc, the last 1-3 docs that I have worked previously on all open. Can anyone tell me why?
You have a choice as to whether or not applications in Lion like Word or Preview (or even Safari) save and re-open previous documents or windows... just hold down the option key while quitting a program and when you re-open it you won't get the previous documents or windows when you re-open the application. You can see this by selecting the open program in the menu bar and when holding down the option key the quit function will change to quit and discard open windows. This feature in Lion is referred to as "Resume" and is great if you want to restart an app and return to what you're doing (for example in Safari re-opening existing windows and tabs from your previous session). You still have the option to close individual windows within an app before quitting and they will not re-open when the app is launched again.
This Resume function is not related to saving your work (a word or text document for example). This is handled by Lion's "Auto-Save" and "Versions" functions. See http://www.apple.com/ca/macosx/whats-new/auto-save.html
Hopefully this is the complete answer you're looking for.
Maybe you are looking for
-
As of BI 3.2, does anyone know which infoprovider provides these queries as they are not part of 0IC_C03, Material Stocks/movement? 1. Q0002 Inventory Days of Supply - Quantity 2. Q0003 Inventory Days of Supply - Value 3. Q0004 Fini
-
How to get this query???
hi, 1).i want to know how to suppress duplicate rows in table. 2).i want to know how to delete last two rows in table. help me thanks in advance. sai.
-
Restarting loop after update to 10.5.7!
Hey Guys, I have a serious problem with OSX after updating to 10.5.7! I updated through Software Update and the macbook restarted. After that it went into a restarting loop. It boots-up, the logo and moving circle appears, and then it restarts. I tri
-
Add eventlistener to catch after save document event?
How can I catch a after save document event? Best regards / Pontus
-
ATG development tools in Eclipse
Hi, Need information on where to find the ATG Development tools for eclipse. Below chapter refers to non-existent url (http://www.atg.com/eclipse) http://docs.oracle.com/cd/E23095_01/Platform.93/ATGInstallGuide/html/s0108installingatgdevelopmenttools