DATAMANIP (kdatamanip) functions


LIBRARY ROUTINE

lknoise - introduce noise in source object

LIBRARY CALL

int lknoise(
   kobject src_obj,
   char    *function,
   int     add_flag,
   double  spec1,
   double  spec2,
   kobject dst_obj)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

The following is the library routine that performs the addition of noise to a data object or the replacement of the value segment of a data object with noise. The routine takes an input data object, an optional gating data object, a noise type, specs related to the noise, a flag indicating the add \replace operation, and an output data object in which to store the result. The following types of noises are supported by this routine:

.TS 
center tab(:) ;
l l .
Gaussian Noise    :  (Mean, Variance)
Rayleigh Noise    :  (Variance)
Uniform Noise     :  (Maximum, Minimum)
Poisson Noise     :  (Amount of time, Variance)
Exponential Noise :  (Variance) 
.TE
The right hand side above indicates the paramaters needed to specify each kind of noise. Therefore if lknoise() were called with:

lknoise(i, NULL, "ray", TRUE, 1.0, 2.0, o);

then the following would be performed:

o = i + Rayleigh Noise of variance 1.0

It may be noted here that the value passed in the second spec (2.0) is ignored since it only 1 value is needed for specifying a Rayleigh distribution.

The formula used to derive the gaussian random random numbers is the Box-Mueller method and was taken from Numerical Recipes : The Art of Scientific Computing (Press, Flannery, Teukolsky, and Vetterling) 1986.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

Destroys the map segment on the destination object if the source object contains both map and value data. Also the size and datatype of the value segment is set to the size and datatype of the the mapped source object.

RESTRICTIONS

none

MODIFICATION

none

FILES

$DATAMANIP/objects/library/kdatamanip/src/lknoise.c

SEE ALSO

kdatamanip(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.