Convolution.  

   line $t->slice($slice, 
$a->convolveND(ones($boxcar_n)/$boxcar_n)->slice($slice))

You can get fancier:

   $k = exp(-(rvals($hw*4+1)/$hw)**2);
   $k /= $k->sum;
   $a_sm = $a->convolveND($k);


   

On May 3, 2012, at 7:22 AM, Scott Penrose wrote:

> Hi.
> 
> I have a large set of data and reviewing some problem with our hardware (long 
> story, but two bits of equipment). The two measuring units line up nicely at 
> any point along, but the gap between them is growing. 
> 
> <PastedGraphic-6.png>
> 
> use PDL;
> use PDL::Graphics::PGPLOT;
> my $id=dev($^O =~ /MSWin32/ ? '/GW' : '/XSERVE');
> my ($t, $a, $b) = rcols $filename, { COLSEP => ',' };
> 
> line $t->slice($slice), $a->slice($slice), {COLOR=>"Black", YRange => [-600, 
> 600]};
> hold;
> points $t->slice($slice), $b->slice($slice), {COLOR=>"Blue"};
> 
> What is the easiest way to take some average/smoothing (e.g. a simple average 
> of every 10 points would be ok) to graph that.
> 
> hold;
> $avg1 = average $a, 10;
> line $t, $avg1, {COLOR=> 'red'};
> 
> Something like that?
> 
> Sorry if this is a bit basic, I am sure I am missing something obvious.
> 
> Scott
> 
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to