View previous topic :: View next topic |
Author |
Message |
JensRehanek
Joined: 30 Mar 2011 Posts: 2
|
Posted: Thu Mar 31, 2011 9:43 am Post subject: calculate width of any curve |
|
|
Hello!
I am completely new into this business of Forums and Fortran as well, so please excuse any mistakes or stupid questions...
I have one thing:
I work with a program, programmed with Fortran, which produces any kind of curve and then gives center and width of it.
But with this result of width I am not satisfied, because until now all curves were approximated with a Gaussian, but most of them are not - so this does not give good results.
(I try to find the error in the code or tried to solve this problem anyhow, but it is not easy for me, yet (as I am completely new in this...))
Do you have any idea how to do that?
thank you!!! |
|
Back to top |
|
|
DrTip
Joined: 01 Aug 2006 Posts: 74 Location: Manchester
|
Posted: Sat Apr 02, 2011 8:59 pm Post subject: |
|
|
Jens
I think you need to rethink your question a little!
what do you mean curve?
there are lots of them! an uncountable infinity. Some its is sensible to say a have a width eg a gausian, lorentzian, a skew gaussian etc.
but some it doesn't, how about a parabola, or a cubic?
So I guess you are talking about histograms, or may be spectra.
lets first understand the problem, then we worry about the code
carl |
|
Back to top |
|
|
JensRehanek
Joined: 30 Mar 2011 Posts: 2
|
Posted: Wed Apr 06, 2011 9:42 am Post subject: |
|
|
good morning DrTip
sorry for the delay for answering...
It is neither a gaussian nor lorentz-form.
It is some rocking-curve, which looks quite similar to a hat - there is some kind of sinusoidal or logarithmic slope at the beginning, some maximum and some kind of plateau but slightly decreasing until then there is a mostly faster decrease of any kind (more or less also sinusoidal-shaped...).
My idea is to search for the absolut maximum (mostly I have some kind of "scattered" data, like 100 points, not really uniform...), then decide the value for maximum at the ordinate, divide it by 2, then to find the first value on the left and rexpectively right slope of the curve, which is below the "half-value" and then to scale it with the abscissa.
But maybe there should be some correction, because, as I said before, there are only a total of 100 points for the entire curve so I have mostly not the exact point where the max/2- value should be found.
I hope this description is more or less clearly? |
|
Back to top |
|
|
DrTip
Joined: 01 Aug 2006 Posts: 74 Location: Manchester
|
Posted: Wed Apr 06, 2011 7:38 pm Post subject: |
|
|
OK
I am starting to get the picture
I think may be a picture of example data would help me a bit, but...
The more exotic the nature of the curve, the more problematic noise is going to be. Can you bin data points and average at all (or take more data) and average the resulting rocking curves?
I would say the absolute maxima is going to be a fairly dodgy point to take from your discription, it will be the noise is likely to be quite pronounced.
I think you are describing the full width at half maxima approach to getting the width. And the mean value. I guess this ok depending on what you want. A more advance way would be to do a some form of running fit through the scattered points. The simplest is to do a linear splines, but most people prefer cubic or higher.
Really this is just averaging the data points into a fancy bins but does allow a smooth curve to plotted through the points and then follow the procedure you describe.
Or even better take th gradient of the smooth cubic spline and use maximum absolute slopes to define the RC widths (if that make any sense)
Chances are this will give a more consistent answer with noisy data
Carl
Last edited by DrTip on Thu Apr 07, 2011 9:47 am; edited 1 time in total |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Thu Apr 07, 2011 1:20 am Post subject: |
|
|
Jens,
Calculating the mean, and standard deviation of your sample values would be a good place to start.
These can be related to the "centre and width" of your sample values and also compared to the parameters for other distributions you may be considering as an approximation.
Other values such as 5%, median and 95% may have relevence but that depends on how you wish to use the distribution relationship you are proposing.
John |
|
Back to top |
|
|
DrTip
Joined: 01 Aug 2006 Posts: 74 Location: Manchester
|
Posted: Thu Apr 07, 2011 9:46 am Post subject: |
|
|
Hi John
I will second that, I forgot to suggest it last night
and while we are at it the description of the curves sound like may be the skewness statistics as well
I would still like a picture of the data as the curves in my head is probably outrageously different from the real thing!
Carl |
|
Back to top |
|
|
|