How to calculate the middle weighted average ?

Dear all,

I'm trying to calculate the center (or middle weighted average) of a curve (see joint file)

Actually, is really difficult for me essentially because I have negative energy values

Do you know what kind of function or procedure I can use?

Thank you

Best regards,

 

Igor File

It is not really clear to me what you are trying to do. Are you looking for the 'center of mass' of the whole curve? Our what do you mean by center? In any case, the energy values should not be of concern. I think you could also just use the wave points directly and then convert back to scaled energy values in a second step.

What is your analysis goal here? What sort of weighting do you envision? Are you trying to find the area under individual peaks in your data? I have attached a modified version of your file containing a fit using our Multipeak Fit package. I used Igor 9 beta to do the fit, and that means I used an updated version of the Multipeak Fit, meaning that you might not be able to open it using Igor 8.

I guess the following works, if I understand the center of mass correctly (i.e., x_center = integral(x*f(x)) / integral(f(x)) ):

Duplicate/O OP, OP_weight
OP_weight *=x
print area(OP_weight)/area(OP)

This gives -2.75592.