|
"Desert Hike" <deserthike@gmail.com> wrote in message <ij31s0$b96$1@fred.mathworks.com>...
> Torsten Hennig <Torsten.Hennig@umsicht.fhg.de> wrote in message <1260114039.75890.1297411202212.JavaMail.root@gallium.mathforum.org>...
> > > TideMan <mulgor@gmail.com> wrote in message
> > > <a46ea46e-5c58-4ff2-8833-6fcf91c951d5@d23g2000prj.goog
> > > legroups.com>...
> > > > On Feb 11, 11:20 am, "Desert Hike"
> > > <deserth...@gmail.com> wrote:
> > > > > I have a data set of time vs. Intensity. Is there
> > > quick way to normalize this data set, such that the
> > > area under the curve is 1. Perhaps a very stupid
> > > question, but any leads are much appreciated.
> > > >
> > > > It's not a stupid question.
> > > > What it is is lacking in detail:
> > > > 1. Are the t equispaced?
> > > > 2. You say the area is to be unity, but how does
> > > that work in terms
> > > > of units? e.g., if time is in seconds and
> > > intensity is in N/m^2, then
> > > > the area will be N-s /m^2. How can that be unity?
> > >
> > > Thanks for your response and apologies for being a
> > > bit vague. So basically what I have is a
> > > step-response of my instrument (I vs. t). I
> > > differentiate this to get an impulse response
> > > (dI/dt). Now I want to be able to convolve this
> > > impulse response with an arbitrary input to generate
> > > the output.
> > > If I normalize the impulse response such that the
> > > area under the curve is 1, the the output maintains
> > > the same amplitudes as the input (except that now it
> > > is convolved).
> > > To answer your specific question:
> > > 1. Yes, t is equispaced.
> > > 2. For the units: since its the area for the impulse
> > > response, so that is (dI/dt)*dt = I should be 1.
> > > Basically, as I said before, I don't know how to
> > > quickly implement a code so as to normalise a
> > > data-set of x,y values.
> > > Thanks again!
> >
> > ynorm=y./trapz(x,y) ?
> >
> > Best wishes
> > Torsten.
>
>
> Works! Thanks very much !
Btw, how would this work is x was not evenly spaced? if I am correct, trapz (x,y) only works well when x is evenly spaced.
|