public class NoiseDoubleDataSource extends BaseDoubleDataSource
Modifier and Type | Field and Description |
---|---|
protected double |
amplitude |
protected long |
n |
dataLength, inputSource
NOT_SPECIFIED
Constructor and Description |
---|
NoiseDoubleDataSource(long n,
double dB)
Construct an double data source from which a given amount of white noise can be read.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
The number of doubles that can currently be read from this double data source without blocking.
|
int |
getData(double[] target,
int targetPos,
int length)
Try to get length doubles from this DoubleDataSource, and copy them into target, starting from targetPos.
|
boolean |
hasMoreData()
Whether or not any more data can be read from this data source.
|
getAllData, getData, getData, getDataLength
public NoiseDoubleDataSource(long n, double dB)
n
- the number of samles samples to be readdB
- the energy of the noise, in dB relative to max amplitude. This must be non-positive, and will typically be
between -100 and -3.public boolean hasMoreData()
BaseDoubleDataSource
hasMoreData
in interface DoubleDataSource
hasMoreData
in class BaseDoubleDataSource
public int available()
available
in interface DoubleDataSource
available
in class BaseDoubleDataSource
public int getData(double[] target, int targetPos, int length)
BaseDoubleDataSource
getData
in interface DoubleDataSource
getData
in class BaseDoubleDataSource
target
- the double array to write intotargetPos
- position in target where to start writinglength
- the amount of data requestedCopyright © 2000–2016 DFKI GmbH. All rights reserved.