| 1 |
/***************************************************/ |
| 2 |
/*! \class Noise |
| 3 |
\brief STK noise generator. |
| 4 |
|
| 5 |
Generic random number generation using the |
| 6 |
C rand() function. The quality of the rand() |
| 7 |
function varies from one OS to another. |
| 8 |
|
| 9 |
by Perry R. Cook and Gary P. Scavone, 1995 - 2005. |
| 10 |
*/ |
| 11 |
/***************************************************/ |
| 12 |
|
| 13 |
#ifndef STK_NOISE_H |
| 14 |
#define STK_NOISE_H |
| 15 |
|
| 16 |
#include "Generator.h" |
| 17 |
|
| 18 |
namespace Nyq |
| 19 |
{ |
| 20 |
|
| 21 |
class Noise : public Generator |
| 22 |
{ |
| 23 |
public: |
| 24 |
|
| 25 |
//! Default constructor which seeds the random number generator with the system time. |
| 26 |
Noise(); |
| 27 |
|
| 28 |
//! Constructor which seeds the random number generator with a given seed. |
| 29 |
/*! |
| 30 |
If the seed value is zero, the random number generator is |
| 31 |
seeded with the system time. |
| 32 |
*/ |
| 33 |
Noise( unsigned int seed ); |
| 34 |
|
| 35 |
//! Class destructor. |
| 36 |
virtual ~Noise(); |
| 37 |
|
| 38 |
//! Seed the random number generator with a specific seed value. |
| 39 |
/*! |
| 40 |
If no seed is provided or the seed value is zero, the random |
| 41 |
number generator is seeded with the current system time. |
| 42 |
*/ |
| 43 |
void setSeed( unsigned int seed = 0 ); |
| 44 |
|
| 45 |
protected: |
| 46 |
|
| 47 |
virtual StkFloat computeSample( void ); |
| 48 |
|
| 49 |
}; |
| 50 |
|
| 51 |
} // namespace Nyq |
| 52 |
|
| 53 |
#endif |