Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Dividing by zero

$
0
0
On 6/1/2013 4:45 PM, Jane T wrote:
> dpb <none@non.net> wrote in message <kodf6e$nlq$1@speranza.aioe.org>...
...

>>
>> I'd have to see some of the data and know more about the physical
>> process (I've done a lot of gamma spectroscopy but I'm guess this is
>> markedly different) to have a klew about what one might do.
>>
>> But, it would seem there would be a whole literature on the subject
>> and there's some other way to look at the data rather than dividing by
>> a singularity (isn't there surely???). If this is common way of
>> approaching it someone must have already dealt with the issue...
>>
...

>
> For a number of reasons we are using a non-standard approach, which has
> led to this problem. I wondered about switching to a different
> coordinate system applying the arithmetic and converting back to
> Cartesian, but I don't have enough knowledge to know whether this would
> work.
>
> I've attached a simulated data set below. Column 1 represents the
> measured data, column 2 is the least squares approximation to the data.
> The data can be characterised using Beer's Law
>
...[data elided for brevity]...

This looks a lot like gamma spec other than being upside down
(absoprtion rather than peak) and you're wanting to divide.

In gamma-spec we fit Lorentzian distribution typically w/ the baseline
estimated similarly as you have here. Our products used a combination
nonlinear fitting routine (typically Marquardt) for the nonlinear part
w/ the separable least squares fit of the baseline with a iterative
portion between the two to try to better find the true baseline. In
those spectra there was always overlap rather than a single peak so that
complicated it somewhat.

What I'd do if you want to match the magnitude of the peak you're
getting by the division operation but avoid the numerical instability of
the zero point (altho I don't see that it matters if the sample data is
representative--that's outside the area of interest it would appear)
would be something like the following. Here I just eyeballed the
multiplier to match but you could find it by computing the two and
finding the matching multiplier.

I don't know enough about the problem to know about the actual magnitude
normalization, of course.

I called your sample data JT...

 >> L=length(JT); X=[1:L]';
 >> Q=JT(:,1)./JT(:,2);
 >> D=JT(:,1)-JT(:,2);
 >> ax=plotyy(X,JT,X,[Q D+1 1.35*D+1]);
 >> xlim(ax(1),[50 80]);xlim(ax(2),[50 80])
 >> legend(ax(2),'Q','D+1','1.35*D+1')
 >>

--

Viewing all articles
Browse latest Browse all 19628

Trending Articles