Advice on Library Interface

Matthew Donadio m.p.donadio@ieee.org
Wed, 07 May 2003 11:18:01 -0400


Hi all,

One part of the DSP library that I am working on is a module for
generating sequences of Gaussian random variables.  Since this may be of
use to people outside the DSP community, I wanted to get some
suggestions on the interface.

Right now, I have a few different methods for generating white gaussian
noise.  They all behave the same, but have different ranges and
efficiencies.

1.  Should the functions generate the necessary uniforms, or accept a
list of uniforms?  In other words, shuld the signature be

	wgn :: Int      -- ^ seed to generate the uniforms
            -> [Double] -- ^ list of Gaussian random variables

or

	wgn :: [Double] -- ^ list of uniform random variables
            -> [Double] -- ^ list of Gaussian random variables

The first is what I currently have implemented, but the second is more
flexible.

2.  Should the functions accept mean and/or variance parameters, or
should they generate unit normals?  For those who forget

	X' = mean + sqrt var * X

or
	X' = mean + stddev * X

For a point of reference, the GNU scientific library function for WGN
has a stddev parameter.

I will probably be sending out a bunch of other emails in the next week
or two.

Thanks.

-- 
Matthew Donadio (m.p.donadio@ieee.org)