MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Peak Finding

  • To: mathgroup at
  • Subject: [mg126288] Re: Peak Finding
  • From: Bill Rowe <readnews at>
  • Date: Sun, 29 Apr 2012 02:08:03 -0400 (EDT)
  • Delivered-to:

On 4/28/12 at 5:24 AM, richardgreco at (merit_2) wrote:

>I am wondering if there are any peak finding notebooks around or
>examples.  I have been interested in doing some peak finding/peak
>detecting in Mathematica for a while, it has been challenging.  My
>specific area of application is x-ray detection.

The simplest method to find a peak in a set of data would be to
use the built-in function Ordering. That is:

In[4]:= data = RandomReal[1, {10}];
{#, data[[#]]} &[First@Ordering[data, -1]]

Out[5]= {4,0.895344}

Ordering returns the position of the maximum.

However, this simple approach is very sensitive to noise in the
data. With noise, the maximum value could be some distance from
the peak depending on the magnitude of the noise, magnitude of
the peak and sharpness of the peak.

To get around this, you will need to filter the data in some
manner. There are a number of possible approaches, fitting a
known function to the data, using wavelet based methods to
filter noise or fitting an orthogonal polynomial series to the
data. The choice of which approach to use depends on details of
the data.

  • Prev by Date: Re: Transcendental functions
  • Next by Date: Displaying contours over normal Riemann surfaces
  • Previous by thread: Peak Finding
  • Next by thread: Visualizations of homeomorphism of a square