Fitting multiple gaussians to curve

Hi,
I'm collecting a data array and saving it to a spread sheet. I can plot this on an xy graph however in order to process the data i need to separate the curve into separate gaussians. In theory decimating the curve should do what i need but I can't figure out how to make this work. Can i do this using point by point, or is there a way of converting each line into a wave to process it in this way?
The attached files are the basic vi that im using to read the saved file and an example file. I haven't included any of the errors as i've made as they haven't worked. I hae tried a simple guassian fit but as the peaks are overlaid on each other it isn't working and i feel sure that theres a better way of doing it than multiple iterations of this, particularly as the number of peaks varies.
Thanks!
Attachments:
cut analysis 2010.vi ‏73 KB
selected spectrums.xls ‏848 KB

Hello and thanks for using the forums.
If I understand your query correctly, you would like to be able to split your data into separate plot instances on the same XY graph in the simplist way possible. I have attached an altered version of your VI which will plot each gaussian separately.
If I've misunderstood your query please feel free to provide some further clarification.
Kind Regards,
Paul
http://www.paulharris.engineering
Attachments:
Separate Gaussians.vi ‏62 KB

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.
    Thanks

    I 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 .

  • 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

  • Fitting multiple peaks under a curve?

    Hello all,
    I've recently come back to LV (after using it for hardware control) and am now using it for data manipulation. Basically I'd like some pointers regarding fitting.
    The set-up I'm using collects scans every 20s for hours on end, generating tons of data. I can fit multiple Lorentzian curves under the peaks (see attached for typical data file and screen shot of fitting) using Origin manually but obviously if I could automate this and implement it in real time as the scans are acquired I will be saving a great deal of time and effort..  
    The positions of the peaks are unlikely to change (much) but the heights and widths may do.. will this cause a problem? Im very interested in following the change in the area of the third peak (as you see it on the screen shot) as time passes...
    Finally I'm fairly familar with 8.2 but have been tasked with having a look at 2009 (which i currently have an evaluation version of), the main deciding factor in us upgrading is the new 'constrained' Lv fitting Vi, can anyone explain what the difference is and would it help in what I'm trying to do?
    Any thoughts and ideas are much appreciated,
    Kind reagrds,
    David.
    Attachments:
    plotx.txt ‏2 KB
    origin lor 3 peak fit.PNG ‏45 KB

    Hi,
    I can see how to get the curve fitting but how do you then apply the guassian fits to the peak locations? I'm struggling to achieve this using the fitting vis?
    Cheers!
    Daniel

  • 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

  • Improving the fit of a LINEST curve

    I am using the LINEST function to derive a formula to predict values in a spreadsheet. The x values I am using to predict y are x^0.5, x, x^2 and x^3. Despite using four x variables, and the observed values falling on a smooth curve, the fit of the LINEST curve is not good. What is the best way to make it fit better? Should I just keep adding more powers of x until it fits perfectly?

    Hi Richatom,
    I don't think you will gain more understanding by adding more powers of X. It looks linear to me (red line added by guessing )
    Is there some reason why you need a complex fit?
    Perhaps you could explain how you made the measurements. What variation is normal in this kind of observation? What other factors might influence the observed measurements?
    More information will lead to a solution .
    Regards,
    Ian.

  • Gaussian Membership Curves in System Build FuzzyLogic block

    Hi,
    As noted in the SystemBuildTM FuzzyLogic Block User Guide (ver. Apr 2007), one can create a triangular membership curve by simply using the special function:
    TRG(x,a,b,c)
    Is there by any chance another special function to create a Gaussian membership curve (such a membership curve is very common in fuzzy control applications)? If not, any ideas on how I could define it myself, as I really need to use a Gaussian membership curve instead of a triangular one.
    Many thanks.
    Solved!
    Go to Solution.

    Ok, for those of you who might be interested in using a Gaussian membership function, I've just found a way to define it in the Fuzzy Logic block using the exp function, as follows:
    exp(-0.5*(X-c)^2/b^2)
    where
    c is the center of Gaussian function, and b^2 is the variance.

  • Fitting a Gaussian curve onto a set of data

    I'm looking to plot a best fit Gaussian curve unto a set of data and was wondering if this is possible with just the labview 7 base development software. Any help would be greatly appreciated

    I assume you are trying to find a gaussian ditribution function to fit to the data. All you need is to find the average and the sample standard deviation of your data and then build the Gaussian function. You can plot that, you can also plot a histogram of your data to compare to the Gaussian plot.
    With little programming code, you should be able to do that.

  • Resizing Stage to fit multiple screens

    Hi, I'm designing a Flash website and I want the stage to
    fill the viewer's screen, similar to www.s-w-h.com. I've always
    designed flash sites with one particular size in mind, never for
    multiple screen sizes. I know there's a Stage.onResize property I
    can use, but I'm sure there must be a limit to the actual size of
    the viewers screen, otherwise it would kill my layout and design.
    I'm wondering whethere there's a technique flash designer's use to
    effectively and optimally resize, i.e. choose only 3 stage settings
    and work around them, or 3 browser types (IE, Safari, Firefox) and
    work from there. I ask this because I have also noticed that my
    Firefox browser fits my whole screen while my Safari browser does
    not. So there are many variables to consider. What would be the
    best way to apprach this?

    Check out the Stage class in Flash. It lets you know the
    actual width and height of your clients browser. You can add a
    listener to your main movie to look for onResize events.
    That is a great website.
    Let me know if you need some extra pointers.
    Cheers
    Gorka

  • How do I get multiple object to curve (like a smile/frown)?

    I'm trying to get these shapes to curve up, like a smile, and then curve down, like a frown, as the word changes to "misery." (The middle object stays in place, the objects on the outside rotate upwards and downwards) I've looked up several tutorials but I can't find exactly what I'm looking for. Any suggestions?

    You could use several of the effects in the Distort category to achieve this... witht the effect applied to a precomposition layer, of course.
    That said, I'd probably start with the Puppet tools:
    http://helpx.adobe.com/en/after-effects/using/animating-puppet-tools.html
    [edit: It looks like Dave and I were typing at the same time and thinking the same thing.]

  • Scale to fit multiple resolutions

    How can I  scale  flex  to fit a screen no matter what size the screen it is.
    Thanks
    Jim

    yes u can. also use width and height of used component in percentage to get component stretched

  • Will I be able to fit multiple Sims 3 games on my new MacBook Pro/how to transfer ALL music to new laptop?

    I'm receiving a new MacBook Pro for the next school year. I really would like to know if the Sims 3 base game, Late Night and Generations plus a bunch of extra custom content would fit on my computer and still run fast/without problems? Also, I really must know how to move every bit of music from iTunes and other music purchases from other music databases onto my new computer.
    I hope this is enough information.
    Thank you so much!

    If formatted NTFS, your Mac can read, but not write to the drive.

  • Fitting multiple videos onto one disk

    I have have 15 videos from a conference (each aprox 1hr in length) and I was wondering if somebody knew of a compression format that would compress the videos using compressor into a format that DVD SP would recognize, with the whole video/audio files being around about 200-300 MB each so that they could all fit on one DVD. quality is not the concern here, I only need DVD SP to recognize the format. I have tried H.264 because I seem to have maximum control over bit-rate with the H.264 codec, however DVD SP does not recognize the H.264 files (at least not with the compression settings I set in compressor). iDvd recognizes the same H.264 files, but I want to use DVD SP not iDvd. The DVD presets in Compressor just don't seem to get the files small enough, so I was wondering if anybody had some suggestions...
    Many thanks
    Nick

    15 hours???
    You will need to use MPEG1, or half D1 MPEG2 at the very minimum (or your max bitrate would have to be no more than 1Mbps), you'll need a dual layer disc and then compress your audio to AC3 at 192kbps. Then, and only then, could you get close to 15 hours on a single disc.
    Unless you use a double sided dual layer disc (a DVD18) if you can find one to burn to. In this case, you can raise the bitrate to a whopping 2mbps.
    If you use MPEG1 then your video bitrate will naturally be in the order of 1Mbps, and you will know from watching MPEG1 footage that the quality is low. Using Half D1 means you can use MPEG2, and your bitrate can be low (as you are losing half the horizontal resolution) and still maintain some quality. In my opinion, Half D1 gives a better result than MPEG1, but it is subjective.
    I believe that you can raise the encoding rate on half d1 to about 2mbps on a DVD-9 to get 900 minutes on the disc, but you'll need to do some bit budgeting to be sure.
    It's a big ask, whichever route you follow, and as Shawn said, almost certainly going to look very low quality.

  • Screen protector that fits iPhone 6's curved display

    i have a screen protector on my 6 but it's cracked and I want a new one. The one I have now doesn't cover the curved edges of the phone and I was wondering if anyone had a screen protector that did cover it. I know bodyguardz just came out with The Crown but I don't know if it's good or not. Does anyone have it already?

    It depends - lay your phone flat on a table and use the edge of a credit card to firmly press down on the screen protector just before the bubble starts and move the credit card towards the edge
    You may be able to at least make the size of the bubble smaller
    But that means there is an area of loose contact where air and dust will accumulate again so any gains may be temporary
    (965)

  • Multiple Gaussian Blurs

    I have a client with a system that has some kind of  blend of old and new plugins on the system. There are 2 different Gaussian Blurs. There's "Color" and "Solid Color." Essentially, it has today's plugins and also stuff from a previous version of FCP.
    Where does Final Cut keep it's default stock plugins? I've scoured the libraries and looked all over the place and I can't find them. I just want to delete the old ones and make  sure they never show up ever again.
    I miss the old days of System 9 when you told it to search your computer and it searched EVERYWHERE for EVERYTHING that you were trying to find. Now if something is hiding in a library, it won't show up in Finder searches.

    Yeah, two Gaussian Blurs. One is the normal with a popup RGB+Alpha by default and a number slider to pick the amount of blur. The other version has separate horizontal and vertical sliders. I think that's an old version from maybe FCP v4.
    As for that folder location, that's where your plugins go that you install in addition to the default plugins. I'm looking for the built-in plugins. I'm guessing something got merged in from an older installation.
    Well, huh... I switched Effects>Effect Availablility> from Only Recommended Effects to All Effects on my home studio system and now *I* have 2 Gaussian Blurs too. I guess those old versions of the plugins (which won't render on my client's rig) are actually hiding in all of our installations. By default they're hidden by the Effect Availability selection.
    And on the Color/Solid Color, I forgot about that one. Now I remember that one is for FCP and the other is installed with Motion or something like that.
    OK, I don't guess I need to know where the plugins are hiding since I can kill the wonky ones.

