Heh. This is much better than my suggested method, both in speed and in resulting in a well-defined envelope. I'll have to remember it.
On Fri, 2015-04-24 at 21:03 +0200, Samuel Gougeon wrote: > Hello, > Le 24/04/2015 14:05, paul.carr...@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 > > > _______________________________________________ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- Tim Wescott www.wescottdesign.com Control & Communications systems, circuit & software design. Phone: 503.631.7815 Cell: 503.349.8432 _______________________________________________ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users