<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Working now, thanks Claude!<br><br><div>> To: pd-list@lists.iem.at<br>> From: claude@mathr.co.uk<br>> Date: Sun, 17 Apr 2016 12:10:04 +0100<br>> Subject: Re: [PD] Generate a Gaussian curve<br>> <br>> Hi Liam,<br>> <br>> On 17/04/16 07:52, Liam Goodacre wrote:<br>> > Hi all<br>> ><br>> > This is basically just a maths problem. I'm looking to fill an array with a  Gaussian curve and be able to control the sigma value (and any other relevant variables), but my math skills aren't good enough! I tried this, based off of the standard function listed on Wikipedia:<br>> ><br>> > expr $f2 * pow (2.71828, -(($f1-$f3)^2/(2*$f4^2)))<br>> <br>> I think in expr, ^ means bitwise xor instead of power.  I'd rewrite it as:<br>> <br>> expr $f2*exp(-($f1-$f3)*($f1-$f3)/(2*$f4*$f4))<br>> <br>> ><br>> > but there must be a mistake because I'm not getting the right curve.<br>> ><br>> > Can anyone help?<br>> ><br>> > (NB: The point is to find a replacement for the [gauss] external, using the nice new [array random] function).<br>> ><br>> > Liam<br>> <br>> <br>> Claude<br>> -- <br>> https://mathr.co.uk<br>> <br>> <br>> _______________________________________________<br>> Pd-list@lists.iem.at mailing list<br>> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list<br></div>                                         </div></body>
</html>