Maybe you are looking for

  • Error while running application in Jdeveloper 11i

    Hi All, I am trying to run the ADF sample application in my Jdeveloper 11i... Iam getting the following error: Error: Remote deployment failed #### Cannot run application Application1 due to error deploying to IntegratedWebLogicServer. I tried to ope

  • Why does my button no longer work in Flash Player 8?

    Hi, I have built a site in Flash MX a while ago. Now I'd like to upgrade things a bit while testing the new Adobe Flash CS3. To be able to use a new function ("anti-alias for readability") the program warns me that "this feature is not supported by F

  • How do I export a file from iMovie that is larger than 15min?

    I currently made a video on iMovie that I would like to export. However everything I have tried ends with a message coming from iMovie saying the file is too long. I've heard of exporting to quicktime but in the share option i don't see quicktime. I

  • Help With Scrolling Menu / Button Rollovers

    First thank you to anyone who can answer and help with this question. http://paragon.sortismarketing.com - at this link I have created a site with a simple scrolling menu. Now what I want to happen is when you rollOver the buttons on the scrolling me

  • How to map data in xml format to BAPIs tructures?

    A webservice call to an external system from XI, is returning data to XI in xml format. This needs to be formatted to map to the structure of BAPI from SAP. I searched and found several threads pointing to do transformations. But I am not sure where