Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Member Login

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Eng-Tips
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I just wanted to say that you guys RULE, a million thank you's to whoever created, and/or manages this site. KEEP UP THE GOOD WORK..."

Geography

Where in the world do Eng-Tips members come from?
birdswords (Coastal)
21 May 12 16:30
Hi All,

I have a logic problem I am having trouble solving with MATLAB. My objective is to select and count peaks in a dataset. However, findpeaks and peakseek function will not work.

My dataset consist mostly of electronic noise, with intermittent high frequency oscillations generated by a sensor responding to pressure impacts. When there is no pressure impacting the sensor, the dataset consist only of electronic noise (<0.00007). When the sensor is activated, the signal peaks 2-4 order of magnitude above the noise level (0.001> x >0.1). The first or second peak is the highest peak in the oscillation and the oscillation decreases at a constant rate for the next 10 to 20 observations (as the sensor returns to its equilibrium represented in the dataset as electronic noise level).

I can select out the peaks for single pressure impacts and count them. However, the PROBLEM IS counting MULTIPLE PRESSURE IMPACTS WITHIN 10-20 OBSERVATIONS...i.e. the signal peaks, then begins to decrease and a constant rate, and then another peak occurs before it reaches electronic noise.

So the problem is: how do you separate and count double peaks within a dataset that has single and double pressure impacts?
birdswords (Coastal)
22 May 12 11:39
This is the code that I have written thus far, but I get error messages. The error message is a line 5: peakCount = r(1,1). . Anyone have any ideas?

function [xx] = reducetopeak (xx)
xx(xx(:,:) <=(2*std(xx)), :) = 0;

r = find(xx);
peakCount = r(1,1);
count = peakCount + 1;test

while (count < length(xx))
while (xx(count, 1) <= 0.50*xx(peakCount, 1))
xx(count, 1) = 0;
count = count + 1;
if count > length(xx)
break
end
end
peakCount = count;
count = peakCount + 1;

end


IRstuff (Aerospace)
22 May 12 17:48
Some code comments would be useful.

TTFN
FAQ731-376: Eng-Tips.com Forum Policies

birdswords (Coastal)
23 May 12 12:58

function [xx] = reducetopeak (xx)
xx(xx(:,:) <=(2*std(xx)), :) = 0; %brings noise level down to zero

r = find(xx); % find the first nonzero element...so finding the first peak
peakCount = r(1,1); %specifying the first peak for while loop to begin
count = peakCount + 1; %defining the next variable for comparison of peak values

while (count < length(xx))
while (xx(count, 1) <= 0.50*xx(peakCount, 1)); %this compares adjacent peaks, if the next peak %is
xx(count, 1) = 0;
count = count + 1;
if count > length(xx)
break
end
end
peakCount = count;
count = peakCount + 1;

end
birdswords (Coastal)
23 May 12 13:00

function [xx] = reducetopeak (xx)
xx(xx(:,:) <=(2*std(xx)), :) = 0; %brings noise level down to zero

r = find(xx); % find the first nonzero element...so finding the first peak
peakCount = r(1,1); %specifying the first peak for while loop to begin
count = peakCount + 1; %defining the next variable for comparison of peak values

while (count < length(xx))
while (xx(count, 1) <= 0.50*xx(peakCount, 1)); %this compares adjacent peaks, if the next peak is 50% less than the previous peak, then make that peak zero
xx(count, 1) = 0;
count = count + 1;
if count > length(xx)
break
end
end
peakCount = count;
count = peakCount + 1;

end

Thanks for checking this out.
hacksaw (Mechanical)
26 May 12 21:29
just counting raw data is going to be tough, have you considered autocorrelation or time series analysis methods to better characterize you data
GregLocock (Automotive)
26 May 12 22:43
So you need to identify the sequence of amplitude peaks

9 10 9 8 7 6 5 4 3 2 1

and

10 9 8 7 6 5 4 3 2 1

as single peaks

and

7 6 5 10 9 8 7 6 5 4 3 2 1

as a double?

If so that seems rather a banal piece of programming.


Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close