Dear

Thanks everybody for the suggestions  that (even it can be used as it stands) 
have been a great source of inspiration to fix my issue.

Regards

Paul


----- Mail d'origine -----
De: Samuel Gougeon <[email protected]>
À: International users mailing list for Scilab. <[email protected]>
Envoyé: Fri, 24 Apr 2015 21:03:23 +0200 (CEST)
Objet: Re: [Scilab-users] Envelop of a noisy curve

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