Hello,
Le 24/04/2015 14:05, [email protected] a écrit :
Dear All,

I am absolutly not familiar with "signal processing" field, so my question is 
probably naïve: how can I proceed to get the envelop curve (maximum values) of a non 
periodic noisy signal ?
Here is an example and its result:

x  =  linspace(0,20,300);
y  =  exp((2-x)/5).*sin(x)+rand(x);
clf
plot2d(x,y)
e  =  gce();
e  =  e.children;
e.foreground  =  color("grey80");

d  =  diff(y)  ./  diff(x);
pmax  =  find(d(1:$-1)>=0  &  d(2:$)<0)+1;
pmin  =  find(d(1:$-1)<0  &  d(2:$)>0)+1;
// edges corrections
if  d(1)<0  then
    pmax  =  [1  pmax]
end
if  d($)<0  then
    pmin  =  [pmin  length(y)]
end
//
plot(x(pmax),y(pmax),"r",x(pmin),y(pmin),"b")


Zooming on that shows in some places the limits of this naive approach, to be refine.

Regards
Samuel


_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to