Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to express local peak in Matlab

Status
Not open for further replies.

Nab

Member level 4
Joined
Mar 28, 2007
Messages
71
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,288
Location
Paris - France
Activity points
1,746
plz, can some help me, to experess the local peak in matlab
tnks
 

Local peak in Matlab

Hi
I dont know any simple orders in MATLAB for to find local maxima

but maybe :

FIRST LP YOUR DATA,say D

then:
D=[...] %array of your data
C=der(D) % first derivative of your data
C(C<Th & C>-1*Th)=0 % set zero small values
find(C==0)
the latest order will give you the points in which derivative is zero or small.

1)YOU HAVE TO CHOOSE Th PROPERLY
2)DONT FORGET TO INSERT TIME AS A COPEFFICIENT FOR ABOVE RELATIONS (here dt=1)


3)if your data is parametric (& has a simple relation with time),Symbolic toolbox is capable to do what you want(check DSOLVE & DIFF in sym.tool box)

4)HONESTLY ,THERE SHOULD BETTER WAYS!!
I CANT HELP YOU FOR NOW
regards
Armin
 

    Nab

    Points: 2
    Helpful Answer Positive Rating
Re: Local peak in Matlab

thanks, for your answer, but the pb is more difficult,

in the picture there is 2 peak that i want to extract , the 2 peaks that are in the right and left of the graphe, i must have their position , thanks **broken link removed**
 
Last edited by a moderator:

Local peak in Matlab

Hi Nab
I will appreciate if you upload a file containing your data.

(you can use this code to generate it):
%--------------------------------
D=[..];% your data
fid=fopenf('file_name','wt') %open file if not
%available make it
fprintf(fid,%d,D) %(?)write data to file
%-------------------------------

well i'm not sure about the last line ,please check it

thanks
wainting for your response

Armin
 

Re: Local peak in Matlab

@Armin, really thnx ,i'm sorry for the delay, so i tested an other methode and it works here the code, thnx again for your aswers :
z=peaks;
z=z(30,:);
d=diff(sign(diff(z)));
j=find(d==-2)+1;
plot(z)
hold on
plot(j,z(j),'r*')
:D

the pb now, is that my signal is an additive gaussiane white noise,,,:cry:
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top