Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
peak detection and analysis

Subject: peak detection and analysis

From: Megan

Date: 2 Oct, 2007 10:17:22

Message: 1 of 5

Hello
I need to do some data analysis which I imagine is very
simple to do but have been looking around and have no idea
where to start.
I have one dimensional data sets which are noisy where I
want to detect the peaks (both positive and negative) and
thenextract some properties of these peaks like amplitude,
time-to-peak and half width.
The peaks come sporadically and do not all have the same
shape, and are often asymmetrical.
Thank you

Subject: peak detection and analysis

From: David B. Chorlian

Date: 2 Oct, 2007 17:52:13

Message: 2 of 5

In <fdt5ri$oa8$1@fred.mathworks.com> "Megan " <megsoc@gmail.com> writes:

>Hello
>I need to do some data analysis which I imagine is very
>simple to do but have been looking around and have no idea
>where to start.
>I have one dimensional data sets which are noisy where I
>want to detect the peaks (both positive and negative) and
>thenextract some properties of these peaks like amplitude,
>time-to-peak and half width.
>The peaks come sporadically and do not all have the same
>shape, and are often asymmetrical.
>Thank you

Try a Savitsky-Golay filter, find the derivative and look for
zero-crossings.

--
David B. Chorlian
Neurodynamics Lab SUNY/HSCB
chorlian@cns.hscbklyn.edu
davidc@panix.com

Subject: peak detection and analysis

From: Paul

Date: 9 Oct, 2007 18:56:57

Message: 3 of 5

On Oct 5, 5:22 pm, "Paul Mennen" <nos...@mennen.org> wrote:
> Paul <gtrp...@gmail.com> wrote in message
> > Megan,
> > this is a simple function for a single vector peak
> > analysis. It outputs the index (position) into the
> > array of the location of all local minima or maxima.
>
> You have to be careful with a function that simple
> especially if your data has limited precision. For
> example suppose your data looks like:
>
> d = [4 5 6 8 8 7 5 2 1];
>
> You would hope to find a local max somewhere, yet
> your function says that there are none. If your data
> has lots of bits, you probably don't have to worry
> about this.
>
> I've written some a complicated functions that
> attempts to deal with this and other similar situations.
> I'll share it you want it, however I just had a thought
> of another method. How about low pass filtering the
> data slightly. Maybe an FIR filter such as:
> [1.0 0.99999]. The slight asymmetry is to deal with
> an input such as [4 5 6 8 8 6 3 1].
>
> ~Paul Mennen

Good point, Paul...I make a fundamental assumption that neighboring
values will treat the first as the peak/trough. In seismic data (what
I used this on), this is rarely an issue, but something to watch out
for.

Subject: peak detection and analysis

From: Miroslav Balda

Date: 9 Oct, 2007 20:46:08

Message: 4 of 5

 Paul <gtrpaul@gmail.com> wrote in message
<1191956217.659229.117090@g4g2000hsf.googlegroups.com>...
> On Oct 5, 5:22 pm, "Paul Mennen" <nos...@mennen.org> wrote:
> > Paul <gtrp...@gmail.com> wrote in message
> > > Megan,
> > > this is a simple function for a single vector peak
> > > analysis. It outputs the index (position) into the
> > > array of the location of all local minima or maxima.
> >
> > You have to be careful with a function that simple
> > especially if your data has limited precision. For
> > example suppose your data looks like:
> >
> > d = [4 5 6 8 8 7 5 2 1];
> >
> > You would hope to find a local max somewhere, yet
> > your function says that there are none. If your data
> > has lots of bits, you probably don't have to worry
> > about this.
> >
> > I've written some a complicated functions that
> > attempts to deal with this and other similar situations.
> > I'll share it you want it, however I just had a thought
> > of another method. How about low pass filtering the
> > data slightly. Maybe an FIR filter such as:
> > [1.0 0.99999]. The slight asymmetry is to deal with
> > an input such as [4 5 6 8 8 6 3 1].
> >
> > ~Paul Mennen
>
> Good point, Paul...I make a fundamental assumption that
neighboring
> values will treat the first as the peak/trough. In seismic
data (what
> I used this on), this is rarely an issue, but something to
watch out
> for.

There are several functions in file exchange which might
help you to solve the issue. I have build the function extr
which is in FEX under Id 10272. Position of extremes is
determined by logical array, say L, provided a call is made as
L=extr(x);
xmax=x(L{1}); % all maxima
xmin=x(L{2}); % all minima
dTmax=diff{xmax); % number of sampling periods
% between positive extrems
dTmin=diff(xmin); % ditto for negative extrems

I hope that it helps.
Mira

Subject: peak detection and analysis

From: Navaneetha Kannan Viswanathan

Date: 10 Mar, 2011 15:59:07

Message: 5 of 5

Hi,
 
Can you please guide me on how to design a FIR filter for peak detection in a set of images and plotting it out. (MATLAB)
It would be of a greater help.
 
My input pictures with Laser stripe
https://picasaweb.google.com/lh/sredir?uname=v.navaneethakannan&target=ALBUM&id=5579922441378566865&authkey=Gv1sRgCNCYsYik8c7obQ&feat=email

Kindly help me out.
 
Thanks,
VJ


 "Miroslav Balda" <miroslav.nospam@balda.cz> wrote in message <fegpag$eg8$1@fred.mathworks.com>...
> Paul <gtrpaul@gmail.com> wrote in message
> <1191956217.659229.117090@g4g2000hsf.googlegroups.com>...
> > On Oct 5, 5:22 pm, "Paul Mennen" <nos...@mennen.org> wrote:
> > > Paul <gtrp...@gmail.com> wrote in message
> > > > Megan,
> > > > this is a simple function for a single vector peak
> > > > analysis. It outputs the index (position) into the
> > > > array of the location of all local minima or maxima.
> > >
> > > You have to be careful with a function that simple
> > > especially if your data has limited precision. For
> > > example suppose your data looks like:
> > >
> > > d = [4 5 6 8 8 7 5 2 1];
> > >
> > > You would hope to find a local max somewhere, yet
> > > your function says that there are none. If your data
> > > has lots of bits, you probably don't have to worry
> > > about this.
> > >
> > > I've written some a complicated functions that
> > > attempts to deal with this and other similar situations.
> > > I'll share it you want it, however I just had a thought
> > > of another method. How about low pass filtering the
> > > data slightly. Maybe an FIR filter such as:
> > > [1.0 0.99999]. The slight asymmetry is to deal with
> > > an input such as [4 5 6 8 8 6 3 1].
> > >
> > > ~Paul Mennen
> >
> > Good point, Paul...I make a fundamental assumption that
> neighboring
> > values will treat the first as the peak/trough. In seismic
> data (what
> > I used this on), this is rarely an issue, but something to
> watch out
> > for.
>
> There are several functions in file exchange which might
> help you to solve the issue. I have build the function extr
> which is in FEX under Id 10272. Position of extremes is
> determined by logical array, say L, provided a call is made as
> L=extr(x);
> xmax=x(L{1}); % all maxima
> xmin=x(L{2}); % all minima
> dTmax=diff{xmax); % number of sampling periods
> % between positive extrems
> dTmin=diff(xmin); % ditto for negative extrems
>
> I hope that it helps.
> Mira
>
>
>

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us