Re: Re: FWHM, InterpolationFunction & Solve

```On Aug 28, 2007, at 2:09 AM, Mathieu G wrote:

> Sseziwa Mukasa a =E9crit :
>> On Aug 22, 2007, at 4:39 AM, Mathieu G wrote:
>>
>>> Hello,
>>> I have a set of discrete data, representing a peak.
>>> I would like to compute the Full Width at Half Maximum (FWHM) of
>>> this peak.
>>> For that I would like to know which points correspond to half the
>>> peak value.
>>> SO far I was considering using an interpolating function, but this
>>> does
>>> not seem to work:
>>>
>>>
>>> DataFile = Import["FFT.dat"];
>>> CleanDataFile = Part[DataFile, 2 ;; Length[DataFile]];
>>> WorkingData = CleanDataFile[[All, {1, 3}]];
>>>
>>> ListLinePlot[WorkingData, PlotRange -> All]
>>>
>>> MaximumFFTY = Max[WorkingData[[All, 2]]];
>>> MaximumFFTPosition = Position[WorkingData, MaximumFFTY][[1, 1]];
>>> MaximumFFTX = WorkingData[[MaximumFFTPosition, 1]];
>>>
>>> DataInterpolation = Interpolation[WorkingData];
>>>
>>> Solve[DataInterpolation[x] == MaximumFFTValue/2, x]
>>>
>>>
>>> Can you help me please? How would you do that?
>>
>> Use FindRoot not Solve:
>>
>> FindRoot[DataInterpolation[x]==MaximumFFTValue/2,{x,MaximumFFTX}]
>>
>> But if you have a model for your signal you should fit that with
>> FindFit rather than doing interpolation.  At any rate this will only
>> work if there is one extremum in your data.
>>
>> Regards,
>>
>> Ssezi
>>
> Hi!
> Even though I read the documentation I still do not understand the
> difference between FindRoot and Solve, can you help?

Solve is essentially for solving linear systems, it also attempts to
solve systems involving trigonometric, exponential and expressions.
It tries to find all possible solutions to an equation which in the
case of your interpolation function may be quite a large set.
FindRoot just searches for the first solution found, which is not
necessarily the closest, given the starting point, if you have only
on peak in your data FindRoot should be able to bracket and locate
the FWHM pretty quickly.

Regards,

Ssezi

```

• Prev by Date: Re: Question on PrincipalValue in Integrate
• Next by Date: RE: Questions on AstronomicalData
• Previous by thread: Re: FWHM, InterpolationFunction & Solve
• Next by thread: Re: Re: Re: FWHM, InterpolationFunction & Solve