[Scilab-users] Re : Re: Envelop of a noisy curve

paul.carrico at free.fr paul.carrico at free.fr
Mon Apr 27 08:27:02 CEST 2015


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 <sgougeon at free.fr>
À: International users mailing list for Scilab. <users at lists.scilab.org>
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, paul.carrico at free.fr 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






More information about the users mailing list