NoiseGenerator¶
- class baseband_tasks.generators.NoiseGenerator(shape, start_time, sample_rate, samples_per_frame, dtype=<class 'numpy.complex64'>, seed=None, **kwargs)[source] [edit on github]¶
Bases:
baseband_tasks.generators.StreamGenerator
Genertator of a stream of normally distributed noise.
To mimic proper streams, data is guaranteed to be identical if read multiple times from a given instance. This is done by storing the state of the random number generator for each “data frame”. Given this, it is important to choose
samples_per_frame
wisely, such that frame sizes are at least of order millions of samples.- Parameters
- shapetuple
First element is the total number of samples of the fake file, the others are the sample shape.
- start_time
Time
Start time of the fake file.
- sample_rate
Quantity
Sample rate, in units of frequency.
- samples_per_frameint, optional
Blocking factor, setting the size of the fake data frames. No default, since should typically be large (see above).
- dtype
dtype
or anything that initializes one, optional Type of data produced. Default:
complex64
- seedint, optional
Possible seed to initialize the random number generator.
- — **kwargsmeta data for the stream, which usually include
- frequency
Quantity
, optional Frequencies for each channel. Should be broadcastable to the sample shape. Default: unknown.
- sidebandarray, optional
Whether frequencies are upper (+1) or lower (-1) sideband. Should be broadcastable to the sample shape. Default: unknown.
- polarizationarray or (nested) list of char, optional
Polarization labels. Should broadcast to the sample shape, i.e., the labels are in the correct axis. For instance,
['X', 'Y']
, or[['L'], ['R']]
. Default: unknown.
Notes
Between instances, data is identical only if seeded identically and if first access of frames is done in the same order, with the same number of samples per frame.